Home/Docs/File Integrity

File Integrity Monitoring

Cara Kerja

  1. Baseline dibuat saat instalasi — SHA-256 hash semua file di path yang dikonfigurasi
  2. inotify monitor perubahan realtime
  3. Event dikirim ke panel jika ada modifikasi, penghapusan, atau pembuatan file

Anti-Tamper Binary Guard

Guard terpisah memantau binary agent itu sendiri:

// Setiap 30 detik
func checkBinaryIntegrity(cfg Config, expectedHash string) {
    currentHash := hashFile(cfg.BinaryPath)
    if currentHash == "" {
        RestoreFromBackup(cfg) // Binary hilang, restore
        return
    }
    if currentHash != expectedHash {
        log.Printf("ALERT: Binary integrity violation!")
    }
}