Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
linux:aide [14.03.2025 14:44. ] – [Ergebniskontrolle] djangolinux:aide [15.03.2025 09:08. ] (aktuell) – [Konfiguration] /etc/aide.conf aktualisiert django
Zeile 1586: Zeile 1586:
    # sudo vim /etc/aide/aide.conf    # sudo vim /etc/aide/aide.conf
  
-<file bash /etc/aide/aide.conf># Example configuration file for AIDE. +<file bash /etc/aide/aide.conf># BEGIN ANSIBLE MANAGED - DO NOT EDIT BLOCK 
-More information about configuration options available in the aide.conf manpage. +Ansible managed configuration file, do not modify manually! 
-Inspired from https://src.fedoraproject.org/rpms/aide/raw/rawhide/f/aide.conf +
- +# ┌──────────────────────────────────────────────────────────────────────┐ 
-# ┌───────────────────────────────────────────────────────────────┐ +# │ Contents of configuration file aide.conf                             │ 
-# │ CONTENTS OF aide.conf                                         │ +# ├──────────────────────────────────────────────────────────────────────┤ 
-# ├─────────────────────────────────────────────────────────────── +│                                                                      │ 
-# │ +# ├──┬───── 1.    VARIABLES                                              │ 
-# ├──VARIABLES +# │  ├───── 1.1   DATABASE                                               │ 
-# │  ├── DATABASE +# │  └───── 1.2   REPORT                                                 │ 
-# │  └── REPORT +# │                                                                      │ 
-# ├──RULES +# ├──┬───── 2.    RULES                                                  │ 
-# │  ├── 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.    PATHS                                                  │ 
-# │  │  ├── ETC +# │  ├──┬── 3.1   EXCLUDED                                               │ 
-# │  │  ├── USR +# │  │  ├── 3.1.1 ETC                                                    │ 
-# │  │  ── VAR +# │  │  ├── 3.1.2 USR                                                    │ 
-# │  └──INCLUDED +# │  │  ── 3.1.3 VAR                                                    │ 
-# │     ├── ETC +│  │  └── 3.1.4 OTHERS                                                 │ 
-# │     ├── USR +# │  └──┬── 3.2.  INCLUDED                                               │ 
-# │     ├── VAR +# │     ├── 3.2.1 ETC                                                    │ 
-# │     └── OTHERS +# │     ├── 3.2.2 USR                                                    │ 
-# │ +# │     ├── 3.2.3 VAR                                                    │ 
-# └─────────────────────────────────────────────────────────────── +# │     └── 3.2.4 OTHERS                                                 │ 
- +│                                                                      │ 
-# ################################################################ VARIABLES +# └──────────────────────────────────────────────────────────────────────┘ 
- +# 
-# ################################ DATABASE+## 1.  VARIABLES 
 +## 1.1 DATABASE
  
 @@define DBDIR /var/lib/aide @@define DBDIR /var/lib/aide
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/local/pml010074.aide-database
  
 # The location of the database to be written. # The location of the database to be written.
-#database_out=sql:host:port:database:login_name:passwd:table +database_out = file:@@{DBDIR}/pml010074.aide-database
-#database_out=file:aide.db.new +
-database_out=file:@@{DBDIR}/aide.db.new.gz+
  
-# Whether to gzip the output to database +# Whether to gzip the output to database. 
-gzip_dbout=yes+gzip_dbout = no
  
-# ################################ REPORT+## 1.2 REPORT
  
-# Default.+# Default
 log_level=warning log_level=warning
 report_level=changed_attributes report_level=changed_attributes
- 
-report_url=file:@@{LOGDIR}/aide.log 
 report_url=stdout report_url=stdout
-#report_url=stderr +report_url=syslog:LOG_AUTH
-#NOT IMPLEMENTED report_url=mailto:root@foo.com +
-#NOT IMPLEMENTED report_url=syslog:LOG_AUTH +
- +
-# ################################################################ RULES+
  
-# ################################ LIST OF ATTRIBUTES+## 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:             permissions +# p:            permissions 
-#i:             inode: +# i:            inode 
-#n:             number of links +# n:            number of links 
-#u:             user +# u:            user 
-#g:             group +# g:            group 
-#s:             size +# s:            size 
-#b:             block count +# b:            block count 
-#m:             mtime +# m:            mtime 
-#a:             atime +# a:            atime 
-#c:             ctime +# c:            ctime 
-#S:             check for growing size +# S:            check for growing size 
-#acl:           Access Control Lists +# acl:          Access Control Lists 
-#selinux        SELinux security context (must be enabled at compilation time) +# selinux       SELinux security context  
-#xattrs:        Extended file attributes+#               (must be enabled at compilation time) 
 +# xattrs:       Extended file attributes
  
-################################ LIST OF CHECKSUMS+2.2 LIST OF CHECKSUMS
  
-#md5:           md5 checksum +# md5:          md5 checksum 
-#sha1:          sha1 checksum +# sha1:         sha1 checksum 
-#sha256:        sha256 checksum +# sha256:       sha256 checksum 
-#sha512:        sha512 checksum +# sha512:       sha512 checksum 
-#rmd160:        rmd160 checksum +# rmd160:       rmd160 checksum 
-#tiger:         tiger checksum +# tiger:        tiger checksum 
-#haval:         haval checksum (MHASH only) +# haval:        haval checksum (MHASH only) 
-#gost:          gost checksum (MHASH only) +# gost:         gost checksum (MHASH only) 
-#crc32:         crc32 checksum (MHASH only) +# crc32:        crc32 checksum (MHASH only) 
-#whirlpool:     whirlpool checksum (MHASH only)+# whirlpool:    whirlpool checksum (MHASH only)
  
-################################ AVAILABLE RULES+2.3 AVAILABLE RULES
  
 # These are the default rules # These are the default rules
-#R:             p+i+l+n+u+g+s+m+c+md5 +# R:            p+i+l+n+u+g+s+m+c+md5 
-#L:             p+i+l+n+u+g +# L:            p+i+l+n+u+g 
-#E:             Empty group +# E:            Empty group 
-#>:             Growing logfile p+l+u+g+i+n+S+# >:            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
  
-# ################################################################ PATHS+## 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
  
-Next decide what directories/files you want in the database. +Ignore root cache files 
- +!/root/.*
-# ################################ EXCLUDED +
- +
-# ################ ETC+
  
 # Ignore backup files # Ignore backup files
Zeile 1727: Zeile 1733:
 !/etc/mtab !/etc/mtab
  
-# ################ USR+## 3.1.2 USR
  
 # These are too volatile # These are too volatile
Zeile 1733: Zeile 1739:
 !/usr/tmp !/usr/tmp
  
-# ################ VAR+## 3.1.3 VAR
  
 # Ignore logs # Ignore logs
 !/var/lib/pacman/.* !/var/lib/pacman/.*
 !/var/cache/.* !/var/cache/.*
-!/var/log/.*   +!/var/log/.* 
-!/var/log/aide.log +!/var/run/.*
-!/var/run/.*  +
 !/var/spool/.* !/var/spool/.*
  
-# ################################ INCLUDED+## 3.1.4 OTHERS 
 +Ignore cups 
 +!/etc/cups 
 + 
 +Ignore backup files 
 +!/root/.* 
  
-# ################ ETC+## 3.2 INCLUDED 
 +## 3.2.1 ETC
  
-# Check only permissions, inode, user and group for /etc, but cover some important files closely.+# Check only permissions, inode, user and group for /etc, but cover some 
 +important files closely.
 /etc                               PERMS /etc                               PERMS
 /etc/aliases                       FIPSR /etc/aliases                       FIPSR
Zeile 1810: Zeile 1823:
 /etc/zshrc                         NORMAL /etc/zshrc                         NORMAL
  
-# ################ USR+## 3.2.2 USR
  
 /usr                               NORMAL /usr                               NORMAL
 /usr/sbin/stunnel                  FIPSR /usr/sbin/stunnel                  FIPSR
  
-# ################ VAR+## 3.2.3 VAR
  
 /var/log/faillog                   FIPSR /var/log/faillog                   FIPSR
Zeile 1822: Zeile 1835:
 /var/spool/cron/root               FIPSR /var/spool/cron/root               FIPSR
  
-# ################ OTHERS+## 3.2.4 OTHERS
  
 /boot                              NORMAL /boot                              NORMAL
Zeile 1830: Zeile 1843:
 /opt                               NORMAL /opt                               NORMAL
 /root                              NORMAL /root                              NORMAL
-</file>+ 
 + 
 +# 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</file>
  
 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.  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. 
Zeile 2146: Zeile 2170:
 </html> </html>
  
 +=== jounald (tägliche) logs ===
 +In der Konfigurationsdatei **''/etc/aide.conf''** definieren wir für die Speicherung der AIDE-Logs im Jounal:
 +
 +   # vim /etc/aide.conf
 +<code>...
 +
 +# Default
 +log_level=warning
 +report_level=changed_attributes
 +report_url=stdout
 +report_url=syslog:LOG_AUTH
 +
 +...</code>
 +
 +Somit können wir einfach die Logeinträge von AIDE einfach ausgeben.
 +   # journalctl -f /usr/bin/aide
 +++++ Ausgabe der AIDE Logeinträge im Journal |
 +<code>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)
 +
 +</code>
 +++++   
 ===== Orchestrierung - Installation und Konfiguration von AIDE mit Hilfe von Ansible  ===== ===== Orchestrierung - Installation und Konfiguration von AIDE mit Hilfe von Ansible  =====
 ==== Aufgabenstellung ==== ==== Aufgabenstellung ====
Zeile 2270: Zeile 2349:
 ++++ ++++
  
-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 interen Repo-Server wir uns das aide-Paket zum Installieren holen wollen.+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.
    $ vim roles/hids/tasks/install.yml    $ vim roles/hids/tasks/install.yml
 ++++ roles/hids/tasks/install.yml | ++++ roles/hids/tasks/install.yml |
Zeile 2276: Zeile 2355:
 ++++ ++++
  
-Die eigentliche Installation Konfiguration sowie das erstellen der initialen AIDE-Datenbank erfolgt im anschließenden Task **''config''**.+Die eigentliche Installation Konfiguration sowie das erstellen der initialen AIDE-Datenbank erfolgt im anschliessenden Task **''config''**.
    $ vim roles/hids/tasks/config.yml    $ vim roles/hids/tasks/config.yml
 ++++ roles/hids/tasks/config.yml | ++++ roles/hids/tasks/config.yml |
Zeile 2381: Zeile 2460:
 ==== Ergebniskontrolle ==== ==== Ergebniskontrolle ====
 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  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+   # journalctl -f /usr/bin/aide
 <code>Mar 14 14:40:36 pml010070 systemd[1]: Reloading finished in 162 ms. <code>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 every day at 05:51:00.
Zeile 2387: Zeile 2466:
  
 Desweiteren finden wir auch Informationen zum initialen Erstellen der Aide-Datenbank. Desweiteren finden wir auch Informationen zum initialen Erstellen der Aide-Datenbank.
-   # journalctl+   # journalctl -f /usr/bin/aide
 ++++ journal bei Erstellung der initialen Datenbank | ++++ journal bei Erstellung der initialen Datenbank |
 <code>Mar 14 14:43:07 pml010070 aide[94384]: Start timestamp: 2025-03-14 14:40:36 +0100 (AIDE 0.18.8) <code>Mar 14 14:43:07 pml010070 aide[94384]: Start timestamp: 2025-03-14 14:40:36 +0100 (AIDE 0.18.8)
Zeile 2582: Zeile 2661:
 </WRAP> </WRAP>
  
 +====== Links ======
 +  * **[[linux:ansible:detail|zurück zum Kapitel "Ansible - Erweiterte Konfigurationsbeispiele"]] <= **
 +  * **=> [[linux:dhcpd|weiter zum Kapitel "DNS Server für IPv4|6 unter Arch Linux einrichten und nutzen"]] <= **
 +  * **[[linux:start#ansible|Zurück zur "Ansible"-Übersicht]]**
 +  * **[[wiki:start|Zurück zu >>Projekte und Themenkapitel<<]]**
 +  * **[[http://dokuwiki.nausch.org/doku.php/|Zurück zur Startseite]]**
  
  
  • linux/aide.1741963475.txt.gz
  • Zuletzt geändert: 14.03.2025 14:44.
  • von django