← All rules
SOCLE-CLD-GEN-031// Hardening (misc)mediuminventory state

Build and Test AIDE Database

Ensures AIDE is installed and that an initial integrity database exists under /var/lib/aide/aide.db*.

Checked against what is installed or registered, packages present/absent, account databases.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 5 standards

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

AIDE (Advanced Intrusion Detection Environment) detects unauthorized changes to files by comparing the current state against a baseline. That baseline is only useful if a "known-good" database has actually been built from a trusted installation. Without an initialized database, AIDE cannot tell whether a binary, config or library was tampered with, silently providing no protection.

What Pavois checks

Pavois confirms the aide binary is on PATH and that an aide.db* file is present in /var/lib/aide/. It checks the actual on-disk database rather than just the package state, because a package can be installed without the database ever having been initialized, the effective protective artifact is the database file itself.

describe command('command -v aide >/dev/null 2>&1 && ls /var/lib/aide/aide.db* >/dev/null 2>&1 && echo ok || echo ko') do
  its('stdout.strip') { should eq 'ok' }
end

How to verify it is applied

Run command -v aide && ls -l /var/lib/aide/aide.db*. Expect the binary path plus a non-empty database file. A manual check with aide --check (RHEL) or aide.wrapper --check (Debian) should report no unexpected changes on a clean system.

Inspect & investigate

AIDE run results are written to /var/log/aide/aide.log (Debian) or to the report path in /etc/aide.conf, and often mailed to root. Confirm the package with dpkg -l aide / rpm -q aide, and the database file with ls -l /var/lib/aide/aide.db*.

Remediation

No automated harden plan ships for this rule; apply it manually. Install AIDE (apt install aide / dnf install aide), then initialize the baseline: on Debian/Ubuntu aideinit (writes aide.db.new, which you move to aide.db); on RHEL aide --init then mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz. Build the baseline only on a trusted, freshly installed system.

Pavois applies this with its own harden engine, the plan below, not a shell script:

commandaideinit -y -f >/dev/null 2>&1 || aide --init; mv -f /var/lib/aide/aide.db.new /var/lib/aide/aide.db 2>/dev/null || true
nameaide-build-database
not_ifls /var/lib/aide/aide.db >/dev/null 2>&1
resourceexec
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

The critical precaution is trust of the baseline: if you initialize the database on an already-compromised host, AIDE will treat the attacker's files as known-good and never flag them. Build it before exposing the machine to the network. Operationally, the initial scan is I/O heavy and can take minutes on large filesystems, and you must rebuild the database (aide --update) after every legitimate change (package updates, config edits) or you will drown in false positives.

Standards mapping

StandardReferenceTypeVersionConfidence
ANSSI BP-028R76direct2.0high
CIS11.5.2, 6.3.1, 6.1.1directper OS, see the benchmark tablehigh
NISTCM-6(a)supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium
PCI DSS11.5.2supporting4.0.1medium
DISA STIGUBTU-22-651015, UBTU-24-100110directper OS STIG releasehigh

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references