[SECURITY] Proteksi .env & Konfigurasi Variabel Lingkungan (Sensitive Infromation Exposure)#982
Open
pandigresik wants to merge 4 commits intorilis-devfrom
Open
[SECURITY] Proteksi .env & Konfigurasi Variabel Lingkungan (Sensitive Infromation Exposure)#982pandigresik wants to merge 4 commits intorilis-devfrom
pandigresik wants to merge 4 commits intorilis-devfrom
Conversation
… Information Exposure)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Perbaikan issue #967
Monitoring & Alerting untuk Akses .env
Overview
Dokumen ini menjelaskan cara monitoring dan alerting untuk mendeteksi upaya akses ke file
.envatau dotfile sensitif lainnya.File
.env.exampleberisi nilai default (testing_db,root,secret) yang HANYA untuk testing (GitHub Actions).Untuk Production:
rootuntuk databaseProteksi yang Diterapkan
1. Apache (.htaccess)
File
public/.htaccesssudah dikonfigurasi dengan 3 layer proteksi:Proteksi:
/.env.git,.htaccess,.htpasswd, dll)2. Nginx (Alternatif)
Jika menggunakan Nginx, tambahkan konfigurasi berikut di server block:
Monitoring
Apache Access Log
Untuk monitoring, periksa access log Apache:
Format Log Entry (Apache)
Informasi yang tercatat:
Nginx Access Log
Alerting
Script Monitoring Sederhana
Script
scripts/monitor-env-access.shsudah tersedia untuk monitoring:Integrasi Telegram Alert
Cron Job Setup
Testing
Verifikasi Proteksi
Automated Testing
Gunakan script
scripts/test-env-protection.sh:Verifikasi Log
Troubleshooting
.env Masih Dapat Diakses
Pastikan mod_rewrite aktif (Apache):
Pastikan AllowOverride aktif (Apache):
Clear cache browser dan CDN
Restart web server:
systemctl restart apache2 # atau systemctl restart nginxLog Tidak Muncul
Best Practices
Checklist Security
.envtidak accessible via web.env.examplesudah disanitasi (tanpa credential asli)