AIDE, the Advanced Intrusion Detection Environment, is an open-source file integrity monitoring tool that records cryptographic hashes and attributes of selected files in a baseline database and later reports every difference. In Linux security, it serves as a host-based intrusion detection system that reveals unauthorized changes to binaries, configuration files and libraries after they happen.
AIDE does not block attacks and does not run continuously in the kernel. It works as a scheduled, on-demand scanner, usually started daily by cron or a systemd timer, which makes it lightweight, auditable and well suited to compliance frameworks that require file integrity monitoring, such as PCI DSS and many CIS Benchmarks.
How AIDE detects file changes
AIDE detects changes by comparing the current state of the file system with a trusted baseline database created earlier. During initialization, aide --init walks the paths defined in the configuration file, typically /etc/aide.conf or /etc/aide/aide.conf, and stores selected attributes for every matching file.
A later aide --check repeats the walk and reports added, removed and changed files, listing exactly which attributes differ. After legitimate changes, such as package updates, the administrator runs aide --update, reviews the report and promotes the new database to become the next baseline.
The table below shows the attributes AIDE can record and what a change in each one usually means.
| Attribute | Rule letter or name | What a change suggests |
|---|---|---|
| Permissions | p | Privilege change or misconfiguration |
| Owner and group | u and g | Ownership tampering |
| Size | s | Content replaced or appended |
| Modification time | m | File rewritten |
| Inode number | i | File deleted and recreated |
| Cryptographic hashes | sha256, sha512 | Content changed even if size and time look normal |
| Extended attributes and ACLs | xattrs, acl, selinux | Security labels or access rules altered |
Writing the AIDE configuration
The configuration file defines groups of attributes and selection lines that apply those groups to paths. A custom group such as NORMAL = p+i+n+u+g+s+m+c+sha256 can be applied to /usr/bin, while a lighter group checks only permissions for directories whose contents change often.
Selection lines use three prefixes: a plain path includes it recursively, an exclamation mark excludes it, and an equals sign includes only the directory itself. Regular expressions are allowed, which makes careful anchoring essential to avoid excluding more than intended.
The following table gives typical monitoring choices for different parts of the file system.
| Path | Recommended rule | Reason |
|---|---|---|
/bin, /sbin, /usr | Full hashes and attributes | System binaries should change only through updates |
/etc | Full hashes, permissions and ownership | Configuration changes are a common persistence method |
/boot | Full hashes | Kernel and boot loader tampering is critical |
/var/log | Permissions and ownership only | Log content changes constantly by design |
/tmp, /proc, /sys | Excluded | Volatile or virtual file systems produce noise |
AIDE compared with related Linux security tools
AIDE belongs to a family of detection tools that differ in timing, scope and method. It focuses on integrity of known files, whereas other tools watch events in real time, search for rootkit signatures or audit the whole system configuration.
| Tool | Method | Timing | Main strength |
|---|---|---|---|
| AIDE | Hash and attribute baseline | Scheduled scans | Precise record of what changed |
| auditd | Kernel audit events | Real time | Shows who changed a file and when |
| rkhunter | Signatures and heuristic checks | Scheduled scans | Detects known rootkits |
| Integrity Measurement Architecture | Kernel-level measurement | At file access | Can enforce integrity with appraisal |
| Lynis | Configuration audit | On demand | Broad hardening recommendations |
These tools are complementary rather than competing. A common pattern pairs AIDE, which proves that a file changed, with auditd watch rules, which record the process and user responsible, while rkhunter or chkrootkit adds signature-based checks.
Protecting the baseline and handling reports
The integrity of AIDE depends on the integrity of its database. An attacker with root access can update the database or modify the AIDE binary, so the baseline should be copied to read-only or offline storage, such as write-protected media or a separate verification host.
Report handling is equally important. Reports are usually mailed or forwarded to a central log system, and each change must be matched to a known maintenance event, such as a package update recorded by the package manager. Unexplained changes to binaries in /usr/bin or to files in /etc/pam.d warrant immediate investigation.
Package managers help separate legitimate changes from suspicious ones. Commands such as rpm -Va or debsums verify installed files against vendor-supplied checksums, so an administrator can confirm whether a changed binary still matches the package it came from. Distributions such as RHEL and Debian also ship default AIDE configurations and timers, which give a sound starting point that only needs local exclusions and a protected database location.
Limitations and common mistakes
AIDE is reliable within its design, but several limitations and operating errors reduce its value in practice. The table below lists frequent problems with their causes and fixes.
| Symptom | Cause | Fix |
|---|---|---|
| Hundreds of changes every day | Volatile paths included | Exclude logs, caches and spool directories |
| Changes after every update ignored | Database never refreshed | Run aide --update after reviewed maintenance |
| Attack hidden from report | Database stored on the monitored host | Keep a verified copy off the host |
| Scans take hours | Too many hash types on large trees | Use one strong hash such as SHA-256 |
| Changes found too late | Weekly schedule | Run checks at least daily |
AIDE also cannot detect memory-only malware or changes made and reverted between two scans, which is why it should be one layer in a defense that includes patching, mandatory access control and centralized logging.
The short version
AIDE takes a fingerprint of important files on a Linux server and saves it. Later it checks the files again and lists anything that is new, missing or different.
It works like a guard who photographs every room before leaving and compares the photos the next morning. The guard cannot stop a burglar, but every moved object is noticed, which makes break-ins much harder to hide.
Where it makes a difference
An online retailer that processes card payments must meet the file integrity monitoring requirement of PCI DSS. Its operations team installs AIDE on 30 Rocky Linux web servers, monitors system binaries, /etc and the application directory with SHA-256 hashes, and runs a check every night at 02:00 through a systemd timer.
Reports flow into a central log platform, and the baseline databases are stored on a separate, read-only backup host. One night the report shows a changed /usr/bin/ssh binary on one server while no package update was recorded. The team isolates the server within an hour, confirms a backdoored SSH client planted through a compromised account, and rebuilds the host. Without AIDE, the change would most likely have remained unnoticed for weeks.