Host based Intrusion Detection System mit AIDE unter Arch Linux
HIDS - was ist das und wozu nutzt man es?
Die Absicherung von Systemen ist eine der Grund- und Pflichtaufgaben eines jeden verantwortungsbewussten Systemadministrators und Administratorin. Dass dies ist kein einmaliger sondern stetig sich wiederholende Vorgang ist, versteht sich in aller Regel von selbst, so ist es unter anderem wichtig, dass regelmäßig Systemüberprüfungen und Überwachung von Logmeldungen auf verdächtige und ungewöhnliche Ereignisse durchgeführt werden müssen. Zur Absicherung von Computersystem existieren unterschiedliche Ansätze. TLS-Transportverschlüsselung, SecureShell, oder Firewalls wird hier jedem interessierten Admin sofort in den Sinn kommen. Dabei gibt es zwei unterschiedliche Betrachtungsweisen/-richtungen bei den einzelnen Lösungen. Betrachtet und analysiert man in erster Linie Netzwerkverkehr in Netzwerken und/oder Zonengrenzen einzelner Netzwerke und bewertet hierzu entsprechende Protokolle von Netzwerkgeräten wie Switche, Router und Firewalls spricht man von einem NIDS, einem Netzwerk based Intrusion Detection System. Im Gegensatz dazu spricht man von einem HIDSHost based Intrusion Detection System, wenn der Blick primär auf einem Host selbst erfolgt und man mit Hilfe lokaler Informationen Bewertungen über zulässige Änderungen am betreffenden System selbst Entscheidungen über (un)zulässige Änderungen treffen muss und möchte. Ein HIDS konzentriert sich dabei auf detailliertere und interne Angriffe, indem es die Überwachung auf Host-Aktivitäten konzentriert. Dabei versucht ein HIDS wie AIDE lediglich, Systemanomalien und somit Eindringlinge zu erkennen und hat nicht zur Aufgabe aktiv mögliche Angreifer und Bedrohungen zu blockieren! Ein Intrusion Detection System (wie AIDE) versucht lediglich, Eindringlinge zu erkennen, arbeitet aber nicht aktiv daran, ihren Zugang von vornherein zu blockieren. Im Gegensatz dazu arbeitet ein IPS ein Intrusion Prevention System aktiv daran, Bedrohungen zu blockieren und den Benutzerzugriff zu überprüfen.
Eine der Herausforderungen bei der Verwendung von HIDS besteht darin, dass es auf jedem einzelnen Host installiert, konfiguriert und entsprechende Berichte bzw. Logdateien dann auch bewertet werden muss, der vor Eindringlingen geschützt werden soll. Dies kann je nach zur Verfügung stehender Ressourcen zu einer Verlangsamung der Leistung des Hosts und eines eingesetzten HIDS führen. Wir werden uns später daher die Installation und Konfiguration mit Hilfe von Ansible vornehmen. Zur Auswertung der Logmeldungen greifen wir in unserer Umgebung auf graylog zurück.
AIDE
AIDE (Advanced Intrusion Detection Environment) ist ein HIDS, ein Programm zur Erkennung von Eindringlingen, indem es die Integrität von Verzeichnissen und Dateien überwacht.
Hierzu erstellt AIDE auf Basis seiner Konfiguration bei der Erstinitialisierung oder bewusst nach Änderungen am System durch einen entsprechenden Programmaufruf, eine Datenbank des aktuellen Systems. In dieser AIDE-Datenbank werden verschiedene Verzeichnis- und Dateiattribute gespeichert, darunter:
Berechtigungen
Inode-Nummern
Benutzer
Gruppen
Dateigrößen
mtime
ctime
atime
wachsende Größe
Anzahl von Links
Linknamen
AIDE erstellt außerdem eine kryptografische Prüfsumme oder einen Hash jeder Datei unter Verwendung eines oder einer Kombination der folgenden Message-Digest-Algorithmen:
sha1 (deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt)
sha256
sha512
md5 (deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt)
rmd160 (deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt)
ghost (deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt) kann kompiliert werden, sofern mhash-Unterstützung verfügbar ist.
Darüber hinaus können die erweiterten Attribute verwendet werden, sofern sie während der Kompilierung explizit aktiviert werden:
acl
xattr
selinux
Wichtig
AIDE führt auf dem System selbst nur Dateiintegritätsprüfungen durch! Es sucht nicht nach rootkits oder analysiert Protokolldateien auf verdächtige Aktivitäten!
AIDE ist ein Fork des bekannten HIDS Tripwire welches ursprünglich von Rami Lehti und Pablo Virolainen 1999 als freie Alternative zum kommerziellen Produkt Tripwire entwickelt wurde. Zwischen 2003 und 2010 wurde es von Richard van den Berg betreut. Seit Oktober 2010 übernahm Hannes von Haugwitz das Projekt. Die Homepage von AIDE ist hier zu finden. Die aktuelle Version v0.19 von AIDE wird derzeit auf GitHub verwaltet.
In aller Regel wird ein Admin, nachdem ein neuer Host erstellt wurde, initial eine AIDE-Datenbank auf dem neuen System erstellen, bestenfalls bevor der neue Host produktiv mit dem Netzwerk verbunden wird. Diese initiale AIDE-Datenbank ist eine Momentaufnahme des Systems in seinem Normalzustand und ist der Maßstab, an dem alle nachfolgenden Aktualisierungen und Änderungen gemessen werden. Diese Datenbank sollte Informationen über die wichtigsten Systembinärdateien, Bibliotheken, Header-Dateien und alle Verzeichnisse sowie Dateien enthalten, die im Laufe der Zeit unverändert bleiben sollten. Dateien, welche sich häufig ändern, wie z.B. Log- und Protokolldateien Mail-Spools, proc-Dateisysteme, Home-Verzeichnisse von Benutzern oder temporäre Verzeichnisse, nimmt man in aller Regel nicht in die AIDE-Datenbank auf, das sonst später die Meldungen unnötig durch viele unerwünschte und erwartbare Meldungen überflutet werden würde.
Durch erneutes Ausführen von AIDE zur Systemüberprüfung kann ein Systemadministrator Änderungen an systemrelevanten Verzeichnissen und Dateien schnell erkennen und sich ziemlich sicher sein, dass die protokollierten Ergebnisse korrekt sind.
ACHTUNG:
Ein Admin muss sich aber auch im Klaren sein, dass auch mit AIDEkeine absolute Sicherheit gewährleistet werden kann, denn wie alle anderen Systemdateien können auch die Binär- und/oder Datenbankdateien von AIDE kompromittiert werden können!
Ebenso ist vor allem in orchestrierten Umgebungen (Puppet) darauf zu achten, dass nicht etwa ein gerade initiierter Datenbank-Update durch einen Puppet-Agent Lauf abgebrochen wird. So stünde im Extremfall keine aktuelle und valide Datenbank für spätere Systemchecks zur Verfügung, was zu unzähligen false-positive Meldungen führen würde. Die Reputation des HIDS bei den Administratoren wäre in einem solch einem Fall dahin und der erhoffte bzw. geforderte Erfolg mehr als fraglich!
Installation
AIDE kann unter Arch Linux nicht einfach aus dem Core- oder Extras-Repository mit Hilfe des Paketverwaltungswerkzeugs pacman installiert werden. Jedoch gibt es aus dem Arch User Repository kurz AUR, dem Community verwaltetes Repository für Benutzer von Arch Linux, eine Paketbeschreibungen (PKGBUILDs), mit denen Sie ein Paket aus dem Quellcode mit makepkg kompilieren und dann über pacman installieren kann. Möchte man auf den entsprechenden Zielsystemen die hierzu nötigen Kompilierungswerkzeuge nicht vorhalten, so kann man das Paket auch auf einem entsprechenden geschützten Buildhost erstellen und dann lokal, auf dem entsprechendem Zielsystem mit Hilfe von pacman installieren.
Da bei der Installation bzw. beim Kompilieren die Integrität des Quell-Archives an Hand dessen PGP-Signatur geprüft wird, ist es notwendig dass der PGP-Schlüssel mit der Key-ID F6947DAB68E7B931 von Hannes von Haugwitz in unserem Keyring vorhanden ist. Hierzu importieren wir zuerst den betreffenden Public-Key von Hannes:
$ gpg --recv-key 18EE86386022EF57
gpg: key F6947DAB68E7B931: public key "Hannes von Haugwitz <hannes@vonhaugwitz.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
Mit Hilfe von $ gpg --list-keys können wir uns bei Bedarf vergewissern, ob der Schlüssel von Hannes vorliegt:
$ gpg --list-keys
...
pub rsa4096 2011-06-28 [C] [expires: 2026-06-27]
2BBBD30FAAB29B3253BCFBA6F6947DAB68E7B931
uid [ unknown] Hannes von Haugwitz <hannes@vonhaugwitz.com>
uid [ unknown] Hannes von Haugwitz <hvhaugwitz@debian.org>
sub rsa3072 2011-06-28 [E] [expires: 2025-06-27]
sub rsa3072 2011-06-28 [A] [expires: 2025-06-27]
sub rsa3072 2011-06-28 [S] [expires: 2025-06-27]
Darf man aus Sicherheitsgründen auf den Zielsystemen keine Kompilierwerkzeuge vorhalten, so holt man sich das vom eigenen Maintainer erstellen Paketes vom eigenen internen Repo-Server und installiert das Paket mit Hilfe von
pacman lokal wie folgt:
Name : aide
Version : 0.19-1
Description : A file integrity checker and intrusion detection program
Architecture : x86_64
URL : https://aide.github.io/
Licenses : GPL
Groups : None
Provides : None
Depends On : acl e2fsprogs libelf mhash pcre
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 252.71 KiB
Packager : Unknown Packager
Build Date : Wed 09 Apr 2025 05:18:04 PM CEST
Install Date : Wed 09 Apr 2025 07:26:41 PM CEST
Install Reason : Explicitly installed
Install Script : Yes
Validated By : None
aide /etc/
aide /etc/aide.conf
aide /usr/
aide /usr/bin/
aide /usr/bin/aide
aide /usr/lib/
aide /usr/lib/systemd/
aide /usr/lib/systemd/system/
aide /usr/lib/systemd/system/aidecheck.service
aide /usr/lib/systemd/system/aidecheck.timer
aide /usr/share/
aide /usr/share/man/
aide /usr/share/man/man1/
aide /usr/share/man/man1/aide.1.gz
aide /usr/share/man/man5/
aide /usr/share/man/man5/aide.conf.5.gz
aide /var/
aide /var/lib/
aide /var/lib/aide/
aide /var/log/
aide /var/log/aide/
Programminfo
Bei Bedarf können wir uns alle Optionen mit denen das AIDE-Binary gebaut wurde zusammen mit den Default Konfigurationsparametern, den verfügbaren einkompilierten Attributen, den verfügbaren Hass-Attributen sowie den defaultmäßigen Compound Groups uns anzeigen lassen.
AIDE(1) User Commands AIDE(1)
NAME
aide - Advanced Intrusion Detection Environment
SYNOPSIS
aide [parameters] command
DESCRIPTION
AIDE is an intrusion detection system for checking the integrity of files.
COMMANDS
--check, -C
Checks the database for inconsistencies. You must have an initialized database to
do this. This is also the default command. Without any command aide does a check.
--init, -i
Initialize the database. You must initialize a database and move it to the appro‐
priate place (see database_in config option) before you can use the --check com‐
mand.
--dry-init, -n (added in AIDE v0.17)
Traverse the file system, match each file against the rule tree and report to std‐
out.
Neither reports nor the database are written in this mode.
To change the log level in this mode please use the --log-level command line para‐
meter.
In this mode aide exits with status 0.
--update, -u
Checks the database and updates the database non-interactively. The input and
output databases must be different.
--compare, -E
Compares two databases. They must be defined in config file with database=<url>
and database_new=<url>.
--list (added in AIDE v0.19)
List the entries of the database in human readable format (analogous to the de‐
tailed report output of new files). Note that the checksums are base16 encoded.
--config-check, -D
Stops after reading in the configuration file. Any errors will be reported. To
change the log level in this mode please use the --log-level command line parame‐
ter.
--path-check=file_type[=file_system_type]:path, -p file_type[=file_system_type]:path
(added in AIDE v0.17)
Read configuration and match provided file_type, optionally file system type
(added in AIDE v0.19, Linux only) and path against rule tree.
The path is independent of what is in the actual file system and needs to be ab‐
solute. See RESTRICTED RULES section in aide.conf (5) for supported file types and
file system types.
Please note that the specified file system type is only applied to the file and
not to the parent directories of the path. If a restricted rule cannot be matched
against a parent directory due to the missing file system type aide raises a warn‐
ing.
To change the log level in this mode please use the --log-level command line para‐
meter.
In this mode aide exits with status 0 if the file would be added to the tree, 1 if
not and 2 if the file does not match the specified limit.
PARAMETERS
--config=configfile , -c configfile
Configuration is read from file configfile (see --version output for default
value). Use '-' for stdin.
--limit=REGEX , -l REGEX (added in AIDE v0.16)
Limit command to entries matching REGEX. Note that the REGEX only matches at the
first position.
Example
Only check and update the database entries matching /etc (i.e. the /etc direc‐
tory) while leaving all other entries unchecked and unchanged:
aide --update --limit /etc
--before="configparameters" , -B "configparameters"
These configparameters are handled before the reading of the configuration file.
See aide.conf (5) for more details on what to put here.
--after="configparameters" , -A "configparameters"
These configparameters are handled after the reading of the configuration file.
See aide.conf (5) for more details on what to put here.
--log-level=log_level,-Llog_level (added in AIDE v0.17)
The log level to use (see aide.conf (5) for available log levels and more de‐
tails). This overwrites the log_level value set in any configuration file.
--verbose=verbosity_level,-Vverbosity_level (REMOVED in AIDE v0.17)
Removed, use log_level and report_level config options instead (see aide.conf (5)
for details).
--report=reporter,-r reporter (REMOVED in AIDE v0.17)
Removed, use report_url config option instead (see aide.conf (5) for details).
--workers=WORKERS , -W WORKERS (added in AIDE v0.18)
Specifies the number of workers (see aide.conf (5) for details). This overwrites
the num_workers value set in any configuration file.
--no-progress (added in AIDE v0.19)
Turn progress off explicitly. By default progress is shown if standard error is
connected to a terminal.
--no-color (added in AIDE v0.19)
Turn colored log output off explicitly. By default colored log output is enabled
if standard error is connected to a terminal.
--version,-v
Print version information and exit.
--help,-h
Prints out the standard help message.
EXIT STATUS
Normally, the exit status is 0 if no errors occurred. Except when the --check, --compare
or --update command was requested, in which case the exit status is defined as:
1 * (new files reported?) +
2 * (removed files reported?) +
4 * (changed files reported?)
Since those three cases can occur together, the respective error codes are added. For ex‐
ample, if there are new files and removed files reported, the exit status will be 1 + 2 =
3.
Additionally, the following exit codes are defined for generic error conditions:
14 Writing error
15 Invalid argument error
16 Unimplemented function error
17 Configuration error
18 IO error
19 Version mismatch error
20 EXEC error
21 File lock error
22 Memory allocation error
23 Thread error
24 Database error
25 received SIGINT, SIGTERM or SIGHUP
SIGNAL HANDLING
SIGINT, SIGTERM, SIGHUP
Remove an incompletely written database (only if database file was created by
aide) and exit (code 25).
SIGUSR1
Toggle the log_level between current and debug level.
SIGUSR1 is only handled after config parsing.
SIGWINCH
Resize the progress bar (if enabled).
NOTES
The checksums in the database and in the output are by default base64 encoded (see also
report_base16 option). To decode them you can use the following shell command:
echo <encoded_checksum> | base64 -d | hexdump -v -e '32/1 "%02x" "\n"'
FILES
See --version output for the default config file and the default database_in and data‐
Remove an incompletely written database (only if database file was created by
aide) and exit (code 25).
SIGUSR1
Toggle the log_level between current and debug level.
SIGUSR1 is only handled after config parsing.
SIGWINCH
Resize the progress bar (if enabled).
NOTES
The checksums in the database and in the output are by default base64 encoded (see also
report_base16 option). To decode them you can use the following shell command:
echo <encoded_checksum> | base64 -d | hexdump -v -e '32/1 "%02x" "\n"'
FILES
See --version output for the default config file and the default database_in and data‐
base_out config values.
SEE ALSO
aide.conf(5)
BUGS
There are probably bugs in this release. Please report them at
https://github.com/aide/aide/issues .
DISCLAIMER
All trademarks are the property of their respective owners. No animals were harmed while
making this webpage or this piece of software. Although some pizza delivery guy's feel‐
ings were hurt.
aide v0.19 2025-04-05 AIDE(1)
AIDE.CONF(5) AIDE AIDE.CONF(5)
NAME
aide.conf - The configuration file for Advanced Intrusion Detection Environment
SYNOPSIS
aide.conf is the configuration file for Advanced Intrusion Detection Environment.
aide.conf contains the runtime configuration aide uses to initialize or check the AIDE
database.
FILE FORMAT
aide.conf is case-sensitive. Leading and trailing white spaces are ignored. Each config
line must end with new line.
AIDE uses the backslash character (\) as escape character for ' ' (space), '@' and '\'
(backslash) (e.g. '\ ' or '\@'). To literally match a '\' in a file path with a regular
expression you have to escape the backslash twice (i.e. '\\\\').
There are three types of lines in aide.conf. First there are the configuration options
which are used to set configuration parameters and define groups. Second, there are (re‐
stricted) rules that are used to indicate which files/directoires from the file system
are added to the database. Third, macro lines define or undefine variables within the
config file. Lines beginning with # are ignored as comments.
CONFIG OPTIONS
These lines have the format parameter=value. See URLS for a list of valid urls.
database_in (type: URL, default: see --version output, added in AIDE v0.17)
database (REMOVED in AIDE v0.19)
The url from which database is read. There can only be one of these lines. If
there are multiple database lines then the first is used.
Examples:
database_in=file:/var/lib/aide/aide.db
Read database locally from /var/lib/aide/aide.db.
database_in=stdin
Read database from stdin.
database_in=https://example.com/aide.db
Read database remotely from https://example.com/aide.db.
database_out (type: URL, default: see --version output)
The url to which the new database is written to. There can only be one of these
lines. If there are multiple database_out lines then the first is used.
database_new (type: URL, default: <none>)
The url from which the other database for --compare is read.
database_attrs (type: attribute expression, default: H, added in AIDE v0.16)
The attributes of the (uncompressed) database files which are to be added to the
reports in report level >= database_attributes . Only checksum attributes are sup‐
ported. To disable set database_attrs to 'E'.
database_add_metadata (type: bool, default: true, added in AIDE v0.16)
Whether to add the AIDE version and the time of database generation as comments to
the database file or not. This option may be set to false by default in a future
release.
log_level (type: log level, default: warning, added in AIDE v0.17)
The log level to use. Log messages are written to stderr. If there are multiple
log_level lines then the first one is used. The --log-level or -L command line op‐
tion overwrites this option.
The following log levels are available:
error: show unrecoverable issues that have to be handled by the user. Er‐
rors are fatal to the AIDE process.
warning: additionally show recoverable issues that most likely lead to un‐
expected behaviour and should be handled by the user
notice: additionally show recoverable issues that sometimes lead to unex‐
pected behaviour and might be handled by the user.
info: additionally show informational messages
compare: additionally show messages to help to debug file comparison and
(special) attribute handling
The log levels below are very verbose and can easily generate multiple gi‐
gabytes of log data (depending on the number of processed files and the
size of the rule tree). For debugging it is recommended to use these log
levels together with the --limit parameter (see aide (1) for details).
rule: additionally show messages to help to debug the path rule matching
config: additionally show messages to help to debug config and rule parsing
debug: additionally show messages that are useful to debug the application
limit: additionally show messages about skipped entries due to limit match
thread: additionally show messages about thread processing (e.g. broadcast
events)
trace: additionallyt show messages about the internal data structures and
the flow of the application (e.g. in-loop logging) (extremely verbose)
verbose (type: number, range: 0 - 255, default: 5, REMOVED in AIDE v0.17)
Removed, use log_level and report_level options instead.
gzip_dbout (type: bool, default: false)
Whether the output to the database is gzipped or not. This option is available
only if zlib support is compiled in.
root_prefix (type: path, default: <empty>, added in AIDE v0.16)
The prefix to strip from each file name in the file system before applying the
rules and writing to database. AIDE removes a trailing slash from the prefix. If
there are multiple root_prefix lines then the first one is used. This option has
no effect in compare mode.
acl_no_symlink_follow (type: bool, default: false)
Whether to check ACLs for symlinks or not. This option is available only if acl
support is compiled in.
warn_dead_symlinks (type: path, default: false)
Whether to warn about dead symlinks or not.
config_version (type: string, default: <empty>)
The value of config_version is printed in the report and also printed to the data‐
base. This is for informational purposes only. It has no other functionality.
config_check_warn_unrestricted_rules (type: bool, default: false, added in AIDE v0.18)
Whether to warn on unrestricted rules during config check. To explicitly define
unrestricted rules use 0 (zero) as restriction character.
num_workers (type: number|percentage, default: 1, added in AIDE v0.18)
Specifies the number of simultaneous workers (threads) for file attribute process‐
ing (i.a. hashsum calculation).
The number of workers can be a positive integer (e.g. '4') or the percentage of
the available processors (e.g. '60%'). The resulting number of workers is rounded
up to the next integer (e.g. '60%' of 8 processors results in 5 workers).
If there are multiple num_workers lines then the first one is used.
Use 0 (zero) to disable (multi-threaded) workers.
The default value 1 (single worker thread) may be changed in a future release.
REPORT OPTIONS
report_url (type: URL, default: stdout)
The URL that the output is written to.
Multiple instances of the report_url option are supported.
Examples:
report_url=file:/var/log/aide.log
Write report to /var/log/aide.log.
report_url=stdout
Write report to stdout.
report_url=syslog:<LOG_FACILITY>
Write report to syslog using LOG_FACILITY.
The following report options are available (to take effect they have to be set before re‐
port_url):
report_level (type: report level, default: changed_attributes, added in AIDE v0.17)
The report level to use. The available report levels are as follows:
minimal: print single line whether AIDE found differences to the database
summary: additionally print number of added, removed and changed files
database_attributes: additionally print database checksums
list_entries: additionally print lists of added, removed and changed entries
changed_attributes: additionally print details about changed entries
Example:
File: /var/lib/apt/extended_states
Perm : -rw-r--r-- | -rw-------
Uid : 0 | 106
The left column shows the old value (e.g. from the database_in database)
and the right column shows the new value (e.g. from the file system).
added_removed_attributes: additionally print details about added and removed at‐
tributes
added_removed_entries: additionally print details about added and removed entries
report_format (type: report format, default: plain, added in AIDE v0.18)
The report format to use. The available report formats are as follows:
plain: Print report in plain human-readable format.
json: Print report in json machine-readable format.
report_base16 (type: bool, default: false, added in AIDE v0.17)
Base16 encode the checksums in the report. The default is to report checksums in
base64 encoding.
report_detailed_init (type: bool, default: false, added in AIDE v0.16)
Report added files (report level >= list_entries) and their details (report level
>= added_removed_entries) in initialization mode.
report_quiet (type: bool, default: false, added in AIDE v0.16)
Suppress report output if no differences to the database have been found.
report_append (type: bool, default: false, added in AIDE v0.17)
Append to the report URL.
report_grouped (type: bool, default: true, added in AIDE v0.17)
grouped (REMOVED in AIDE v0.19)
Group the files in the report by added, removed and changed files.
report_summarize_changes (type: bool, default: true, added in AIDE v0.17)
summarize_changes (REMOVED in AIDE v0.19)
Summarize changes in the added, removed and changed files sections of the report.
The general format is like the string YlZbpugamcinHAXSECF, where Y is replaced by
the file-type ('f' for a regular file, 'd' for a directory, 'l' for a symbolic
link, 'c' for a character device, 'b' for a block device, 'p' for a FIFO, 's' for
a unix socket, 'D' for a Solaris door, 'P' for a Solaris event port, '!' if file
type has changed and '?' otherwise).
The Z is replaced as follows: A '=' means that the size has not changed, a '<' re‐
ports a shrinked size and a '>' reports a grown size. The other letters in the
string are the actual letters that will be output if the associated attribute for
the item has been changed or a '.' for no change.
Otherwise a '+' is shown if the attribute has been added, a '-' if it has been re‐
moved, a ':' if the attribute is ignored (but not forced) or a ' ' if the at‐
tribute has not been checked.
The exceptions to this are: (1) a newly created file replaces each letter with a
'+', and (2) a removed file replaces each letter with a '-'.
The attribute that is associated with each letter is as follows:
o An l means that the link name has changed.
o A b means that the block count has changed.
o A p means that the permissions have changed.
o A u means that the uid has changed.
o A g means that the gid has changed.
o An a means that the access time has changed.
o An m means that the modification time has changed.
o A c means that the change time has changed.
o An i means that the inode has changed.
o An n means that the link count has changed.
o An H means that one or more message digests have changed.
o An F means that one file system type has changed (Linux only).
The following letters are only available when explicitly enabled using configure:
o An A means that the access control list has changed.
o An X means that the extended attributes have changed.
o An S means that the SELinux attributes have changed.
o An E means that the file attributes on a second extended file system have
changed.
o A C means that the file capabilities have changed.
report_ignore_added_attrs (type: attribute expression, default: empty, added in AIDE
v0.16)
Attributes whose addition is to be ignored in the report.
report_ignore_removed_attrs (type: attribute expression, default: empty, added in AIDE
v0.16)
Attributes whose removal is to be ignored in the report.
report_ignore_changed_attrs (type: attribute expression, default: empty, added in AIDE
v0.16)
ignore_list (REMOVED in AIDE v0.17)
Attributes whose change is to be ignored in the report.
report_force_attrs (type: attribute expression, default: empty, added in AIDE v0.16)
report_attributes (REMOVED in AIDE v0.17)
Attributes which are always printed in the report for changed files. If an at‐
tribute is both ignored and forced the attribute is not considered for file change
but printed in the final report as long as the file has been otherwise changed.
report_ignore_e2fsattrs (type: string, default: 0, added in AIDE v0.16)
List (no delimiter) of ext2 file attributes which are to be ignored in the report.
See chattr(1) for the available attributes. Use 0 (zero) to not ignore any at‐
tribute. Ignored attributes are represented by a ':' in the report.
By default AIDE also reports changes of the read-only attributes mentioned in
chattr(1) (see example below how to ignore those changes).
Example:
Ignore changes of the read-only ext2 file attributes verify (V), inline data
(N), indexed directory (I) and encrypted (E):
report_ignore_e2fsattrs=VNIE
GROUPS
Groups are aggregations of attributes.
Group definitions have the format <group name> = <attribute expression>.
Group names are limited to alphanumeric characters (A-Za-z0-9).
See ATTRIBUTES for a description of all available attributes.
Default groups
R p+ftype+i+l+n+u+g+s+m+c+sha3_256+X
L p+ftype+i+l+n+u+g+X
> Growing file p+ftype+l+u+g+i+n+s+growing+X
H all compiled in (and not deprecated) hashsums (added in AIDE v0.17)
X acl+selinux+xattrs+e2fsattrs+caps (if attributes are compiled in, added in AIDE
v0.16)
E Empty group
Use 'aide --version' to list the default compound groups.
RULES
AIDE supports three types of rules:
Regular rule:
<regex> <attribute expression>
Files and directories matching the regular expression are added to the database.
Recursive negative rule:
!<regex>
Files and directories matching the regular expression are excluded and NOT added
to the database. The children of directories and sub-directories are recursed into
and only not added to the database if they also match the regular expression.
Non-recursive negative rule (added in AIDE v0.19)
-<regex>
Files and directories matching the regular expression are excluded and NOT added
the database. The children of directories and sub-directories are not recursed
into and hence not added to the database by any means.
Equals rule:
=<regex> <attribute expression>
Files and directories matching the regular expression are added to the database.
The children of directories are only added if the regular expression ends with a
"/". The children of sub-directories are not added to the database.
Every regular expression has to start with an explicit "/". An implicit ^ is added in
front of each regular expression. In other words, the regular expressions are matched at
the first position against the complete path. Special characters can be escaped using
two-digit URL encoding (for example, %20 to represent a space).
AIDE uses a deepest-match algorithm to find the tree node to search, but a first-match
algorithm inside the node. (see also rule log level).
See EXAMPLES for examples.
More in-depth discussion of the selection algorithm can be found in the AIDE manual.
RESTRICTED RULES
Restricted rules are like normal rules but can be restricted to file types (added in AIDE
v0.16) and/or file system types (added in AIDE v0.19, Linux only).
The syntax of restricted rules is as follows:
Restricted regular rule
<regex> <restriction expression> <attribute expression>
-<regex> <restriction expression>
Files and directories matching both the regular expression and the restriction expres‐
sion are excluded and NOT added the database. The children of directories and sub-di‐
rectories are not recursed into and hence not added to the database by any means.
Restricted equals rule
=<regex> <restriction expression> <attribute expression>
Files and directories matching both the regular expression and the restriction expres‐
sion are added the database. The children of directories are only added if the regular
expression ends with a "/". The children of sub-directories are not added to the data‐
base.
Restriction expression
An restriction expression is of the following form:
<restriction expression>: <file types>
| =<file system type>
p restrict rule to FIFO files
s restrict rule to UNIX sockets
D restrict rule to Solaris doors
P restrict rule to Solaris event ports
Multiple file type restrictions can be given as a comma-separated list.
File system types (Linux only)
The file system type restriction can be specified by file system types magic number
(e.g. '0x01021994' for tmpfs) or by its name (use 'aide --version' to list the avail‐
able file system type names). The magic number must start with '0x' and be formatted
in hexdecimal format.
Empty restriction
To explicitly don't restrict a rule use 0 (added in AIDE v0.18).
Examples:
/ d,f R -/dev =tmpfs
Exclude /dev and all children, if /dev is mounted on tmpfs.
MACRO LINES
@@define VAR val
Define variable VAR to value val.
@@undef VAR
Undefine variable VAR.
@@if boolean_expression (added in AIDE v0.18)
@@else
@@endif
@@if begins an if statement. It must be terminated with an @@endif statement. The
lines between @@if and @@endif are used if the boolean_expression evaluates to
true. If there is an @@else statement then the part between @@if and @@else is
used if boolean_expression evaluates to true otherwise the part between @@else and
@@endif is used.
Available operators and functions in boolean expressions:
not boolean_expression
Evaluates to true if the boolean_expression is false, and false if the
boolean_expression is true.
defined VARIABLE
Evaluates to true if VARIABLE is defined.
hostname HOSTNAME
Evaluates to true if HOSTNAME equals the hostname of the machine that AIDE
is running on. hostname is the name of the host without the domainname (ie
'hostname', not 'hostname.example.com').
exists PATH
Evaluates to true if PATH exists.
VERSION_STRING1 version_ge VERSION_STRING2 (added in AIDE v0.19)
Evaluates to true if VERSION_STRING1 is greater than or equal to VER‐
SION_STRING2 (e.g. 0.19.1 version_ge 0.18 evaluates to true and 2.17 ver‐
sion_ge 1.1 to false). The version strings must be in the formaat MAJOR.MI‐
NOR.PATCH (minor and patch version can be omitted, any version suffix (e.g.
for pre-release) will be truncated).
@@ifdef VARIABLE (DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20)
same as @@if defined VARIABLE
@@ifndef VARIABLE (DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20)
same as @@if not defined VARIABLE
@@ifhost HOSTNAME (DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20)
same as @@if hostname HOSTNAME
@@ifnhost HOSTNAME (DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20)
same as @@if not hostname HOSTNAME
@@{VAR}
@@{VAR} is replaced with the value of the variable V
The content of the file is used as if it were inserted in this part of the config
file.
The maximum depth of nested includes is 16.
@@include DIRECTORY REGEX [RULE_PREFIX] (added in AIDE v0.17)
Include all (regular) files found in DIRECTORY matching regular expression REGEX
(sub-directories are ignored). The file are included in lexical sort order.
If RULE_PREFIX (added in AIDE v0.18) is set, all rules included by the statement
are prefixed with given RULE_PREFIX. Prefixes from nested include statements are
concatenated.
The content of the files is used as if it were inserted in this part of the config
file.
@@x_include FILE (added in AIDE v0.17)
@@x_include DIRECTORY REGEX [RULE_PREFIX] (added in AIDE v0.17)
@x_include is identical to @@include, except that if a config file is executable
is is run and the output is used as config.
If the executable file exits with status greater than zero or writes to stderr
aide stops with an error.
For security reasons DIRECTORY and each executable config file must be owned by
the current user or root. They must not be group- or world-writable.
@@x_include_setenv VAR VALUE (added in AIDE v0.17)
Adds the variable VAR with the value VALUE to the environment used for config file
execution.
Environment variable names are limited to alphanumeric characters (A-Za-z0-9) and
the underscore '_' and must not begin with a digit.
TYPES
bool
Valid values are yes, true, no or false.
attribute expression
An attribute expression is of the following form:
<attribute expression>: <attribute/group>
| <attribute expression> + <attribute/group>
| <attribute expression> - <attribute/group>
URLS
Urls can be one of the following. Input urls cannot be used as outputs and vice versa.
stdout
stderr Output is sent to stdout, stderr respectively.
stdin Input is read from stdin.
file:/path
Input is read from path or output is written to path.
fd:number
Input is read from filedescriptor number or output is written to number.
syslog:LOG_FACILITY
Output is written to syslog using LOG_FACILITY.
ATTRIBUTES
File attributes
ftype file type (added in AIDE v0.15)
fstype file system type (Linux-only, added in AIDE v0.19)
p permissions
i inode
l link name (symbolic links only)
n number of links
u user
g group
s size
b block count
m mtime
a atime
c ctime
acl access control list (requires libacl, Linux-only)
Special attributes
S check for growing size (DEPRECATED since AIDE v0.18, will be removed in AIDE
v0.20)
Use growing+s attributes instead
I ignore changed filename
When I is used, the inode of the new file is used to search for a moved source
file in the old database.
Source and target file have to be located in the same directory and must share the
same attributes (except for special attributes ANF, ARF, I, growing, and com‐
pressed).
For moved entries a change of the ctime attribute is ignored.
growing
ignore growing file (added in AIDE v0.18)
When growing is used, changes of the following attributes are ignored:
size: if new size is greater than old size
bcount: if new bcount is greater than old bcount
atime: if new atime is greater than old atime
mtime: if new mtime is greater than old mtime
ctime: if new ctime is greater than old ctime
hashsums: if the hashsum of the new file restricted to the old size equals the
hashsums of the old file
For hashsum attributes the growing attribute is ignored in compare mode.
compressed
ignore compressed file (added in AIDE v0.18)
When compressed is used, the uncompressed hashsums of the new compressed file
(supported compressions: gzip) are used to search for the uncompressed file in the
old database.
The old uncompressed and the new compressed file have to be located in the same
directory and must share the same attributes (except for special attributes ANF,
ARF, I, growing, and compressed) including at least one common hashsum.
Changes of the inode, size, bcount and ctime attributes are ignored.
The growing attribute (i.e. the old file size) is not considered for compressed
files during the calculation of the uncompressed hashsums.
The compressed attribute is ignored in compare mode.
ANF allow new files
When 'ANF' is used, new files are added to the new database, but are ignored in
the report.
ARF allow removed files
When 'ARF' is used, files missing on disk are omitted from the new database, but
are ignored in the report.
Hashsums attributes (regular files only)
sha256 SHA-256 checksum
sha512 SHA-512 checksum
sha512_256 (added in AIDE v0.19)
SHA-512 checksum truncated to 256 output bits
sha3_256 (added in AIDE v0.19)
SHA3-256 checksum
sha3_512 (added in AIDE v0.19)
SHA3-512 checksum
stribog256 (added in AIDE v0.17)
GOST R 34.11-2012, 256 bit checksum
stribog512 (added in AIDE v0.17)
GOST R 34.11-2012, 512 bit checksum
md5 (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21)
MD5 checksum (not in libgcrypt FIPS mode)
sha1 (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21)
SHA-1 checksum
rmd160 (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21)
RIPEMD-160 checksum
gost (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21)
GOST R 34.11-94 checksum
crc32 (REMOVED in AIDE v0.19)
crc32 checksum
crc32b (REMOVED in AIDE v0.19)
crc32 checksum
haval (REMOVED in AIDE v0.19)
haval256 checksum
tiger (REMOVED in AIDE v0.19)
tiger checksum
whirlpool (REMOVED in AIDE v0.19)
whirlpool checksum
Use 'aide --version' to show which hashsums are available.
Hashsum transitions (since AIDE v0.19):
AIDE has limited support for hashsum transitions (i.e. ensuring hashsum validation
when hashsums are added/removed from existing entries). If both the old and the new
entry do mot share common hashsum(s) AIDE tries to additionally calculate the removed
hashsum(s) also for the new entry (this is especieally not supported for moved (I at‐
tribute) and compressed (compressed attribute) entries).
EXAMPLES
/ R This adds all files on your machine to the database. This one line is a fully
qualified configuration file.
!/dev$ This ignores the /dev directory structure.
=/foo R
Only /foo and /foobar are taken into the database. None of their children are
added.
=/foo/ R
Only /foo and its children (e.g. /foo/file and /foo/directory) are taken into the
database. The children of sub-directories (e.g. /foo/directory/bar) are not
added.
/ d,f R
Only add directories and files to the database
!/run d
/run R Add all but directory entries to the database
/run d R-m-c-i
/run R Use specific rule for directories
Suggested Groups
OwnerMode = p+u+g+ftype
Check permissions, owner, group and file type
Size = s+b
Check size and block count
InodeData = OwnerMode+n+i+Size+l+X
StaticFile = m+c+Checksums
Files that stay static
Full = InodeData+StaticFile
Full = ftype+p+l+u+g+s+m+c+a+i+b+n+H+X
/ 0 Full
This line defines group Full. It has all attributes, all compiled in hashsums (H)
and all compiled in extra file attributes (X). See '--version' output for the
compiled in hashsums and extra groups. The example rule is the typical catch-all
rule at the end of the rule list.
VarTime = InodeData+Checksums
/etc/ssl/certs/ca-certificates\\.crt$ VarTime
Files that change their mtimes or ctimes but not their contents.
/run/samba$ d RecreatedDir
Directories that are recreated regularly and change their contents
Log Handling
Logs pose a number of special challenges to AIDE. An active log is nearly constantly be‐
ing written to. The process of log rotation changes file names for files that are sup‐
posed to have unaltered contents. To save space, Logs are compressed in the process of
their rotation, and finally, they get deleted. AIDE is supposed to handle all those
cases without generating reports, and it is still expected to flag the cases when an at‐
tacker tampers with logs.
The following examples suggest a way to handle the common case of log rotation with the
logrotate(8) program, with its options compress, delaycompress and nocopytruncate set.
The vast majority of logs are rotated this way on most Linux systems.
ActLog=Full+growing+ANF+I
/var/log/foo\\.log$ f ActLog
An Active Log is typically named foo.log. It is constanty being written to. The
file does neither change its mode nor its inode number. The size only increases,
and what is written to the file is not supposed to change (growing). During log
rotation, foo.log is typically renamed to foo.log.1 (or foo.log.0) and the process
is instructed to write to a new foo.log. Log content is written to a new file
(ANF) and will eventually be renamed to foo.log rename foo.log to foo.log.1 to foo.2.log.gz.
CompSerLog=Full+I+compressed
/var/log/foo\\.log\\.2\\.gz$ f CompSerLog
In the next rotation step, foo.log.1 gets compressed to foo.log.2.gz, becoming the
Compressed Log in the Log Series. With this rule, AIDE does not report this step
because it uncompresses the contents of the file and takes the checksum of the un‐
compressed content. The contents strictly doesn't change, but some attribute
changes are ignored (compressed).
MidlSerLog=Full+I
/var/log/foo\\.log\\.[345]\\.gz$ f MidlSerLog
In the next log rotation, all foo.log.{x} get renamed to foo.log.{x+1}. The other
attributes are not supposed to change.
LastSerLog=Full+ARF
/var/log/foo\\.log\\.6\\.gz$ f LastSerLog
The configuration of the log rotation process specifies a number of log genera‐
tions to keep. The last log in the series is therefore removed from the disk
(ARF).
aide 0.18 does not yet support the following cases of log rotation:
empty files
It might be the case that a log is actually created, but never written to. This
commonly happens on rarely used web servers that use the log rotation as a method
to cater for data protection regulation. In result, all files in a series are
identical, breaking the heuristics that aide uses to detect log rotation. A pos‐
sible workaround is to begin a newly rotated log with a timestamp. With logro‐
tate, this can be done in a postrotate scriptlet.
nodelaycompress
With logrotate's nodelaycompress option, a log is immediately compressed after re‐
naming it from the Active Log name. For the time being, it is recommended to al‐
ways use the delaycompress option to avoid this behavior.
copytruncate
empty files
It might be the case that a log is actually created, but never written to. This
commonly happens on rarely used web servers that use the log rotation as a method
to cater for data protection regulation. In result, all files in a series are
identical, breaking the heuristics that aide uses to detect log rotation. A pos‐
sible workaround is to begin a newly rotated log with a timestamp. With logro‐
tate, this can be done in a postrotate scriptlet.
nodelaycompress
With logrotate's nodelaycompress option, a log is immediately compressed after re‐
naming it from the Active Log name. For the time being, it is recommended to al‐
ways use the delaycompress option to avoid this behavior.
copytruncate
With logrotate's copytruncate option, the Active Log is not renamed and newly cre‐
ated but copied to the new file name. After the copy operation, the old file is
truncated to zero size, allowing the daemon to continuously write to the already
open file handle. aide uses the Inode number to detect the rotation process.
That doesn't work with copytruncate because the Inode stays with the Active Log.
For the time being, it is recommended to avoid the copytruncate option to avoid
this behavior.
HINTS
In the following, the first is not allowed in AIDE. Use the latter instead.
/foo epug
/foo e+p+u+g
SEE ALSO
aide(1)
DISCLAIMER
All trademarks are the property of their respective owners. No animals were harmed while
making this webpage or this piece of software.
aide v0.19 2025-04-05 AIDE.CONF(5)
Konfiguration
Die Konfiguration wird über die Dateien /etc/aide/aide.conf vorgenommen. Um später Änderungen und Neuerungen bei Paketupdates besser verfolgen zu können kopieren wir uns als erstes die mitgelieferte Konfigurationsdatei aide.conf.
# BEGIN ANSIBLE MANAGED - DO NOT EDIT BLOCK# Ansible managed configuration file, do not modify manually!## ┌──────────────────────────────────────────────────────────────────────┐# │ Contents of configuration file aide.conf │# ├──────────────────────────────────────────────────────────────────────┤# │ │# ├──┬───── 1. VARIABLES │# │ ├───── 1.1 DATABASE │# │ └───── 1.2 REPORT │# │ │# ├──┬───── 2. RULES │# │ ├───── 2.1 LIST OF ATTRIBUTES │# │ ├───── 2.2 LIST OF CHECKSUMS │# │ └───── 2.3 AVAILABLE RULES │# │ │ # ├──┬───── 3. PATHS │# │ ├──┬── 3.1 EXCLUDED │# │ │ ├── 3.1.1 ETC │# │ │ ├── 3.1.2 USR │# │ │ ├── 3.1.3 VAR │# │ │ └── 3.1.4 OTHERS │# │ └──┬── 3.2. INCLUDED │# │ ├── 3.2.1 ETC │# │ ├── 3.2.2 USR │# │ ├── 3.2.3 VAR │# │ └── 3.2.4 OTHERS │# │ │# └──────────────────────────────────────────────────────────────────────┘### 1. VARIABLES## 1.1 DATABASE@@define DBDIR /var/lib/aide
@@define LOGDIR /var/log/aide
# The location of the database to be read.
database_in = http://10.0.0.40/local/pml010074.aide-database
# The location of the database to be written.
database_out = file:@@{DBDIR}/pml010074.aide-database
# Whether to gzip the output to database.
gzip_dbout = no
## 1.2 REPORT# Defaultlog_level=warning
report_level=changed_attributes
report_url=syslog:LOG_AUTH
## 2. RULES## 2.1 LIST OF ATTRIBUTES# These are the default parameters we can check against.# p: permissions# i: inode# n: number of links# u: user# g: group# s: size# b: block count# m: mtime# a: atime# c: ctime# S: check for growing size# acl: Access Control Lists# selinux SELinux security context # (must be enabled at compilation time)# xattrs: Extended file attributes# 2.2 LIST OF CHECKSUMS# md5: md5 checksum# sha1: sha1 checksum# sha256: sha256 checksum# sha512: sha512 checksum# rmd160: rmd160 checksum# tiger: tiger checksum# haval: haval checksum (MHASH only)# gost: gost checksum (MHASH only)# crc32: crc32 checksum (MHASH only)# whirlpool: whirlpool checksum (MHASH only)# 2.3 AVAILABLE RULES# These are the default rules# R: p+i+l+n+u+g+s+m+c+md5# L: p+i+l+n+u+g# E: Empty group# >: Growing logfile p+l+u+g+i+n+S# Default compound groups:# R: l+p+u+g+s+c+m+i+n+md5+acl+xattrs+ftype+e2fsattrs# L: l+p+u+g+i+n+acl+xattrs+ftype+e2fsattrs# >: l+p+u+g+s+i+n+acl+xattrs+ftype+e2fsattrs+growing# H: md5+sha1+rmd160+tiger+crc32+gost+sha256+sha512+whirlpool# +stribog256+stribog512# X: acl+xattrs+e2fsattrs# You can create custom rules - my home made rule definition goes like this# ALLXTRAHASHES = sha1+rmd160+sha256+sha512+tiger# Everything but access time (Ie. all changes)
EVERYTHING = R+sha256+sha512
# Sane, with multiple hashes# NORMAL = R+rmd160+sha256+whirlpool# NORMAL = R+sha256+sha512
NORMAL = p+i+l+n+u+g+s+m+c+sha256
# For directories, don't bother doing hashes
DIR = p+i+n+u+g+acl+xattrs
# Access control only
PERMS = p+i+u+g+acl
# Logfile are special, in that they often change
LOG = ># Just do sha256 and sha512 hashes
FIPSR = p+i+n+u+g+s+m+c+acl+xattrs+sha256
LSPP = FIPSR+sha512
# Some files get updated automatically, so the inode/ctime/mtime change# but we want to know when the data inside them changes
DATAONLY = p+n+u+g+s+acl+xattrs+sha256
## 3. PATHS## Here we define which directories and files we want to view or not view# when monitoring with AIDE.### 3.1 EXCLUDED## 3.1.1 ETC# Ignore root cache files!/root/.*# Ignore backup files!/etc/.*~
# Ignore mtab!/etc/mtab
## 3.1.2 USR# These are too volatile!/usr/src
!/usr/tmp
## 3.1.3 VAR# Ignore logs!/var/lib/pacman/.*!/var/cache/.*!/var/log/.*!/var/run/.*!/var/spool/.*## 3.1.4 OTHERS# Ignore cups!/etc/cups
# Ignore backup files!/root/.*## 3.2 INCLUDED## 3.2.1 ETC# Check only permissions, inode, user and group for /etc, but cover some# important files closely./etc PERMS
/etc/aliases FIPSR
/etc/at.allow FIPSR
/etc/at.deny FIPSR
/etc/audit/ FIPSR
/etc/bash_completion.d/ NORMAL
/etc/bashrc NORMAL
/etc/cron.allow FIPSR
/etc/cron.daily/ FIPSR
/etc/cron.deny FIPSR
/etc/cron.d/ FIPSR
/etc/cron.hourly/ FIPSR
/etc/cron.monthly/ FIPSR
/etc/crontab FIPSR
/etc/cron.weekly/ FIPSR
/etc/cups FIPSR
/etc/exports NORMAL
/etc/fstab NORMAL
/etc/group NORMAL
/etc/grub/ FIPSR
/etc/gshadow NORMAL
/etc/hosts.allow NORMAL
/etc/hosts.deny NORMAL
/etc/hosts FIPSR
/etc/inittab FIPSR
/etc/issue FIPSR
/etc/issue.net FIPSR
/etc/ld.so.conf FIPSR
/etc/libaudit.conf FIPSR
/etc/localtime FIPSR
/etc/login.defs FIPSR
/etc/login.defs NORMAL
/etc/logrotate.d NORMAL
/etc/modprobe.conf FIPSR
/etc/nscd.conf NORMAL
/etc/pam.d FIPSR
/etc/passwd NORMAL
/etc/postfix FIPSR
/etc/profile.d/ NORMAL
/etc/profile NORMAL
/etc/rc.d FIPSR
/etc/resolv.conf DATAONLY
/etc/securetty FIPSR
/etc/securetty NORMAL
/etc/security FIPSR
/etc/security/opasswd NORMAL
/etc/shadow NORMAL
/etc/skel NORMAL
/etc/ssh/ssh_config FIPSR
/etc/ssh/sshd_config FIPSR
/etc/stunnel FIPSR
/etc/sudoers NORMAL
/etc/sysconfig FIPSR
/etc/sysctl.conf FIPSR
/etc/vsftpd.ftpusers FIPSR
/etc/vsftpd FIPSR
/etc/X11/ NORMAL
/etc/zlogin NORMAL
/etc/zlogout NORMAL
/etc/zprofile NORMAL
/etc/zshrc NORMAL
## 3.2.2 USR/usr NORMAL
/usr/sbin/stunnel FIPSR
## 3.2.3 VAR/var/log/faillog FIPSR
/var/log/lastlog FIPSR
/var/spool/at FIPSR
/var/spool/cron/root FIPSR
## 3.2.4 OTHERS/boot NORMAL
/bin NORMAL
/lib NORMAL
/lib64 NORMAL
/opt NORMAL
/root NORMAL
# Host based OTHERS# local user scripts/usr/local/bin/ FIPSR
# local scripts with root rights/usr/local/sbin/ FIPSR
## END ANSIBLE MANAGED - DO NOT EDIT BLOCK
Wie eigentlich immer bei der Konfiguration von neuen Programmen lohnt es sich die zugehörige Konfigurationsdatei - in unserem Falle von AIDE die /etc/aide.conf einmal komplett zu lesen! So erhält man einen Überblick welche Einstellungsoptionen uns AIDE grundsätzlich bietet.
Die ersten Einstellungen die man sich überlegen sollte, wären wo die Datenbanken erstellt und vorgehalten werden sollen und ob diese gepackt werden sollen.
Die Erstellung der AIDE-Datenbank erfolgt lokal. database_in hingegen wählen wir remote, da wir so sicherstellen können, dass ein lokaler Angreifer dieser nur ro-beziehbaren Daten nicht manipulieren kann und somit aufwändiges digitales Signieren bzw. verwenden von ro-Filesystemen und oder Geräten nicht nötig ist.
Leider existiert aktuell1) ein AIDE does not decompress remote databases so dass wir aktuell auf die Komprimierung der Datenbank verzichten und die Option entsprechend einstellen müssen (gzip_dbout = no).
Logging : Der Parameter report_url legt fest wie AIDE Ergebnisse seiner Arbeit dokumentieren soll. report_url=file:@@{LOGDIR}/aide.log definiert z.B. - sofern als LOGDIR == /var/log/ gesetzt ist, dass die Ergebnisse in der Logdatei /var/log/aide.log festgehalten werden.
report_url=stdout wiederum definiert als Ausgabe die Konsole. Dies kann hilfreich sein, wenn auf einem Host manuell der Aufruf von aide auf der Konsole ausgegeben werden soll. report_url=syslog:LOG_AUTH definiert als Logziel das Sys(tem)log|journal.
Wenn man sowohl report_url = stdout als auch report_url = syslog in der Aide-Konfiguration vermerkt, protokolliert Aide den Bericht sowohl nach stdout als auch nach syslog. Der systemd-Timer leitet stdout normalerweise auch an das Journal weiter, sodass die Berichtsausgabe dabei zweimal in syslog erscheint!
Anschließend sollte man sich Gedanken machen, welche Hashingalgorithmen verwendet werden sollen. In den Standardeinstellungen bildet AIDE sieben verschiedene Prüfsummen für jede überwachte Datei. Zu beachten ist hierbei ggf. ob der bei der Erzeugung der Hash-Werte benötige Rechenaufwand gerechtfertigt ist, oder ob man auf einige davon aus Performancegründen besser verzichtet! In der Regel sollten eigentlich zwei verschiedene Hash-Werte Pro Datei ausreichen.
Ferner kann über Regelsätze definiert werden welche Eigenschaften (Parameter) von Verzeichnissen und/oder Dateien überwacht werden sollen. Hier können entsprechende Vorgaben in der Default-Konfigurationsdatei übernommen bzw. auch ganz eigene individuelle Rule-Sets definiert werden. Folgende Parameter können dabei bei der Bewertung und Überwachung herangezogen werden:
p: Überprüfen Sie die Dateiberechtigungen der ausgewählten Dateien oder Verzeichnisse.
i: Überprüfen Sie die Inode-Nummer. Jeder Dateiname hat eine eindeutige Inode-Nummer, die sich nicht ändern sollte.
n: Überprüfen Sie die Anzahl der Links, die auf die betreffende Datei verweisen.
u: Überprüfen Sie, ob sich der Eigentümer der Datei geändert hat.
g: Überprüfen Sie, ob sich die Gruppe der Datei geändert hat.
s: Überprüfen Sie, ob sich die Dateigröße geändert hat.
b: Prüfen, ob sich die von der Datei verwendete Blockanzahl geändert hat.
m: Prüfen, ob sich das Änderungsdatum der Datei geändert hat.
c: Prüfen, ob sich die Zugriffszeit der Datei geändert hat.
S: Auf eine geänderte Dateigröße prüfen.
I: Änderungen des Dateinamens ignorieren.
Folgende Hash-Werte können bei der berechnung der Prüfsummen verwendet werden:
md5: md5 Prüfsumme (deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt - die Verwendung von sha256 oder sha512 ist hier empfohlen.)
sha1: sha1 Prüfsumme (deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt - die Verwendung von sha256 oder sha512 ist hier empfohlen.)
sha256: sha256 Prüfsumme
sha512: sha512 Prüfsumme
rmd160: rmd160 Prüfsumme (deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt)
tiger: tiger Prüfsumme
haval: haval Prüfsumme (MHASH only)
gost: gost Prüfsumme ((deprecated seit AIDE v0.19, wird in AIDE v0.21 entfernt - MHASH only)
crc32: crc32 Prüfsumme (MHASH only)
whirlpool: whirlpool Prüfsumme (MHASH only)
Zum Schluß muss man sich noch Gedanken machen welche Dateien und Verzeichnis ggf. ausgenommen werden sollen und welche Dateien und Verzeichnisse man in welcher Tiefe überwachen möchte. Die manpage zu aide.conf liefert hierzu wertvolle und tiefer gehende Informationen!
Ist man mit der Konfiguration von AIDE soweit zufrieden und fertig, ist man gut beraten mit Hilfe der Option --config-check oder kurz -D einen Syntax-Check der Konfigurationsdatei vorzunehmen.
# aide --config-check
Betrieb
AIDE Command Options
Bevor wir nun die AIDE-Datenbank initial erstellen, werfen wir noch kurz einen Blick auf die Optionen, die bei Aufruf von aide bei Bedarf verwendet werden können.
# aide --help
AIDE 0.19
Usage: aide [options] command
Commands:
-i, --init Initialize the database
-n, --dry-init Traverse the file system and match each file against rule tree
-C, --check Check the database
-u, --update Check and update the database non-interactively
-E, --compare Compare two databases
--list List the entries of the database in human readable format
Miscellaneous:
-D, --config-check Test the configuration file
-p FILE_TYPE:PATH --path-check=FILE_TYPE:PATH Match file type and path against rule tree
-v, --version Show version of AIDE and compilation options
-h, --help Show this help message
Options:
-c CFGFILE --config=CFGFILE Get config options from CFGFILE
-l REGEX --limit=REGEX Limit command to entries matching REGEX
-B "OPTION" --before="OPTION" Before configuration file is read define OPTION
-A "OPTION" --after="OPTION" After configuration file is read define OPTION
-L LEVEL --log-level=LEVEL Set log message level to LEVEL
-W WORKERS --workers=WORKERS Number of simultaneous workers (threads) for file attribute processing (i.a. hashsum calculation)
--no-progress Turn progress off explicitly
--no-color TUrn color off explicitly
Start timestamp: 2025-04-09 20:21:40 +0200 (AIDE 0.19)
AIDE successfully initialized database.
New AIDE database written to /var/lib/aide/pml010074.aide-database
Number of entries: 470035
---------------------------------------------------
The attributes of the (uncompressed) database(s):
---------------------------------------------------
/var/lib/aide/pml010074.aide-database
SHA256 : DeZuXvruf0L9fG11oZh5mk1ZepKGFkO/
Op1EaaqYtAA=
SHA512 : 8QtxyYTlwFZVWggkhEjqnS4HhwV6k/Ri
drMK/NU8OQzveDMAAiFJT6bqJ0KRBLTX
rZNy4XA1RSrNQGuekuccYw==
STRIBOG256: Q/i0VJgmvm/9Jo9pjhlEj3bVTWkgmG0C
cLssvKnNxRc=
STRIBOG512: w/jP8nke9Mr9WuMvyhUFV4VRdhJ7A0z3
NuKc0P1oq6G880fu2yOczsFD0Sm8Vy7z
kGvmNQD0z5DDOZbeaRy+/w==
SHA512/256: XyVqxWTI2O+KJzjmfvUcm/359DZpclp1
UVHA7epku8k=
SHA3-256 : bZ29uT+xik09tjNTMe6RZresToqcoyQn
wW+98W156UI=
SHA3-512 : dCRa+TdT97HYTbMx/gcuqNPgudSPUxF7
RpoOGeJPdWjg/l9j/zMfmuF++LQrV7HY
dqo6Dc3mLcR9OQWIHroN1g==
End timestamp: 2025-04-09 20:24:33 +0200 (run time: 2m 53s)
positive Prüfen des Filesystems gegen die Datenbank
Mit der Option --check bzw. -C könne wir nun eine Überprüfung des Dateisystems gegen die zuvor erstellte AIDE-Datenbank durchführen.
[django@pml010074 ~]$ sudo aide --check
Start timestamp: 2025-04-09 20:25:26 +0200 (AIDE 0.19)AIDE found NO differences between database and filesystem. Looks okay!!
Number of entries: 470065
---------------------------------------------------
The attributes of the (uncompressed) database(s):
---------------------------------------------------
http://10.0.0.40/local/pml010074.aide-database
SHA256 : QOiWNRdttVhB5R/npB68/OhUQ7/9e5Ky
TG1aZhv2fdQ=
SHA512 : UARen/wHQ+F2ll9YBbxsggQVM07jFuG4
oUNqjiGX5280oAj0tUrnkHHpUmd3P6HP
q0OaDsEyL8aRgnLX1eLu3w==
STRIBOG256: EATID6SUAKrXxSuM9FqgotPE3/LGDR/7
1v/Si6AGsys=
STRIBOG512: kn8Vcdj/PVReXgzz7QU5uxAadnTNNeQZ
cE0rXtHgoaJ+CICnM1tjwI4D54xYdJtV
3VpIXkLvWWzQccwQMWCLTg==
SHA512/256: hj73+/VwVX1owrU1q6Q+kPSeQ4klkicl
NpY7sghzMFI=
SHA3-256 : Qdgr3PyJkMnqUt2hLBzz/ZgMypMifj/v
ynEbwVKOlME=
SHA3-512 : NRTDCp+sy+xfYsxOLc/bn+h7vd8n9ypI
Azoln6PqUuDbgSVxwzfaoGLZUQAaThHP
MQd/ehBFNBna8ZNp70u3VQ==
End timestamp: 2025-04-09 20:27:51 +0200 (run time: 2m 25s)
Die Zeile:
AIDE found NO differences between database and filesystem. Looks okay!!
zeigt uns an, dass es keine Änderungen im und am System gab.
negative Prüfen des Filesystems gegen die Datenbank
Im nächsten Beispiel kompromittieren wir unser System, in dem wir von einem bestehenden Binary einen vermeintlichen bösen Klone erstellen:
# cp /usr/bin/sg /usr/bin/sg_evil_copy
Führen wir erneut eine Überprüfung unseres Systems aus, sollte die neue unbekannte Datei entsprechend detektiert werden.
[django@pml010074 ~]$ sudo aide --check
Start timestamp: 2025-04-09 20:25:26 +0200 (AIDE 0.19)
AIDE found differences between database and filesystem!!
Summary:
Total number of entries: 470035
Added entries: 1
Removed entries: 0
Changed entries: 2
---------------------------------------------------
Added entries:
---------------------------------------------------
f+++++++++++++++: /usr/bin/sg_evil_copy
---------------------------------------------------
Changed entries:
---------------------------------------------------
f ... i . : /etc/aide.conf
d = ... mc.. : /root
---------------------------------------------------
Detailed information about changes:
---------------------------------------------------
File: /etc/aide.conf
Inode : 4265479 | 4396623
Directory: /root
Mtime : 2025-04-08 15:39:09 +0200 | 2025-04-09 19:27:42 +0200
Ctime : 2025-04-08 15:39:09 +0200 | 2025-04-09 19:27:42 +0200
---------------------------------------------------
The attributes of the (uncompressed) database(s):
---------------------------------------------------
http://10.0.0.40/local/pml010074.aide-database
SHA256 : QOiWNRdttVhB5R/npB68/OhUQ7/9e5Ky
TG1aZhv2fdQ=
SHA512 : UARen/wHQ+F2ll9YBbxsggQVM07jFuG4
oUNqjiGX5280oAj0tUrnkHHpUmd3P6HP
q0OaDsEyL8aRgnLX1eLu3w==
STRIBOG256: EATID6SUAKrXxSuM9FqgotPE3/LGDR/7
1v/Si6AGsys=
STRIBOG512: kn8Vcdj/PVReXgzz7QU5uxAadnTNNeQZ
cE0rXtHgoaJ+CICnM1tjwI4D54xYdJtV
3VpIXkLvWWzQccwQMWCLTg==
SHA512/256: hj73+/VwVX1owrU1q6Q+kPSeQ4klkicl
NpY7sghzMFI=
SHA3-256 : Qdgr3PyJkMnqUt2hLBzz/ZgMypMifj/v
ynEbwVKOlME=
SHA3-512 : NRTDCp+sy+xfYsxOLc/bn+h7vd8n9ypI
Azoln6PqUuDbgSVxwzfaoGLZUQAaThHP
MQd/ehBFNBna8ZNp70u3VQ==
End timestamp: 2025-04-09 20:27:51 +0200 (run time: 2m 25s)
In der Zusammenfassung sehen wir also in Summe 470.035 Datenbankeinträge, sowie von den Einträgen her ein neuer, sowie zwei geänderte Einträge:
Total number of entries: 470035
Added entries: 1
Removed entries: 0
Changed entries: 2
Die Datei /usr/bin/sg_evil_copy ist neu hinzugekommen sowie die SWAP-Datei /root/.cache/vim/swap/%etc%aide.conf.swp entfernt worden.
Im Abschnitt Changed entries sehen wir:
d = ... mc.. : /root
d < ... mc.. : /root/.cache/vim/swap
f > ... mci.H : /root/.lesshst
f < ... mci.H : /root/.viminfo
d > ... mc.. : /usr/bin
In der ersten Spalte kennzeichnet ein d ein Verzeichnis und ein f eine Datei.
In der zweiten Spalte wird eine Änderung angezeigt, ob sich die Grösse einer Datei bzw. des Verzeichnisses geändert hat. = bedeutet keine Änderung, > zeigt eine Vergrösserung und < eine Verkleinerung an.
Die mit jedem Buchstaben verbundenen Attribute sind wie folgt:
l bedeutet, dass sich der Link-Name geändert hat.
b bedeutet, dass sich die Blockanzahl geändert hat.
p bedeutet, dass sich die Berechtigungen geändert haben.
u bedeutet, dass sich die uid geändert hat.
g bedeutet, dass sich die gid geändert hat.
a bedeutet, dass sich die Zugriffszeit geändert hat.
m bedeutet, dass sich die Änderungszeit geändert hat.
c bedeutet, dass sich die Änderungszeit geändert hat.
i bedeutet, dass sich der Inode geändert hat.
n bedeutet, dass sich die Linkanzahl geändert hat.
H bedeutet, dass sich eine oder mehrere Prüfsummen geändert haben.
Die folgenden Buchstaben sind nur verfügbar, wenn sie explizit mit „configure“ aktiviert werden:
A bedeutet, dass sich die Zugriffskontrollliste geändert hat.
X bedeutet, dass sich die erweiterten Attribute geändert haben.
S bedeutet, dass sich die SELinux-Attribute geändert haben.
E bedeutet, dass sich die Dateiattribute auf einem zweiten erweiterten Dateisystem geändert haben.
C bedeutet, dass sich die Dateifähigkeiten geändert haben.
Im Abschnitt Detailed information about changes: sehen wir dann jeweils die detaillierten Informationen zu den Änderungen.
Update Database
Nach Änderungen am System, z.B. bei Konfigurationsänderungen, Updates oder Neuinstallationen von Paketen muss zwingend eine Aktualisierung der Datenbank erfolgen. Hier steht uns die Option --update oder kurz -u zu Verfügung.
$ sudo aide --update
Alternativ kann man auch direkt die Datenbank neu initialisieren:
$ sudo aide --init
aide --update kombiniert im Grunde einen Check und eine Initialisierung einer neuen Datenbank. Der Vorteil der Verwendung von --update gegenüber --check und --init besteht darin, dass der Bericht und die neue Datenbank immer auf denselben Dateisystemdaten basieren.
Ein anderer Ansatz wäre dann ein --init gefolgt von einem --compare zu verwenden, jedoch ist dabei zum beachten, dass nicht alle Attribute (nämlich „growing“ und „compressed“) im Vergleichsmodus unterstützt werden.
tägliche checks enablen
Wiederkehrende tägliche Checks führt man am besten und einfachsten des systemd aidecheck.timer aus. Zum Aktivieren dieser zeitgesteuerten Checks verwenden wir folgenden Befehl:
Created symlink '/etc/systemd/system/multi-user.target.wants/aidecheck.timer' → '/usr/lib/systemd/system/aidecheck.timer'.
Den Status können wir wie gewohnt via systemctl abfragen:
[django@pml010074 ~] $ sudo systemctl status aidecheck.timer
● aidecheck.timer - Aide check every day at 5AM
Loaded: loaded (/usr/lib/systemd/system/aidecheck.timer; enabled; preset: disabled)
Active:active (running)since Sun 2025-02-09 13:47:17 CET; 49min ago
Invocation: 9eb7be3eccc043be82f4dd4e9b5b72ed
Trigger: Mon 2025-02-10 05:00:00 CET; 14h left
Triggers: ● aidecheck.service
Feb 09 13:47:17 pml010074 systemd[1]: Started Aide check every day at 5AM.
jounald (tägliche) logs
In der Konfigurationsdatei /etc/aide.conf definieren wir für die Speicherung der AIDE-Logs im Jounal:
Mar 14 16:20:38 pml010070 aide[102360]: Start timestamp: 2025-03-14 16:18:57 +0100 (AIDE 0.18.8)
Mar 14 16:20:38 pml010070 aide[102360]: AIDE successfully initialized database.
Mar 14 16:20:38 pml010070 aide[102360]: New AIDE database written to /var/lib/aide/pml010070.aide-database
Mar 14 16:20:38 pml010070 aide[102360]:
Number of entries: 415354
Mar 14 16:20:38 pml010070 aide[102360]:
---------------------------------------------------
The attributes of the (uncompressed) database(s):
---------------------------------------------------
Mar 14 16:20:38 pml010070 aide[102360]:
Mar 14 16:20:38 pml010070 aide[102360]: /var/lib/aide/pml010070.aide-database
Mar 14 16:20:38 pml010070 aide[102360]: MD5 : cKcw5jV3zJWP6TMJeRZrWA==
Mar 14 16:20:38 pml010070 aide[102360]: SHA1 : WigC6cPTyrQRFNIhCwKpZqfKm4w=
Mar 14 16:20:38 pml010070 aide[102360]: SHA256 : WGSt7wa0Hg5muPhyqm7djZ2hFEpOuxAb
Mar 14 16:20:38 pml010070 aide[102360]: fbIgEeDhb2E=
Mar 14 16:20:38 pml010070 aide[102360]: SHA512 : U1ybuczO4cQuiNQeaC/+ifx2A35LN12P
Mar 14 16:20:38 pml010070 aide[102360]: khwMFF0cow+EJBgpU/rgPWZ1pHT0R/ft
Mar 14 16:20:38 pml010070 aide[102360]: sqVmFI2kYXTTZVgMC/6exg==
Mar 14 16:20:38 pml010070 aide[102360]: RMD160 : mlbLBlEUShR/TiPhGrfFHxargCg=
Mar 14 16:20:38 pml010070 aide[102360]: TIGER : RwucrlxNyW0VQZLxlPZcgwK9E1V1AE5E
Mar 14 16:20:38 pml010070 aide[102360]: CRC32 : DBPsjQ==
Mar 14 16:20:38 pml010070 aide[102360]: WHIRLPOOL : Ae/6G8dKIlhG3LWIhPPQIoX/Ft2s6IwZ
Mar 14 16:20:38 pml010070 aide[102360]: VM43NRfO1t8P9+kjyHO3B4ix4QPSlT8C
Mar 14 16:20:38 pml010070 aide[102360]: 3u81OG360J1VWXK7IynzLA==
Mar 14 16:20:38 pml010070 aide[102360]: GOST : ZmqxZHVeDyiJIR1mzgTvleoetI9fYn77
Mar 14 16:20:38 pml010070 aide[102360]: gU7jrp4K9d0=
Mar 14 16:20:38 pml010070 aide[102360]: STRIBOG256: hAF0w3sUx7G5a16cg96B6aUI3ig8BB+2
Mar 14 16:20:38 pml010070 aide[102360]: qAf4Fd3/X+c=
Mar 14 16:20:38 pml010070 aide[102360]: STRIBOG512: vLDF/5VqfXyLeuDt6Yj2LfrBVBYamJwn
Mar 14 16:20:38 pml010070 aide[102360]: dMHKJrrKaXNlY2Y/TVwtnb6bNnpNz9YO
Mar 14 16:20:38 pml010070 aide[102360]: Xs0mvlY+fXVlKPiEzKQvQg==
Mar 14 16:20:38 pml010070 aide[102360]:
End timestamp: 2025-03-14 16:20:38 +0100 (run time: 1m 41s)
Orchestrierung - Installation und Konfiguration von AIDE mit Hilfe von Ansible
Aufgabenstellung
Natürlich wird man im Jahr 2025 nicht mehr ernsthaft, manuell Server aufsetzen und betreiben wollen. Vielmehr wird man auf ein Orchestrierungswerkzeug wie z.B. Ansible zurückgreifen. Setzen wir einen neue virtuellen Server unter Arch Linux neu auf, oder wollen wir bei einem bestehenden Host die Konfiguration aktualisieren, verwenden wir wie zuvor schon angeschnitten Ansible als Orchestrierungswerkzeug. So ist sichergestellt dass zum einen all unsere Hosts entsprechend gleich aufgebaut, konfiguriert und betrieben werden, es also keine Bastel-/Frickellösung geben wird.
In diesem Konfigurationsbeispiel gehen wir davon aus, dass wir auf zwei Hosts im Intranet AIDE installieren und konfigurieren möchten. Ferner holen wir uns das AIDE-Installationspaket von einem internen Repository-/Spiegelserver, auf dem wir dann auch die generierten AIDE Datenbanken ablegen werden. Somit stehen die Datenbanken manipulationssicher auf den beiden Hosts zur Verfügung, sollte wider erwarten Ein Eindringling auf diesen Maschinen versuchen durch einen manuellen Update der AIDE-Datenbank sein Tun zu verschleiern. AIDE wird bei jedem Check dann via get_url die aktuelle Datenbank holen und das Dateisystem dagegen prüfen.
Wir werden uns nun nachfolgend die Server-Installation und -konfiguration genauer betrachten.
Lösung
Der ungeduldigen Leser kann auch direkt zur Tat schreiten und das manuelle Anlegen der Inventory-Hülle, des Playbooks und der zugehörigen Rolle überspringen und diese Aufgaben mit folgendem Befehl sozusagen auf einem Rutsch erledigen:
# Inventory Datei für die System-Umgebung im SOHO
#
# Hinweise:
# - Kommentare beginnen mit einem '#'-Zeichen
# - leere Zeilen werden ignoriert
# - Host- und Gruppendefinitionen werden mit [] abgegrenzt
# - Hosts können über ihren Hostnamen, FQN oder ihrer IP-Adresse definiert
# - übergeordnete Gruppen werden durch [:children] abgegrenzt
#
# Host-Definitionen
# Hosts ohne Gruppenzuordnung
localhost
[edmz]
vml000210
[idmz]
vml000110
[intra]
pml010070
pml010074
# Host-Gruppen-Definitionen
# (zu welcher Gruppe gehören Untergruppen bzw. Hosts)
[arch:children]
intra
edmz
idmz
Für alle Host aus der Gruppe arch definieren wir nun noch eine Datei mit den Definitionen der Variablen dieser Gruppe.
Die beiden Beispiel-Hosts aus der Gruppe|Zone intra in diesem Inventory symbolisieren folgende zwei Knoten.
Der Host pml010070 steht exemplarisch für einen Client im Intranet. In dessen Inventory-File inventories/production/host_vars/pml010070 sind die ihn beschreibenden Daten enthalten.
Der Host pml010074 steht exemplarisch für einen Client im Intranet. In dessen Inventory-File inventories/production/host_vars/pml010074 sind die ihn beschreibenden Daten enthalten.
Wir legen uns also nun die Definitionsdateien für die beiden Hosts im SOHO an.
Für die Installation und Konfiguration von aide verwenden wir eine eigene Rolle hids, die wir bei unserem zuvor angelegten Playbooks später einfach mit aufrufen werden. Hierzu kopieren wir uns zunächst die Mustervorlage common.
Bei Bedarf können wir uns später die Struktur, die somit angelegt wurde und die wir nun gleich mit Inhalten befüllen wollen, mit nachfolgendem Befehl anzeigen lassen.
---
- name: "Installation von AIDE/HIDS."
ansible.builtin.include_tasks:
file: install.yml
apply:
tags: install
- name: "Konfiguration von AIDE/HIDS."
ansible.builtin.include_tasks:
file: config.yml
apply:
tags: config
- name: "AIDE-Datenbank auf Reposerver transferieren."
ansible.builtin.include_tasks:
file: transfer.yml
apply:
tags: transfer
...
Die Installation von AIDE wird in der ersten Task-Gruppe mit dem tag install vorgenommen. In den Variablen der Gruppe arch sind hierbei die Versionsnummer aide_version wie auch Ort und Stelle aide_repo definiert von welchem internen Repository/Spiegel-Server wir uns das aide-Paket zum Installieren holen wollen.
Was nun noch fehlt ist das Kopieren der erstellten AIDE-Datenbank auf unseren internen Repository-/Spiegel-Server, was im letzten Task transfer erledigt wird. Der interne Repository-Serever wird hierbei über den Host-Alias-Namen repo angesprochen!
Für die Erstellung der AIDE-Konfigurationsdatei /etc/aide.conf und auch für die individuelle Systemd-Timer Defintion von AIDE /etc/systemd/system/aidecheck.timer - also wann genau der Check des Systems gegen die Datenbank erfolgen soll - brauchen wir nun noch jeweils ein Jinja2 Template. Mit Hilfe dieser beiden Templates aide_config.j2 und der darin enthaltenen Schleifendefinitionen werden dann mit Hilfe der Daten aus dem Inventory die benötigte Konfigurationsdateie erzeugt.
Damit nicht nun später alle unsere 42 VMs zum selben Zeitpunkt mit dem Check des jeweiligen Systems beginnen und somit einen vermeidbaren Peak auf unserem Repository-/Spiegel-Server und auf den jeweiligen Virtualisierungsmaschinen verursachen, gilt es nun die Startzeitpunkte der einzelnen Hosts zu streuen. Wir wollen hier natürlich auch nicht bei jedem Lauf des Playbooks später dann unterschiedliche Zufallswerte Produzieren, was die Idee der Idempotenz auch konterkarieren würde. Wir generieren daher für die Minutenzahl von 00 - 59 basierend auf den Seed des Hostnamens eine statische zufällige Minutenzahl zwischen 00 und 59, die für jeden Host unterschiedlich aber dennoch für diesen gleich bleiben wird. Hierzu Nutzen wir die Ansible-Variable: {{ 59 |random(seed=inventory_hostname) }}. Somit werden später alle Checks der System im Zeitraum von 05:00:00 - 05:59:00 erfolgen.
# Ansible managed configuration file, do not modify manually!
[Unit]
Description=Aide check every day at 05:{{ 59 |random(seed=inventory_hostname) }}:00
[Timer]
OnCalendar=*-*-* 05:{{ 59 |random(seed=inventory_hostname) }}:00
Unit=aidecheck.service
[Install]
WantedBy=multi-user.target
handlers
Sollte bei der Abarbeitung des Playbook die individuelle systemd-timer Konfigurationsdatei /etc/systemd/system/aidecheck.timer.d/override.conf verändert werden, ist natürlich hierbei eine entsprechende Information zum Relaod des System-Daemon notwenig. Hierzu verwenden wir die Ansible Playbook Handlers. Diese Handler werden in den beiden Tasks zur Erstellung der aidecheck.timer.d/override.conf-Konfigurationsdatei mit Hilfe eines handler-Calls aufgerufen, sofern sich die Datei verändert hat.
Zu guter Letzt brauchen wir noch eine Konfiguration der Aufgaben die bei einem notify abgearbeitet werden sollen.
Unser Playbook zum Installieren und Konfigurieren unseres HIDS auf Basis AIDE, ist wie immer schlank, unscheinbar und unspektakulär, beinhaltet aber Hinweise zur Aufgabe und wie es aufzurufen ist.
---# Ansible Playbook zum Installieren und Konfigurieren eines Host Intrusion Detection System (HIDS)# auf Basis AIDE ( https://github.com/aide/aide ) unter Arch-Linux.## Aufruf via:# $ ansible-playbook playbooks/arch_hids.yml## bzw. einzelnen Host:# $ ansible-playbook playbooks/arch_hids.yml --limit <-hostnames->## bzw. mehrere Hosts:# $ ansible-playbook playbooks/arch_hids.yml --limit <-hostname1->,<-hostname2->## bzw. einzelnen Host excludieren:# $ ansible-playbook playbooks/arch_hids.yml --limit '!<-hostnames->!## bzw. mehrere Hosts excludieren:# $ ansible-playbook playbooks/arch_hids.yml --limit '!<-hostname1->,!<-hostname2->
- name: "Playbook-Name: arch_hids.yml"# Name des Playbooks
hosts: arch # Hostgruppe für den das Playbook gelten soll
roles:
- role: hids # HIDS installieren und konfigurieren
tags: hids # Tag-Kennzeichnung der definierten Rolle...
Ausführung - Playbooklauf
Die orchestrierte Variante der Installation und Konfiguration unseres AIDE-Daemon gestaltet sich ab sofort sehr einfach, brauchen wir doch lediglich die Konfigurationswerte im Inventory zu hinterlegen und zu pflegen und letztendlich das Playbook entsprechend aufzurufen, wenn z.B. gewollte Änderungen an einem System durch einen Admin bzw. durch den Lauf eines der Ansible-Playbooks erfolgten.
In nachfolgendem Beispiel installieren wir nun unseren AIDE-Daemon auf dem Host pml010070:
Bei einem Blick in unser System-Journal finden wir nun unter anderem zunächst einmal das Setzen des systemd-timers täglich um 05:51:00 für unseren Host
# journalctl -f /usr/bin/aide
Mar 14 14:40:36 pml010070 systemd[1]: Reloading finished in 162 ms.
Mar 14 14:40:36 pml010070 systemd[1]: Started Aide check every day at 05:51:00.
Mar 14 14:40:36 pml010070 systemd[1]: Started Aide Check.
Des weiteren finden wir auch Informationen zum initialen Erstellen der Aide-Datenbank.
Mar 14 14:43:07 pml010070 aide[94384]: Start timestamp: 2025-03-14 14:40:36 +0100 (AIDE 0.19)
Mar 14 14:43:07 pml010070 aide[94384]: AIDE found NO differences between database and filesystem. Looks okay!!
Mar 14 14:43:07 pml010070 aide[94384]:
Number of entries: 415370
Mar 14 14:43:07 pml010070 aide[94384]:
---------------------------------------------------
The attributes of the (uncompressed) database(s):
---------------------------------------------------
Mar 14 14:43:07 pml010070 aide[94384]:
Mar 14 14:43:07 pml010070 aide[94384]: http://10.0.0.40/local/pml010070.aide-database
Mar 14 14:43:07 pml010070 aide[94384]: MD5 : FqaMpI9bZvV3FiZB8nJowA==
Mar 14 14:43:07 pml010070 aide[94384]: SHA1 : vGllC7x5U6FndAR7T2k6v5M3zpw=
Mar 14 14:43:07 pml010070 aide[94384]: SHA256 : OGRb4RHabaNJGxw8rJ3eqMN1dQ5BR/od
Mar 14 14:43:07 pml010070 aide[94384]: TWY8w+4k8j8=
Mar 14 14:43:07 pml010070 aide[94384]: SHA512 : 45Gqayh6d8UU2bOhDw3heHvo8K2P3NkB
Mar 14 14:43:07 pml010070 aide[94384]: OG2DBHfVUWkdqiFkUxmnJzkNKr5OuJJU
Mar 14 14:43:07 pml010070 aide[94384]: 1I5jztmwx5yMROqpN+LGzA==
Mar 14 14:43:07 pml010070 aide[94384]: RMD160 : tmRQ4H5i9HtK44+neY+PcA9oBOI=
Mar 14 14:43:07 pml010070 aide[94384]: TIGER : lMSvw4apa4sTp/2wGf/9bENtoP/rGdWg
Mar 14 14:43:07 pml010070 aide[94384]: CRC32 : lNOWHg==
Mar 14 14:43:07 pml010070 aide[94384]: WHIRLPOOL : RpJ0mjh34mGWGOOxPI982f1J6+xsc1BQ
Mar 14 14:43:07 pml010070 aide[94384]: 6Qf3j/70QH6YaZ0xKnDioNvEGUZeSrXK
Mar 14 14:43:07 pml010070 aide[94384]: Start timestamp: 2025-03-14 14:40:36 +0100 (AIDE 0.19)
Mar 14 14:43:07 pml010070 aide[94384]: AIDE found NO differences between database and filesystem. Looks okay!!
Mar 14 14:43:07 pml010070 aide[94384]: Number of entries: 415370
Mar 14 14:43:07 pml010070 aide[94384]: ---------------------------------------------------
Mar 14 14:43:07 pml010070 aide[94384]: The attributes of the (uncompressed) database(s):
Mar 14 14:43:07 pml010070 aide[94384]: ---------------------------------------------------
Mar 14 14:43:07 pml010070 aide[94384]: http://10.0.0.40/local/pml010070.aide-database
Mar 14 14:43:07 pml010070 aide[94384]: MD5 : FqaMpI9bZvV3FiZB8nJowA==
Mar 14 14:43:07 pml010070 aide[94384]: SHA1 : vGllC7x5U6FndAR7T2k6v5M3zpw=
Mar 14 14:43:07 pml010070 aide[94384]: SHA256 : OGRb4RHabaNJGxw8rJ3eqMN1dQ5BR/od
Mar 14 14:43:07 pml010070 aide[94384]: TWY8w+4k8j8=
Mar 14 14:43:07 pml010070 aide[94384]: SHA512 : 45Gqayh6d8UU2bOhDw3heHvo8K2P3NkB
Mar 14 14:43:07 pml010070 aide[94384]: OG2DBHfVUWkdqiFkUxmnJzkNKr5OuJJU
Mar 14 14:43:07 pml010070 aide[94384]: 1I5jztmwx5yMROqpN+LGzA==
Mar 14 14:43:07 pml010070 aide[94384]: RMD160 : tmRQ4H5i9HtK44+neY+PcA9oBOI=
Mar 14 14:43:07 pml010070 aide[94384]: TIGER : lMSvw4apa4sTp/2wGf/9bENtoP/rGdWg
Mar 14 14:43:07 pml010070 aide[94384]: CRC32 : lNOWHg==
Mar 14 14:43:07 pml010070 aide[94384]: WHIRLPOOL : RpJ0mjh34mGWGOOxPI982f1J6+xsc1BQ
Mar 14 14:43:07 pml010070 aide[94384]: 6Qf3j/70QH6YaZ0xKnDioNvEGUZeSrXK
Mar 14 14:43:07 pml010070 aide[94384]: S88Yf1dE76zmSxan8K9lIw==
Mar 14 14:43:07 pml010070 aide[94384]: GOST : 6jc71FdttaZW/sUrNA04kyuipL3c6Uek
Mar 14 14:43:07 pml010070 aide[94384]: eu+La9lk8tk=
Mar 14 14:43:07 pml010070 aide[94384]: STRIBOG256: 8sSN/117ue7MfpZ9fvv6FlfNSeRKAg+m
Mar 14 14:43:07 pml010070 aide[94384]: MdP0ErwHN88=
Mar 14 14:43:07 pml010070 aide[94384]: STRIBOG512: lpC/Mc6AYEOh580mPp/Hv47qADCJktQw
Mar 14 14:43:07 pml010070 aide[94384]: th4EzUKygQsx+WQ04E4+GHwahMuM5zuw
Mar 14 14:43:07 pml010070 aide[94384]: kffXnQAsP1YkZra5jn7pnQ==
Mar 14 14:43:07 pml010070 aide[94384]: End timestamp: 2025-03-14 14:43:07 +0100 (run time: 2m 31s)
Mar 14 14:43:07 pml010070 aide[94384]: S88Yf1dE76zmSxan8K9lIw==
Mar 14 14:43:07 pml010070 aide[94384]: GOST : 6jc71FdttaZW/sUrNA04kyuipL3c6Uek
Mar 14 14:43:07 pml010070 aide[94384]: eu+La9lk8tk=
Mar 14 14:43:07 pml010070 aide[94384]: STRIBOG256: 8sSN/117ue7MfpZ9fvv6FlfNSeRKAg+m
Mar 14 14:43:07 pml010070 aide[94384]: MdP0ErwHN88=
Mar 14 14:43:07 pml010070 aide[94384]: STRIBOG512: lpC/Mc6AYEOh580mPp/Hv47qADCJktQw
Mar 14 14:43:07 pml010070 aide[94384]: th4EzUKygQsx+WQ04E4+GHwahMuM5zuw
Mar 14 14:43:07 pml010070 aide[94384]: kffXnQAsP1YkZra5jn7pnQ==
Mar 14 14:43:07 pml010070 aide[94384]:
End timestamp: 2025-03-14 14:43:07 +0100 (run time: 2m 31s)
Mar 14 14:43:07 pml010070 systemd[1]: aidecheck.service: Deactivated successfully.
Mar 14 14:43:07 pml010070 systemd[1]: aidecheck.service: Consumed 3min 26.741s CPU time, 708.5M memory peak.
Täglich um 05:51 Uhr wird nun unser Host die aktuelle Datenbank gegen die bestehende AIDE-Datenbank auf unserem internen Repository-/Spiegelserver holen und diese beim Check des Dateisystems verwenden.
Mar 15 05:51:09 pml010070 systemd[1]: Started Aide Check.
Mar 15 05:51:27 pml010070 rtkit-daemon[1200]: Supervising 8 threads of 5 processes of 1 users.
Mar 15 05:51:27 pml010070 rtkit-daemon[1200]: Supervising 8 threads of 5 processes of 1 users.
Mar 15 05:53:01 pml010070 aide[57175]: Start timestamp: 2025-03-15 05:51:09 +0100 (AIDE 0.19)
Mar 15 05:53:01 pml010070 aide[57175]: AIDE found differences between database and filesystem!!
Mar 15 05:53:01 pml010070 aide[57175]:
Summary:
Total number of entries: 415370
Added entries: 0
Removed entries: 0
Changed entries: 2
Mar 15 05:53:01 pml010070 aide[57175]:
---------------------------------------------------
Changed entries:
---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]:
d = ... mc.. .. : /etc/cups
Mar 15 05:53:01 pml010070 aide[57175]:
d = ... mc.. : /root
Mar 15 05:53:01 pml010070 aide[57175]:
---------------------------------------------------
Detailed information about changes:
---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]:
Mar 15 05:53:01 pml010070 aide[57175]: Directory:
Mar 15 05:53:01 pml010070 aide[57175]: /etc/cups
Mar 15 05:53:01 pml010070 aide[57175]: Mtime : 2025-03-13 13:49:27 +0100 | 2025-03-14 05:22:46 +0100
Mar 15 05:53:01 pml010070 aide[57175]: Ctime : 2025-03-13 13:49:27 +0100 | 2025-03-14 05:22:46 +0100
Mar 15 05:53:01 pml010070 aide[57175]:
Mar 15 05:53:01 pml010070 aide[57175]: Directory:
Mar 15 05:53:01 pml010070 aide[57175]: /root
Mar 15 05:53:01 pml010070 aide[57175]: Mtime : 2025-03-11 19:16:06 +0100 | 2025-03-13 17:47:03 +0100
Mar 15 05:53:01 pml010070 aide[57175]: Ctime : 2025-03-11 19:16:06 +0100 | 2025-03-13 17:47:03 +0100
Mar 15 05:53:01 pml010070 aide[57175]:
---------------------------------------------------
The attributes of the (uncompressed) database(s):
---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]:
Mar 15 05:53:01 pml010070 aide[57175]: http://10.0.0.40/local/pml010070.aide-database
Mar 15 05:53:01 pml010070 aide[57175]: MD5 : JkDe+MaQ3jiZXGx4TPiP9w==
Mar 15 05:53:01 pml010070 aide[57175]: SHA1 : ulm0dLAs62vjmWKNuh6LyV3HORE=
Mar 15 05:53:01 pml010070 aide[57175]: SHA256 : S/BG2ZPAZogkojazoc13F6sme84JWTik
Mar 15 05:53:01 pml010070 aide[57175]: zH4ysMjRjnQ=
Mar 15 05:53:01 pml010070 aide[57175]: SHA512 : o4mqYllOZrjONDaZP/hywLlZHcSv69Z1
Mar 15 05:53:01 pml010070 aide[57175]: CkdMvaD3LZdr+bzK7zjwnpbG4nONTmDx
Mar 15 05:53:01 pml010070 aide[57175]: p5sXILkYA+REaSrbAIft0Q==
Mar 15 05:53:01 pml010070 aide[57175]: RMD160 : 1+EE+mVMQl0wLRZQk5qSwegYvLY=
Mar 15 05:53:01 pml010070 aide[57175]: TIGER : mvvYirLAo30g35dnku/8KcCkoHfg4Dz+
Mar 15 05:53:01 pml010070 aide[57175]: CRC32 : h+Fz5Q==
Mar 15 05:53:01 pml010070 aide[57175]: WHIRLPOOL : 5wn7egFu5xf5IPQnBCdZbRsz+UXf1BdQ
Mar 15 05:53:01 pml010070 aide[57175]: QauE/6ZI2VaMzGs3antSVbmkHmCnMoWT
Mar 15 05:53:01 pml010070 aide[57175]: xj4keofx/JSJWKvUUMLnnA==
Mar 15 05:53:01 pml010070 aide[57175]: GOST : iHuOTlg03FrPEX9ror1szxOomv/c+eUc
Mar 15 05:53:01 pml010070 aide[57175]: olR6ymPJlBM=
Mar 15 05:53:01 pml010070 aide[57175]: STRIBOG256: FJPuiouF2Rs9qxvN9czdHdVbp1eAHdwc
Mar 15 05:53:01 pml010070 aide[57175]: nVp7Q31aqCE=
Mar 15 05:53:01 pml010070 aide[57175]: STRIBOG512: HMJSk//+5BxO2Z3620Zz4u/blN5yPvRC
Mar 15 05:53:01 pml010070 aide[57175]: d0yzK7LYs9uC3cZx1GxpL6sBIWqMMn1x
Mar 15 05:53:01 pml010070 aide[57175]: 4rib/WieOl1eeUTP8YefKQ==
Mar 15 05:53:01 pml010070 aide[57175]:
End timestamp: 2025-03-15 05:53:01 +0100 (run time: 1m 52s)
Mar 15 05:53:01 pml010070 aide[57175]: Start timestamp: 2025-03-15 05:51:09 +0100 (AIDE 0.19)
Mar 15 05:53:01 pml010070 aide[57175]: AIDE found differences between database and filesystem!!
Mar 15 05:53:01 pml010070 aide[57175]: Summary:
Mar 15 05:53:01 pml010070 aide[57175]: Total number of entries: 415370
Mar 15 05:53:01 pml010070 aide[57175]: Added entries: 0
Mar 15 05:53:01 pml010070 aide[57175]: Removed entries: 0
Mar 15 05:53:01 pml010070 aide[57175]: Changed entries: 2
Mar 15 05:53:01 pml010070 aide[57175]: ---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]: Changed entries:
Mar 15 05:53:01 pml010070 aide[57175]: ---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]: d = ... mc.. .. : /etc/cups
Mar 15 05:53:01 pml010070 aide[57175]: d = ... mc.. : /root
Mar 15 05:53:01 pml010070 aide[57175]: ---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]: Detailed information about changes:
Mar 15 05:53:01 pml010070 aide[57175]: ---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]: Directory: /etc/cups
Mar 15 05:53:01 pml010070 aide[57175]: Mtime : 2025-03-13 13:49:27 +0100 | 2025-03-14 05:22:46 +0100
Mar 15 05:53:01 pml010070 aide[57175]: Ctime : 2025-03-13 13:49:27 +0100 | 2025-03-14 05:22:46 +0100
Mar 15 05:53:01 pml010070 aide[57175]: Directory: /root
Mar 15 05:53:01 pml010070 aide[57175]: Mtime : 2025-03-11 19:16:06 +0100 | 2025-03-13 17:47:03 +0100
Mar 15 05:53:01 pml010070 aide[57175]: Ctime : 2025-03-11 19:16:06 +0100 | 2025-03-13 17:47:03 +0100
Mar 15 05:53:01 pml010070 aide[57175]: ---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]: The attributes of the (uncompressed) database(s):
Mar 15 05:53:01 pml010070 aide[57175]: ---------------------------------------------------
Mar 15 05:53:01 pml010070 aide[57175]: http://10.0.0.40/local/pml010070.aide-database
Mar 15 05:53:01 pml010070 aide[57175]: MD5 : JkDe+MaQ3jiZXGx4TPiP9w==
Mar 15 05:53:01 pml010070 aide[57175]: SHA1 : ulm0dLAs62vjmWKNuh6LyV3HORE=
Mar 15 05:53:01 pml010070 aide[57175]: SHA256 : S/BG2ZPAZogkojazoc13F6sme84JWTik
Mar 15 05:53:01 pml010070 aide[57175]: zH4ysMjRjnQ=
Mar 15 05:53:01 pml010070 aide[57175]: SHA512 : o4mqYllOZrjONDaZP/hywLlZHcSv69Z1
Mar 15 05:53:01 pml010070 aide[57175]: CkdMvaD3LZdr+bzK7zjwnpbG4nONTmDx
Mar 15 05:53:01 pml010070 aide[57175]: p5sXILkYA+REaSrbAIft0Q==
Mar 15 05:53:01 pml010070 aide[57175]: RMD160 : 1+EE+mVMQl0wLRZQk5qSwegYvLY=
Mar 15 05:53:01 pml010070 aide[57175]: TIGER : mvvYirLAo30g35dnku/8KcCkoHfg4Dz+
Mar 15 05:53:01 pml010070 aide[57175]: CRC32 : h+Fz5Q==
Mar 15 05:53:01 pml010070 aide[57175]: WHIRLPOOL : 5wn7egFu5xf5IPQnBCdZbRsz+UXf1BdQ
Mar 15 05:53:01 pml010070 aide[57175]: QauE/6ZI2VaMzGs3antSVbmkHmCnMoWT
Mar 15 05:53:01 pml010070 aide[57175]: xj4keofx/JSJWKvUUMLnnA==
Mar 15 05:53:01 pml010070 aide[57175]: GOST : iHuOTlg03FrPEX9ror1szxOomv/c+eUc
Mar 15 05:53:01 pml010070 aide[57175]: olR6ymPJlBM=
Mar 15 05:53:01 pml010070 aide[57175]: STRIBOG256: FJPuiouF2Rs9qxvN9czdHdVbp1eAHdwc
Mar 15 05:53:01 pml010070 aide[57175]: nVp7Q31aqCE=
Mar 15 05:53:01 pml010070 aide[57175]: STRIBOG512: HMJSk//+5BxO2Z3620Zz4u/blN5yPvRC
Mar 15 05:53:01 pml010070 aide[57175]: d0yzK7LYs9uC3cZx1GxpL6sBIWqMMn1x
Mar 15 05:53:01 pml010070 aide[57175]: 4rib/WieOl1eeUTP8YefKQ==
Mar 15 05:53:01 pml010070 aide[57175]: End timestamp: 2025-03-15 05:53:01 +0100 (run time: 1m 52s)
Mar 15 05:53:01 pml010070 systemd[1]: aidecheck.service: Main process exited, code=exited, status=4/NOPERMISSION
Mar 15 05:53:01 pml010070 systemd[1]: aidecheck.service: Failed with result 'exit-code'.
Mar 15 05:53:01 pml010070 systemd[1]: aidecheck.service: Consumed 2min 36.983s CPU time, 708.7M memory peak.
Fazit und Ausblick
Mit AIDE haben wir nun ein Instrument an der Hand, mit der wir die Dateisysteme unserer Host einfach auf Anomalien hin überwachen kann. Mit Hilfe unseres Ansible-Playbooks können wir nun auch nicht nur die Installation und Konfiguration des Aide-Daemon erledigen, sondern auch einfach die jeweiligen AIDE-Datenbanken der Hosts nach Änderungen durch den Admin bzw. bei Updates oder Ansible-Läufen, aktualisieren und automatisiert zum zentralen internen Repository-/Spiegelserver transferieren. Somit erübrigt sich ein Aufwändiges Signieren oder Wegsichern der Datenbank auf RO-Devices. Die AIDE-Datenbanken wir somit getrennt von den verwalteten Systemen gespeichert und ist folglich vor ungewollten Änderungen geschützt, sollte ein Remote-System kompromittiert worden sein!
In diesem Konfigurationsbeispiel wurde lediglich aufgezeigt, wie man einfach mit Hilfe von Ansible installieren, konfigurieren und Datenbanken der Host erstellen und weg sichern kann. Die AIDE-Protokolldateien müssen nun natürlich entsprechend überwacht und ausgewertet werden! Diesen Aspekt werden wir uns noch eingehend bei unserer Installation und Konfiguration eines zentralen Logauswertungstool wie z.B. graylog
noch im Detail ansehen!
Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information