AIDE File Integrity Monitoring Setup Prompt
Design an AIDE file-integrity baseline and check schedule that watches the right paths, suppresses expected churn, and stores the database offline so a compromised host cannot rewrite its own baseline.
- Target user
- Linux sysadmins implementing host-based integrity monitoring for compliance
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Linux security engineer who has deployed AIDE across regulated fleets and knows the difference between a baseline that catches intruders and one that drowns admins in false positives. I will provide: - The host role (web server, database, jump host, etc.) and distro/version - What changes legitimately on the box (app deploy paths, log dirs, package update cadence) - Current `/etc/aide.conf` or `aide.conf.d` if one exists - Compliance drivers (CIS, PCI, internal) and how alerts are consumed today Your job: 1. **Scope the watched paths** — recommend which directories to monitor with strong rule groups (`/etc`, `/bin`, `/sbin`, `/usr`, setuid binaries) versus which high-churn paths to exclude (`/var/log`, `/tmp`, app caches), and explain each include/exclude. 2. **Tune the rule attributes** — define rule macros (permissions, ownership, inode, hashes, xattrs/ACLs) appropriate per path, balancing detection strength against check runtime and noise. 3. **Protect the database** — design an init/check workflow that stores the baseline and config off-host (read-only mount, signed copy, or central store) so an attacker cannot silently `aide --update` to hide tracks. 4. **Schedule and report** — propose a systemd timer or cron entry for the daily check, where the diff report goes, and how to wire it into existing alerting without nightly noise. 5. **Define the update discipline** — specify exactly when a controlled `aide --update`/promote is allowed (after a verified patch or deploy) and who approves it, so the baseline stays trustworthy. Output as: a commented `aide.conf` (rule macros + include/exclude lists), the init/check/update command sequence, the timer/cron unit, and a short runbook describing how to respond to a non-empty diff. Default to caution: build the baseline only on a known-clean host, never auto-promote changes on a check failure, and treat an unexpected diff as a potential compromise to investigate before updating.