AIDE

Also known as: Advanced Intrusion Detection Environment

On this page 7

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.

AttributeRule letter or nameWhat a change suggests
PermissionspPrivilege change or misconfiguration
Owner and groupu and gOwnership tampering
SizesContent replaced or appended
Modification timemFile rewritten
Inode numberiFile deleted and recreated
Cryptographic hashessha256, sha512Content changed even if size and time look normal
Extended attributes and ACLsxattrs, acl, selinuxSecurity labels or access rules altered
File attributes tracked by AIDE

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.

PathRecommended ruleReason
/bin, /sbin, /usrFull hashes and attributesSystem binaries should change only through updates
/etcFull hashes, permissions and ownershipConfiguration changes are a common persistence method
/bootFull hashesKernel and boot loader tampering is critical
/var/logPermissions and ownership onlyLog content changes constantly by design
/tmp, /proc, /sysExcludedVolatile or virtual file systems produce noise
Typical AIDE coverage by directory

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.

ToolMethodTimingMain strength
AIDEHash and attribute baselineScheduled scansPrecise record of what changed
auditdKernel audit eventsReal timeShows who changed a file and when
rkhunterSignatures and heuristic checksScheduled scansDetects known rootkits
Integrity Measurement ArchitectureKernel-level measurementAt file accessCan enforce integrity with appraisal
LynisConfiguration auditOn demandBroad hardening recommendations
AIDE and neighboring tools

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.

SymptomCauseFix
Hundreds of changes every dayVolatile paths includedExclude logs, caches and spool directories
Changes after every update ignoredDatabase never refreshedRun aide --update after reviewed maintenance
Attack hidden from reportDatabase stored on the monitored hostKeep a verified copy off the host
Scans take hoursToo many hash types on large treesUse one strong hash such as SHA-256
Changes found too lateWeekly scheduleRun checks at least daily
Frequent AIDE problems

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.