brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: AIDE takes a fingerprint of your system files so a security check shows what changed

Security
~/tips/tip-security-aide-file-integrity

sudo apt install aide

Builds a database of file checksums and later reports every file that changed.

If someone swaps a binary in /usr/bin, nothing will tell you. AIDE does: it stores checksums and attributes of your files, and later compares the disk with that snapshot.

On Ubuntu the package comes with a helper that builds the first database:

sudo apt install aide
sudo aideinit
sudo aide --config /etc/aide/aide.conf --check

aideinit writes a new database to /var/lib/aide/aide.db.new and offers to copy it over the live aide.db. The first run takes a while because it reads every file the config covers. The check then lists files that were added, removed or changed, with the attribute that differs, such as size, permissions or the hash.

After a normal apt upgrade you will see lots of changes, which is expected. I’d accept them by building a fresh database straight after updating, so the next check only shows what changed since then.

The weak spot is the database itself. Someone with root on the box can change files and then update the database to match. For real assurance, copy aide.db to another machine or read-only media after each update and compare against that copy. And expect to tune the config: log files and caches that change all day will otherwise bury the report in noise.

Further reading: aideinit(8) manual page, aide(1) manual page

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link