People come looking for an AIDE alternative for two very different reasons. The first is ordinary: AIDE is noisy, the daily mail is unreadable, the database update dance is tedious. That's a usability complaint, and there are plenty of usability answers.
The second reason is the one worth writing about. Someone has thought carefully about their threat model, written down “attacker obtains root on the monitored host,” and then realised that the tool meant to detect exactly that is a userspace program on the host the attacker now owns. Once you've noticed it, no amount of tuning makes it go away. This post is for that second reason.
To be clear up front, because this is a criticism of a design and not of a project: AIDE, Tripwire and Samhain are careful, long-lived tools that do what they say. They compare files against known-good hashes and tell you what changed, and for the failure mode that actually happens most often — a botched deploy, a hand-edited config, a package that drifted — they work. What follows is about a specific adversary they were never structurally able to beat, and what a design has to change to beat it.
The move set
Five things root does, in the order it does them
Assume an attacker has just obtained root on a host running a classic on-host integrity
checker. They aren't in a hurry, they've read the config, and they'd like their change to
/usr/sbin/sshd to stay quiet. Here's the sequence, and for each move, what
happens against a design that keeps the measurement in hardware and the verdict off the box.
Stop the check from running
The cheapest move first. The scan is a cron job or a systemd timer — both root-writable.
Disable the unit, comment the crontab line, or leave the schedule intact and redirect the
report to /dev/null. Nothing crashes, nothing looks broken, and the last
report anyone remembers seeing was clean.
On-host FIM
Works
The schedule lives on the compromised host. Absence of a report reads as “nothing to report.”
Hardware-rooted, off-box
Blocked
The schedule lives on the verifier, which initiates every cycle. A host that stops answering is unreachable, and unreachable is a finding — not a soft-skip.
Re-bless the baseline
More elegant than switching the check off, because the check keeps running and keeps passing. The database of known-good hashes is a file on the host, and the tool ships the command to regenerate it from whatever is on disk right now:
# the modified binary is now the new "known good" # aide --init # mv /var/lib/aide/aide.db.new /var/lib/aide/aide.db # next scheduled run, from the checker's own point of view: # aide --check AIDE found NO differences between database and filesystem. Looks okay!!
The dashboard is green and the tool is not lying — it is faithfully reporting that the filesystem matches its database. The database is just no longer a record of anything true. Tripwire is meaningfully better here: its database and policy are signed with passphrase-protected site and local keys, so re-blessing needs a passphrase the attacker doesn't have — until an administrator types it on the compromised host during a legitimate update, which they will.
On-host FIM
Works
The baseline is local state, and updating it is a normal admin action with no second party involved.
Hardware-rooted, off-box
Blocked
The baseline lives on the verifier and root on the monitored host has no write path to it. Drift is proposed, never auto-accepted: it waits in a pending queue for an operator to approve it, signed and appended to a hash-chained audit log.
Patch the checker itself
If the database is inconveniently signed, go one layer down and attack the thing that reads
it. Root can replace the checker binary with a wrapper that prints the reassuring line,
LD_PRELOAD a shim into it, or simply edit the config so the interesting paths
are no longer in scope. The tool that reports on the system's integrity is itself a file on
that system, subject to exactly the same rules as every other file.
This is the recursion that has no bottom in software: whatever watches the watcher is also on the host. Samhain takes this seriously — stealth mode, self-checks, a read-only config — and raises the cost substantially. It does not change who is above whom.
On-host FIM
Works
Self-protection is a speed bump, not a boundary. Root is above every userspace mitigation the checker can deploy.
Hardware-rooted, off-box
Blocked
There is no checker on the host to patch. The agent makes no pass/fail decision and raises no alarm — it is a relay. Patching it changes nothing that matters, because nothing on the host is trusted to judge.
Lie about the file's contents
This is the move that matters most, and the one usually left out of the discussion — because it defeats the fix everybody reaches for first. Suppose you've done everything right: the database is off the host, the comparison runs from a central server, the checker binary is pulled fresh over the network each time. The remaining question is where the hash comes from. Something has to read the file. On the monitored machine. Through the compromised kernel.
A rootkit that hooks the read path returns the pristine original to whoever asks, and the
modified binary only to execve. Every hash computed on that host is now a
correct hash of the wrong bytes. Your off-host database compares a perfectly good hash
against a perfectly good baseline and finds no difference — a clean answer, computed
honestly, from a poisoned input.
This is why “put the database somewhere safe” isn't the fix. The integrity of the whole scheme rests on the answer to “what does this file hash to?” — and that answer is produced by the machine under investigation. Moving the comparison off-host is worth doing. It doesn't help if the measurement is still taken by the suspect.
The structural answer is to take the measurement somewhere the attacker isn't yet: the kernel's own IMA subsystem hashes each file as it is opened and extends that hash into a TPM Platform Configuration Register. A PCR is extend-only — new value = hash(old ‖ new) — so entries can't be walked backwards and erased, and the record lives in a chip that has no API for “forget that.” Userspace root, however complete, is on the wrong side of that line.
On-host FIM
Works — even off-host
Any scheme whose hashes are computed by userspace on the monitored host inherits whatever that host's kernel decides to show it.
Hardware-rooted, off-box
Blocked below userspace
Measurement happens in the kernel at open time and is anchored in an append-only hardware register the OS cannot rewrite. See the boundary for what a kernel-level compromise changes.
Stop the report from leaving
The last resort if the earlier moves fail: let the finding be generated and stop it at the
door. The host owns its own network stack, its own mail queue, its own syslog forwarder. A
firewall rule is enough. Samhain's central yule server is the strongest answer
among the three, because a client that stops checking in is noticed — which is precisely the
right instinct, and the same one an off-box design starts from rather than adds on.
On-host FIM
Works
The alarm originates on the host, so the host is in the path. Silence is ambiguous when the checker was only ever meant to phone home on bad news.
Hardware-rooted, off-box
Detected, not prevented
A privileged attacker can always cut the wire — that's true of any design. What changes is the reading: the verifier initiated the request, so silence is a specific, timestamped finding about a named host, not an absence of news.
The shape of the fix
What an alternative actually has to change
Walking the moves in order makes the requirement fall out. It isn't a better hash, a stealthier agent, or a cleverer local database — moves 01 through 05 go through all of those. It's three relocations, all in the same direction: take the thing being trusted off the machine being judged.
- The measurement moves into hardware. IMA hashes files in the kernel and extends into TPM PCR 10; the register is append-only, so history can't be rewritten (defeats 02 and 04).
- The evidence is signed by a key the host can't reach. A verifier sends a fresh random nonce and the agent returns a TPM quote: a signed statement of the current PCR values with that nonce folded in, signed by an attestation key whose private half never leaves the chip. Root can relay the real answer or refuse; it cannot compose a clean one, and the nonce means it can't replay a clean one captured before the compromise (defeats 03).
- The verdict is rendered elsewhere. A separate, independently administered verifier holds the baseline, does the comparing, and is the only place an alarm can fire (defeats 01 and 05).
The step that ties the cryptography to something a human can read is the one worth naming: the verifier replays the IMA measurement log and recomputes PCR 10, then checks the result against the value the TPM just signed. The log is the readable list of which files were measured and what they hashed to; the quote is the hardware's signature over the register. Replaying binds them. A host cannot hand over a tidy log that disagrees with its own signed PCR. If you want that argument in full — including why “tamper-proof” is the wrong word and tamper-evident is the right one — there's a separate post on it.
The boundary
What happens when the attacker gets into the kernel
Move 04 said IMA measures below userspace. The obvious next question is what happens when the attacker doesn't stay in userspace — and the honest answer is that a kernel-mode compromise is above IMA, because IMA is the kernel. An attacker executing in kernel context can stop new measurements from being extended. Pretending otherwise would be the same over-claim this post started by objecting to.
Two things remain true anyway, and they're worth being precise about. First, what is already in
the PCR cannot be removed: a register that only extends has no undo, so the record up to the
moment of the kernel compromise is fixed in hardware and already bound to signed quotes the
verifier holds. Second, crossing into the kernel usually means loading a module or booting a
new kernel — and the shipped IMA policy measures exactly those transitions
(MODULE_CHECK, KEXEC_KERNEL_CHECK, KEXEC_INITRAMFS_CHECK,
plus additions to the trust-anchor keyrings), alongside executions and reads. So the act of
crossing the line tends to leave a permanent, hardware-anchored trace before the
attacker is in a position to suppress anything. After that, their options narrow to going
quiet — and going quiet is move 05, which the verifier already treats as a finding.
The rest of the boundary, stated plainly and unchanged from everywhere else we state it: this defends against remote and software-level root compromise. It does not defend against physical attacks — cold-boot, evil-maid, desoldering or interposing the TPM. It does not cover below-TPM firmware implants, or a compromised hypervisor presenting a virtual TPM, where the chip signs a truthful signature over a lie. And the verifier itself becomes a high-value target: compromise it and you can suppress alarms just as effectively as the model it replaces, which is why hardening it is its own piece of work.
The honest other side
Where AIDE still earns its keep
Reasons to keep running it
It needs no hardware. No TPM, no attestation key, no second machine. It runs on the appliance, the ancient VM, the box you don't control the firmware of. Hardware-rooted attestation simply isn't available there.
It runs where we don't. AIDE, Tripwire and Samhain run on *BSD, Solaris and partly on macOS and Windows. Etminan is Linux-only today, because it depends on IMA.
Its path rules are finer-grained. IMA has no kernel-level path filter, so the approach here is to measure broadly and filter on the verifier side. AIDE lets you express precisely what to watch, directly in the config.
Decades of production hardening. Between them these tools have 15–25+ years in the field. That is not a thing a newer design can claim, and elapsed time is the one gap no code change shortcuts.
Which makes the pragmatic answer to “should I replace AIDE?” less dramatic than the framing suggests: run both, for a while, on the hosts that justify it. They fail in different directions. AIDE is excellent at the everyday drift question and costs nothing to keep; hardware-rooted attestation answers the question AIDE structurally cannot, on the subset of machines where an attacker with root is a threat you've actually written down. Running in parallel through one full patch cycle is also the most honest way to evaluate the newer thing — the disagreements between them are the interesting output.
The full feature-by-feature comparison, including where this design is behind, is on the comparison page.
Try the five moves against a host you control
The free Standard edition is a package install and a few-minute quickstart — verifier identity, operator key, agent enrollment, first baseline approval. Then go ahead: stop the agent, edit a watched file, re-bless whatever you like on the host. The verdict isn't there to change.