Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
linux:aide [14.03.2025 10:48. ] – [Orchestrierung - Installation und Konfiguration von AIDE mit Hilfe von Ansible] django | linux:aide [15.03.2025 09:08. ] (aktuell) – [Konfiguration] /etc/aide.conf aktualisiert django | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Host based Intrusion Detection System mit AIDE unter Arch ====== | + | ====== Host based Intrusion Detection System mit AIDE unter Arch Linux ====== |
===== HIDS - was ist das und wozu nutzt man es? ===== | ===== 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ässig 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, | 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ässig 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, | ||
Zeile 1586: | Zeile 1586: | ||
# sudo vim / | # sudo vim / | ||
- | <file bash / | + | <file bash / |
- | # More information about configuration | + | # Ansible managed |
- | # Inspired from https:// | + | # |
- | + | # ┌──────────────────────────────────────────────────────────────────────┐ | |
- | # ┌───────────────────────────────────────────────────────────────┐ | + | # │ Contents of configuration file aide.conf |
- | # │ CONTENTS OF aide.conf | + | # ├──────────────────────────────────────────────────────────────────────┤ |
- | # ├───────────────────────────────────────────────────────────────┘ | + | # │ |
- | # │ | + | # ├──┬───── 1. |
- | # ├──┐VARIABLES | + | # │ ├───── 1.1 DATABASE |
- | # │ ├── DATABASE | + | # │ └───── 1.2 REPORT |
- | # │ └── REPORT | + | # │ │ |
- | # ├──┐RULES | + | # ├──┬───── 2. |
- | # │ ├── LIST OF ATTRIBUTES | + | # │ ├───── 2.1 LIST OF ATTRIBUTES |
- | # │ ├── LIST OF CHECKSUMS | + | # │ ├───── 2.2 LIST OF CHECKSUMS |
- | # │ └── AVAILABLE RULES | + | # │ └───── 2.3 AVAILABLE RULES │ |
- | # ├──┐PATHS | + | # │ │ |
- | # │ ├──┐EXCLUDED | + | # ├──┬───── 3. |
- | # │ │ ├── ETC | + | # │ ├──┬── 3.1 EXCLUDED |
- | # │ │ ├── USR | + | # │ │ ├── |
- | # │ │ | + | # │ │ ├── |
- | # │ └──┐INCLUDED | + | # │ │ |
- | # │ | + | # │ |
- | # │ | + | # │ └──┬── 3.2. |
- | # │ | + | # │ |
- | # │ | + | # │ |
- | # │ | + | # │ |
- | # └─────────────────────────────────────────────────────────────── | + | # │ |
- | + | # │ | |
- | # ################################################################ | + | # └──────────────────────────────────────────────────────────────────────┘ |
- | + | # | |
- | # ################################ | + | ## 1. |
+ | ## 1.1 DATABASE | ||
@@define DBDIR / | @@define DBDIR / | ||
Zeile 1622: | Zeile 1623: | ||
# The location of the database to be read. | # The location of the database to be read. | ||
- | database_in=file:@@{DBDIR}/aide.db.gz | + | database_in = http://10.0.0.40/ |
# The location of the database to be written. | # The location of the database to be written. | ||
- | # | + | database_out = file: |
- | # | + | |
- | database_out=file: | + | |
- | # Whether to gzip the output to database | + | # Whether to gzip the output to database. |
- | gzip_dbout=yes | + | gzip_dbout = no |
- | # ################################ | + | ## 1.2 REPORT |
- | # Default. | + | # Default |
log_level=warning | log_level=warning | ||
report_level=changed_attributes | report_level=changed_attributes | ||
- | |||
- | report_url=file: | ||
report_url=stdout | report_url=stdout | ||
- | # | + | report_url=syslog: |
- | #NOT IMPLEMENTED report_url=mailto: | + | |
- | #NOT IMPLEMENTED | + | |
- | + | ||
- | # ################################################################ | + | |
- | # ################################ | + | ## 2. RULES |
+ | ## 2.1 LIST OF ATTRIBUTES | ||
# These are the default parameters we can check against. | # These are the default parameters we can check against. | ||
- | #p: | + | # p: permissions |
- | #i: | + | # i: inode |
- | #n: | + | # n: number of links |
- | #u: | + | # u: user |
- | #g: | + | # g: group |
- | #s: | + | # s: size |
- | #b: | + | # b: block count |
- | #m: | + | # m: mtime |
- | #a: | + | # a: atime |
- | #c: | + | # c: ctime |
- | #S: | + | # S: check for growing size |
- | #acl: | + | # acl: Access Control Lists |
- | # | + | # selinux |
- | # | + | # (must be enabled at compilation time) |
+ | # xattrs: | ||
- | # ################################ | + | # 2.2 LIST OF CHECKSUMS |
- | #md5: | + | # md5: md5 checksum |
- | # | + | # sha1: |
- | # | + | # sha256: |
- | # | + | # sha512: |
- | # | + | # rmd160: |
- | # | + | # tiger: |
- | # | + | # haval: |
- | # | + | # gost: |
- | # | + | # crc32: |
- | # | + | # whirlpool: |
- | # ################################ | + | # 2.3 AVAILABLE RULES |
# These are the default rules | # These are the default rules | ||
- | #R: | + | # R: p+i+l+n+u+g+s+m+c+md5 |
- | #L: | + | # L: p+i+l+n+u+g |
- | #E: | + | # 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 | ||
- | # You can create custom rules - my home made rule definition goes like this | ||
- | ALLXTRAHASHES = sha1+rmd160+sha256+sha512+whirlpool+tiger+haval+gost+crc32 | ||
- | ALLXTRAHASHES = sha1+rmd160+sha256+sha512+tiger | ||
# Everything but access time (Ie. all changes) | # Everything but access time (Ie. all changes) | ||
- | EVERYTHING = R+ALLXTRAHASHES | + | EVERYTHING = R+sha256+sha512 |
# Sane, with multiple hashes | # Sane, with multiple hashes | ||
Zeile 1713: | Zeile 1716: | ||
DATAONLY = p+n+u+g+s+acl+xattrs+sha256 | DATAONLY = p+n+u+g+s+acl+xattrs+sha256 | ||
- | # ################################################################ | + | ## 3. PATHS |
- | + | # | |
- | # Next decide what directories/files you want in the database. | + | # Here we define which directories |
- | + | # when monitoring with AIDE. | |
- | # ################################ | + | # |
+ | ## 3.1 EXCLUDED | ||
+ | ## 3.1.1 ETC | ||
- | # ################ | + | # Ignore root cache files |
+ | !/root/.* | ||
# Ignore backup files | # Ignore backup files | ||
Zeile 1727: | Zeile 1733: | ||
!/etc/mtab | !/etc/mtab | ||
- | # ################ | + | ## 3.1.2 USR |
# These are too volatile | # These are too volatile | ||
Zeile 1733: | Zeile 1739: | ||
!/usr/tmp | !/usr/tmp | ||
- | # ################ | + | ## 3.1.3 VAR |
# Ignore logs | # Ignore logs | ||
!/ | !/ | ||
!/ | !/ | ||
- | !/ | + | !/ |
- | !/ | + | !/ |
- | !/ | + | |
!/ | !/ | ||
- | # ################################ | + | ## 3.1.4 OTHERS |
+ | # Ignore cups | ||
+ | !/etc/cups | ||
- | # ################ | + | # Ignore backup files |
+ | !/root/.* | ||
+ | |||
+ | |||
+ | ## 3.2 INCLUDED | ||
+ | ## 3.2.1 ETC | ||
- | # Check only permissions, | + | # Check only permissions, |
+ | # important files closely. | ||
/etc PERMS | /etc PERMS | ||
/ | / | ||
Zeile 1810: | Zeile 1823: | ||
/ | / | ||
- | # ################ | + | ## 3.2.2 USR |
/usr | /usr | ||
/ | / | ||
- | # ################ | + | ## 3.2.3 VAR |
/ | / | ||
Zeile 1822: | Zeile 1835: | ||
/ | / | ||
- | # ################ | + | ## 3.2.4 OTHERS |
/boot NORMAL | /boot NORMAL | ||
Zeile 1830: | Zeile 1843: | ||
/opt | /opt | ||
/root NORMAL | /root NORMAL | ||
- | </ | + | |
+ | |||
+ | # Host based OTHERS | ||
+ | # local user scripts | ||
+ | / | ||
+ | |||
+ | # local scripts with root rights | ||
+ | / | ||
+ | |||
+ | |||
+ | # | ||
+ | # 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 **''/ | Wie eigentlich immer bei der Konfiguration von neuen Programmen lohnt es sich die zugehörige Konfigurationsdatei - in unserem Falle von **AIDE** die **''/ | ||
Zeile 2146: | Zeile 2170: | ||
</ | </ | ||
+ | === jounald (tägliche) logs === | ||
+ | In der Konfigurationsdatei **''/ | ||
+ | |||
+ | # vim / | ||
+ | < | ||
+ | |||
+ | # Default | ||
+ | log_level=warning | ||
+ | report_level=changed_attributes | ||
+ | report_url=stdout | ||
+ | report_url=syslog: | ||
+ | |||
+ | ...</ | ||
+ | |||
+ | Somit können wir einfach die Logeinträge von AIDE einfach ausgeben. | ||
+ | # journalctl -f / | ||
+ | ++++ Ausgabe der AIDE Logeinträge im Journal | | ||
+ | < | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Number of entries: | ||
+ | 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]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | Mar 14 16:20:38 pml010070 aide[102360]: | ||
+ | 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 | ===== Orchestrierung - Installation und Konfiguration von AIDE mit Hilfe von Ansible | ||
==== Aufgabenstellung ==== | ==== 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. **[[linux: | 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. **[[linux: | ||
+ | |||
+ | 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-/ | ||
Wir werden uns nun nachfolgend die Server-Installation und -konfiguration genauer betrachten. | Wir werden uns nun nachfolgend die Server-Installation und -konfiguration genauer betrachten. | ||
Zeile 2163: | Zeile 2244: | ||
</ | </ | ||
- | === Vorbereitung - (Server-)Daten im Inventory === | + | === Vorbereitung - Daten im Inventory === |
Bei unserem Konfigurationsbeispiel hier gehen wir von folgenden Parametern aus: | Bei unserem Konfigurationsbeispiel hier gehen wir von folgenden Parametern aus: | ||
* **'' | * **'' | ||
Zeile 2172: | Zeile 2253: | ||
$ vim inventories/ | $ vim inventories/ | ||
++++ inventories/ | ++++ inventories/ | ||
- | <file bash inventories/ | + | {{gh> https:// |
- | # | + | ++++ |
- | # Hinweise: | + | |
- | # - Kommentare beginnen mit einem '#' | + | |
- | # - 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 | + | Für alle Host aus der Gruppe **'' |
- | localhost | + | $ vim inventories/ |
- | + | ++++ inventories/production/ | |
- | [edmz] | + | {{gh> https:// |
- | vml000210 | + | |
- | + | ||
- | [idmz] | + | |
- | vml000110 | + | |
- | + | ||
- | [intra] | + | |
- | pml010070 | + | |
- | pml010074 | + | |
- | + | ||
- | # Host-Gruppen-Definitionen | + | |
- | # (zu welcher | + | |
- | + | ||
- | [arch: | + | |
- | intra | + | |
- | edmz | + | |
- | idmz | + | |
- | </file> | + | |
++++ | ++++ | ||
Zeile 2213: | Zeile 2269: | ||
$ vim inventories/ | $ vim inventories/ | ||
++++ inventories/ | ++++ inventories/ | ||
- | + | {{gh> https:// | |
- | {{gh> https:// | + | |
++++ | ++++ | ||
$ vim inventories/ | $ vim inventories/ | ||
++++ inventories/ | ++++ inventories/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
- | {{gh> https:// | + | Unser Beispiels-Inventory hat also nunmehr folgenden Aufbau: |
+ | <code> | ||
+ | ├── group_vars | ||
+ | │ └── arch | ||
+ | │ | ||
+ | ├── hosts | ||
+ | └── hosts_vars | ||
+ | ├── | ||
+ | └── pml010074 | ||
+ | 4 directories, | ||
+ | |||
+ | === Rolle === | ||
+ | Für die Installation und Konfiguration von **aide** verwenden wir eine eigene Rolle **'' | ||
+ | $ cp -avr roles/ | ||
+ | ++++ Ausgabe von cp -avr roles/ | ||
+ | < | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | </ | ||
++++ | ++++ | ||
+ | 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. | ||
+ | $ tree roles/hids/ | ||
+ | ++++ Ausgabe von tree roles/hids/ | | ||
+ | < | ||
+ | ├── defaults | ||
+ | ├── files | ||
+ | ├── handlers | ||
+ | │ └── main.yml | ||
+ | ├── library | ||
+ | ├── lookup_plugins | ||
+ | ├── meta | ||
+ | ├── module_utils | ||
+ | ├── tasks | ||
+ | │ ├── config.yml | ||
+ | │ ├── install.yml | ||
+ | │ ├── main.yml | ||
+ | │ └── transfer.yml | ||
+ | ├── templates | ||
+ | │ ├── aide_config.j2 | ||
+ | │ └── systemd.j2 | ||
+ | └── vars | ||
+ | 11 directories, | ||
+ | </ | ||
+ | ++++ | ||
+ | == tasks == | ||
+ | Wie wir sehen ist die Rolle durchaus überschaubar, | ||
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
- | Als nächstes legen wir die Datei für den KVM-Host, auf dem unser Kea-Daemon laufen soll an und definieren darin die zugehörigen Eigenschaften. | + | Die Installation von AIDE wird in der ersten Task-Gruppe mit dem tag **'' |
- | $ vim inventories/production/host_vars/vml010110/ | + | |
- | ++++ inventories/production/host_vars/vml010110/ | + | ++++ roles/hids/tasks/install.yml |
+ | {{gh> https:// | ||
+ | ++++ | ||
- | {{gh> https:// | + | Die eigentliche Installation Konfiguration sowie das erstellen der initialen AIDE-Datenbank erfolgt im anschliessenden Task **'' |
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | Was nun noch fehlt ist das Kopieren der erstellten AIDE-Datenbank auf unseren internen Repository-/ | ||
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{gh> https:// | ||
++++ | ++++ | ||
- | Die für die beiden | + | == templates == |
- | $ vim inventories/production/host_vars/vml010110/kea | + | Für die Erstellung der AIDE-Konfigurationsdatei |
- | ++++ inventories/production/host_vars/ | + | |
- | {{gh> https://gitlab.nausch.org/ | + | <WRAP center round tip 80%> |
+ | 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, | ||
+ | </ | ||
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{gh> https:// | ||
++++ | ++++ | ||
- | Unser Beispiels-Inventory hat also nunmehr folgenden Aufbau: | + | $ vim roles/ |
- | < | + | ++++ roles/hids/templates/ |
- | ├── hosts | + | {{gh> https:// |
- | └── host_vars | + | ++++ |
- | ├── pnc010007 | + | |
- | └── vml010110 | + | |
- | ├── kea | + | |
- | | + | |
- | 3 directories, 4 files</code> | + | == handlers == |
+ | Sollte bei der Abarbeitung des Playbook die individuelle systemd-timer Konfigurationsdatei **''/ | ||
+ | Zu guter Letzt brauchen wir noch eine Konfiguration der Aufgaben die bei einem **'' | ||
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | === Playbook === | ||
+ | Unser Playbook zum Installieren und Konfigurieren unseres HIDS auf Basis AIDE, ist wie immer schlank, unscheinbar und unspektakulär, | ||
+ | $ vim playbooks/ | ||
+ | ++++ playbooks/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | |||
+ | === Ausführung - Playbooklauf === | ||
+ | Die orchestrierte Variante der Installation und Konfiguration unseres **AIDE**-Daemons 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 **'' | ||
+ | $ ansible-playbook playbooks/ | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Ergebniskontrolle ==== | ||
+ | Bei einem Blick in unser System-Journal finden wir nun unter anderem zunächst einmal das Setzen des **'' | ||
+ | # journalctl -f / | ||
+ | < | ||
+ | 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.</ | ||
+ | |||
+ | Desweiteren finden wir auch Informationen zum initialen Erstellen der Aide-Datenbank. | ||
+ | # journalctl -f / | ||
+ | ++++ journal bei Erstellung der initialen Datenbank | | ||
+ | < | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | 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]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | Mar 14 14:43:07 pml010070 aide[94384]: | ||
+ | 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: | ||
+ | Mar 14 14:43:07 pml010070 systemd[1]: aidecheck.service: | ||
+ | ++++ | ||
+ | |||
+ | Täglich um **05:01** Uhr wird nun unser Host die aktuelle Datenbank gegen die bestehende AIDE-Datenbank auf unserem internen Repository-/ | ||
+ | # journalctl | ||
+ | ++++ journal beim täglichen check um 05:51 Uhr dieses Hosts | | ||
+ | < | ||
+ | Mar 15 05:51:27 pml010070 rtkit-daemon[1200]: | ||
+ | Mar 15 05:51:27 pml010070 rtkit-daemon[1200]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | | ||
+ | Total number of entries: | ||
+ | Added 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]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | 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]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | 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]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 aide[57175]: | ||
+ | Mar 15 05:53:01 pml010070 systemd[1]: aidecheck.service: | ||
+ | Mar 15 05:53:01 pml010070 systemd[1]: aidecheck.service: | ||
+ | Mar 15 05:53:01 pml010070 systemd[1]: aidecheck.service: | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ===== Fazit und Ausblick ===== | ||
+ | <WRAP center round tip 80%> | ||
+ | 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, | ||
+ | |||
+ | In diesem Konfigurationsbeispiel wurde lediglich aufgezeigt, wie man einfach mit Hilfe von Ansible installieren, | ||
+ | noch im Detail ansehen! | ||
+ | </ | ||
+ | |||
+ | ====== Links ====== | ||
+ | * **[[linux: | ||
+ | * **=> [[linux: | ||
+ | * **[[linux: | ||
+ | * **[[wiki: | ||
+ | * **[[http:// | ||
- | FIXME! |