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 09:57. ] – [Installation] django | linux:aide [15.03.2025 09:05. ] (aktuell) – [tasks] 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 422: | Zeile 422: | ||
<WRAP center round important 35%> | <WRAP center round important 35%> | ||
- | Bevor das Programm AIDE gestartet werden kann muss es allerdings konfiguriert werden! | + | Bevor das Programm AIDE gestartet werden kann muss es allerdings |
</ | </ | ||
+ | |||
+ | ==== Dokumentation ==== | ||
+ | Die Dokumentation von AIDE findet man in der Datei **[[https:// | ||
+ | |||
+ | === Paketinfo === | ||
+ | Was uns das Paket alles ins System gebracht hat finden wir am einfachsten mit Hilfe von **'' | ||
+ | ++++ Ausgabe der Befehls pacman -Qil aide | | ||
+ | < | ||
+ | Version | ||
+ | Description | ||
+ | Architecture | ||
+ | URL : https:// | ||
+ | Licenses | ||
+ | Groups | ||
+ | Provides | ||
+ | Depends On : acl e2fsprogs | ||
+ | Optional Deps : None | ||
+ | Required By : None | ||
+ | Optional For : None | ||
+ | Conflicts With : None | ||
+ | Replaces | ||
+ | Installed Size : 227.09 KiB | ||
+ | Packager | ||
+ | Build Date : Fri 28 Feb 2025 04:25:53 PM CET | ||
+ | Install Date : Fri 28 Feb 2025 04:26:08 PM CET | ||
+ | Install Reason | ||
+ | Install Script | ||
+ | Validated By : None | ||
+ | |||
+ | aide /etc/ | ||
+ | aide / | ||
+ | aide /usr/ | ||
+ | aide /usr/bin/ | ||
+ | aide / | ||
+ | aide /usr/lib/ | ||
+ | aide / | ||
+ | aide / | ||
+ | aide / | ||
+ | aide / | ||
+ | aide /usr/share/ | ||
+ | aide / | ||
+ | aide / | ||
+ | aide / | ||
+ | aide / | ||
+ | aide / | ||
+ | aide /var/ | ||
+ | aide /var/lib/ | ||
+ | aide / | ||
+ | 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, | ||
+ | |||
+ | ++++ Ausgabe der Befehls aide -v | | ||
+ | # aide -v | ||
+ | < | ||
+ | |||
+ | Compile-time options: | ||
+ | use pcre2: mandatory | ||
+ | use pthread: yes | ||
+ | use zlib compression: | ||
+ | use POSIX ACLs: yes | ||
+ | use SELinux: no | ||
+ | use xattr: yes | ||
+ | use POSIX 1003.1e capabilities: | ||
+ | use e2fsattrs: yes | ||
+ | use cURL: yes | ||
+ | use Mhash: no | ||
+ | use GNU crypto library: yes | ||
+ | use Linux Auditing Framework: no | ||
+ | use locale: no | ||
+ | syslog ident: aide | ||
+ | syslog logopt: LOG_CONS | ||
+ | syslog priority: LOG_NOTICE | ||
+ | default syslog facility: LOG_LOCAL0 | ||
+ | |||
+ | Default config values: | ||
+ | config file: / | ||
+ | database_in: | ||
+ | database_out: | ||
+ | |||
+ | Available compiled-in attributes: | ||
+ | acl: yes | ||
+ | xattrs: yes | ||
+ | selinux: no | ||
+ | e2fsattrs: yes | ||
+ | caps: no | ||
+ | |||
+ | Available hashsum attributes: | ||
+ | md5: yes | ||
+ | sha1: yes | ||
+ | sha256: yes | ||
+ | sha512: yes | ||
+ | rmd160: yes | ||
+ | tiger: yes | ||
+ | crc32: yes | ||
+ | crc32b: no | ||
+ | haval: no | ||
+ | whirlpool: yes | ||
+ | gost: yes | ||
+ | stribog256: yes | ||
+ | stribog512: yes | ||
+ | |||
+ | 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</ | ||
+ | ++++ | ||
+ | |||
+ | === Manpages === | ||
+ | ++++ Manual-Page aide | | ||
+ | # man aide | ||
+ | < | ||
+ | |||
+ | NAME | ||
+ | aide - Advanced Intrusion Detection Environment | ||
+ | |||
+ | SYNOPSIS | ||
+ | aide [parameters] command | ||
+ | |||
+ | DESCRIPTION | ||
+ | AIDE is an intrusion detection system for checking the integrity of files. | ||
+ | |||
+ | COMMANDS | ||
+ | | ||
+ | Checks | ||
+ | to do this. This is also the default command. Without any command | ||
+ | check. | ||
+ | |||
+ | | ||
+ | Initialize | ||
+ | propriate place (see database_in config option) before you can use the --check | ||
+ | command. | ||
+ | |||
+ | | ||
+ | Traverse | ||
+ | stdout. | ||
+ | |||
+ | 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 pa‐ | ||
+ | rameter. | ||
+ | |||
+ | In this mode aide exits with status 0. | ||
+ | |||
+ | | ||
+ | Checks the database and updates the database non-interactively. | ||
+ | output databases must be different. | ||
+ | |||
+ | | ||
+ | Compares | ||
+ | and database_new=< | ||
+ | |||
+ | | ||
+ | Stops after reading in the configuration file. Any errors will be reported. | ||
+ | change | ||
+ | meter. | ||
+ | |||
+ | | ||
+ | Read configuration and match provided file_type and path against rule tree. The | ||
+ | path is independent | ||
+ | solute. See RESTRICTED RULES section in aide.conf (5) for supported file types. | ||
+ | |||
+ | To change the log level in this mode please use the --log-level command line pa‐ | ||
+ | rameter. | ||
+ | |||
+ | 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 a specified limit. | ||
+ | |||
+ | PARAMETERS | ||
+ | | ||
+ | Configuration | ||
+ | value). | ||
+ | |||
+ | | ||
+ | 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 di‐ | ||
+ | | ||
+ | |||
+ | aide --update --limit /etc | ||
+ | |||
+ | | ||
+ | These configparameters are handled before the reading of the configuration file. | ||
+ | See aide.conf (5) for more details on what to put here. | ||
+ | |||
+ | | ||
+ | These configparameters are handled after the reading of the configuration file. | ||
+ | See aide.conf (5) for more details on what to put here. | ||
+ | |||
+ | | ||
+ | The log level to use (see aide.conf (5) for available log levels | ||
+ | tails). | ||
+ | |||
+ | | ||
+ | Removed, | ||
+ | (5) for details). | ||
+ | |||
+ | | ||
+ | Removed, use report_url config option instead (see aide.conf (5) for details). | ||
+ | |||
+ | | ||
+ | Specifies the number of workers (see aide.conf (5) for details). This overwrites | ||
+ | the num_workers value set in any configuration file. | ||
+ | |||
+ | | ||
+ | Print version information and exit. | ||
+ | |||
+ | | ||
+ | Prints out the standard help message. | ||
+ | |||
+ | EXIT STATUS | ||
+ | | ||
+ | pare 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?) | ||
+ | |||
+ | | ||
+ | | ||
+ | 2 = 3. | ||
+ | |||
+ | | ||
+ | |||
+ | 14 Writing error | ||
+ | |||
+ | 15 Invalid argument error | ||
+ | |||
+ | 16 Unimplemented function error | ||
+ | |||
+ | 17 Configuration error | ||
+ | |||
+ | 18 IO error | ||
+ | |||
+ | 19 Version mismatch error | ||
+ | |||
+ | |||
+ | 18 IO error | ||
+ | |||
+ | 19 Version mismatch error | ||
+ | |||
+ | 20 EXEC error | ||
+ | |||
+ | 21 File lock error | ||
+ | |||
+ | 22 Memory allocation error | ||
+ | |||
+ | 23 Thread error | ||
+ | |||
+ | SIGNAL HANDLING | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | NOTES | ||
+ | The checksums in the database and in the output are by default base64 encoded (see also | ||
+ | | ||
+ | |||
+ | echo < | ||
+ | |||
+ | FILES | ||
+ | See --version output for the default config file and the default database_in and data‐ | ||
+ | | ||
+ | |||
+ | SEE ALSO | ||
+ | | ||
+ | |||
+ | BUGS | ||
+ | | ||
+ | | ||
+ | |||
+ | DISCLAIMER | ||
+ | All trademarks are the property of their respective owners. | ||
+ | while making this webpage or this piece of software. Although some pizza delivery guy's | ||
+ | | ||
+ | |||
+ | aide v0.18.8 | ||
+ | </ | ||
+ | |||
+ | ++++ | ||
+ | |||
+ | ++++ Manual-Page aide.conf | | ||
+ | # man aide.conf | ||
+ | < | ||
+ | |||
+ | NAME | ||
+ | | ||
+ | |||
+ | SYNOPSIS | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | FILE FORMAT | ||
+ | | ||
+ | lines must end with new line. | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | There are three types of lines in aide.conf. First there are the configuration | ||
+ | | ||
+ | | ||
+ | | ||
+ | with # are ignored as comments. | ||
+ | |||
+ | CONFIG OPTIONS | ||
+ | These lines have the format parameter=value. See URLS for a list of valid urls. | ||
+ | |||
+ | | ||
+ | | ||
+ | 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: | ||
+ | |||
+ | | ||
+ | |||
+ | Read database locally from / | ||
+ | |||
+ | | ||
+ | |||
+ | Read database from stdin. | ||
+ | |||
+ | | ||
+ | |||
+ | Read database remotely from https:// | ||
+ | |||
+ | | ||
+ | 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. | ||
+ | |||
+ | | ||
+ | The url from which the other database for --compare is read. | ||
+ | |||
+ | | ||
+ | The attributes of the (uncompressed) database files which are to be added to the | ||
+ | reports | ||
+ | supported. To disable set database_attrs to ' | ||
+ | |||
+ | | ||
+ | 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 fu‐ | ||
+ | ture release. | ||
+ | |||
+ | | ||
+ | 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 | ||
+ | option overwrites this option. | ||
+ | |||
+ | The following log levels are available: | ||
+ | |||
+ | | ||
+ | rors are fatal to the AIDE process. | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | info: additionally show informational messages | ||
+ | |||
+ | rule: additionally show messages to help to debug the path rule matching | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | ing | ||
+ | |||
+ | | ||
+ | tion (very verbose) | ||
+ | |||
+ | | ||
+ | cast events) | ||
+ | |||
+ | | ||
+ | loop logging) (even more verbose) | ||
+ | |||
+ | | ||
+ | Removed, use log_level and report_level options instead. | ||
+ | |||
+ | | ||
+ | Whether the output to the database is gzipped or not. This option | ||
+ | only if zlib support is compiled in. | ||
+ | |||
+ | | ||
+ | The prefix | ||
+ | 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. | ||
+ | |||
+ | | ||
+ | Whether to check ACLs for symlinks or not. This option is available only if acl | ||
+ | support is compiled in. | ||
+ | |||
+ | | ||
+ | Whether to warn about dead symlinks or not. | ||
+ | |||
+ | | ||
+ | The value of config_version | ||
+ | database. This is for informational purposes only. It has no other functional‐ | ||
+ | ity. | ||
+ | |||
+ | | ||
+ | Whether | ||
+ | unrestricted rules use 0 (zero) as restriction character. | ||
+ | |||
+ | | ||
+ | Specifies the number of simultaneous workers (threads) for file attribute | ||
+ | cessing (i.a. hashsum calculation). | ||
+ | |||
+ | The number of workers can be a positive integer (e.g. ' | ||
+ | the available processors (e.g. ' | ||
+ | rounded | ||
+ | ers). | ||
+ | |||
+ | If there are multiple num_workers lines then the first one is used. | ||
+ | |||
+ | Use 0 (zero) to disable multi-threading. | ||
+ | |||
+ | The default value 1 (single worker thread) may be changed in a future release. | ||
+ | |||
+ | REPORT OPTIONS | ||
+ | | ||
+ | |||
+ | The URL that the output is written to. | ||
+ | |||
+ | Multiple instances of the report_url option are supported. | ||
+ | |||
+ | Examples: | ||
+ | |||
+ | | ||
+ | |||
+ | Write report to / | ||
+ | |||
+ | | ||
+ | |||
+ | Write report to stdout. | ||
+ | |||
+ | | ||
+ | |||
+ | Write report to syslog using LOG_FACILITY. | ||
+ | |||
+ | The following report options are available (to take effect they have to be set before | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | 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: | ||
+ | |||
+ | list_entries: | ||
+ | |||
+ | changed_attributes: | ||
+ | |||
+ | | ||
+ | |||
+ | File: / | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | and the right column shows the new value (e.g. from the file system). | ||
+ | |||
+ | added_removed_attributes: | ||
+ | tributes | ||
+ | |||
+ | added_removed_entries: | ||
+ | tries | ||
+ | |||
+ | | ||
+ | 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. | ||
+ | |||
+ | | ||
+ | Base16 encode the checksums in the report. The default is to report checksums in | ||
+ | base64 encoding. | ||
+ | |||
+ | | ||
+ | Report | ||
+ | level >= added_removed_entries) in initialization mode. | ||
+ | |||
+ | | ||
+ | Suppress report output if no differences to the database have been found. | ||
+ | |||
+ | | ||
+ | Append to the report URL. | ||
+ | |||
+ | | ||
+ | | ||
+ | Group the files in the report by added, removed and changed files. | ||
+ | |||
+ | | ||
+ | | ||
+ | Summarize changes in the added, removed and changed files sections | ||
+ | port. | ||
+ | |||
+ | The general format is like the string YlZbpugamcinHAXSEC, | ||
+ | the file-type | ||
+ | link, ' | ||
+ | for a unix socket, ' | ||
+ | file type has changed and '?' | ||
+ | |||
+ | The Z is replaced as follows: A ' | ||
+ | reports | ||
+ | the string are the actual letters that will be output | ||
+ | tribute for the item has been changed or a ' | ||
+ | |||
+ | Otherwise | ||
+ | removed, a ':' | ||
+ | tribute has not been checked. | ||
+ | |||
+ | The exceptions to this are: (1) a newly created file replaces each letter with a | ||
+ | ' | ||
+ | |||
+ | The attribute that is associated with each letter is as follows: | ||
+ | |||
+ | o A 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 An 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 A 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 A n means that the link count has changed. | ||
+ | |||
+ | o A H means that one or more message digests have changed. | ||
+ | |||
+ | The following | ||
+ | ure: | ||
+ | |||
+ | o A A means that the access control list has changed. | ||
+ | |||
+ | o A X means that the extended attributes have changed. | ||
+ | |||
+ | o A S means that the SELinux attributes have changed. | ||
+ | |||
+ | o A E means that the file attributes on a second extended file system | ||
+ | | ||
+ | |||
+ | o A C means that the file capabilities have changed. | ||
+ | |||
+ | | ||
+ | | ||
+ | Attributes whose addition is to be ignored in the report. | ||
+ | |||
+ | | ||
+ | | ||
+ | Attributes whose removal is to be ignored in the report. | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | Attributes whose change is to be ignored in the report. | ||
+ | |||
+ | | ||
+ | | ||
+ | Attributes | ||
+ | tribute is both ignored and forced the attribute | ||
+ | change | ||
+ | changed. | ||
+ | |||
+ | | ||
+ | List (no delimiter) of ext2 file attributes which are to be ignored in the re‐ | ||
+ | port. | ||
+ | any attribute. Ignored attributes are represented by a ':' | ||
+ | |||
+ | By default AIDE also reports changes of the read-only | ||
+ | chattr(1) (see example below how to ignore those changes). | ||
+ | |||
+ | Example: | ||
+ | |||
+ | | ||
+ | (N), indexed directory (I) and encrypted (E): | ||
+ | |||
+ | report_ignore_e2fsattrs=VNIE | ||
+ | |||
+ | GROUPS | ||
+ | | ||
+ | |||
+ | Group definitions have the format <group name> = < | ||
+ | |||
+ | Group names are limited to alphanumeric characters (A-Za-z0-9). | ||
+ | |||
+ | See ATTRIBUTES for a description of all available attributes. | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | > | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | v0.16) | ||
+ | |||
+ | | ||
+ | |||
+ | Use 'aide --version' | ||
+ | |||
+ | RULES | ||
+ | AIDE supports three types of rules: | ||
+ | |||
+ | | ||
+ | < | ||
+ | |||
+ | Files and directories matching the regular expression are added to the database. | ||
+ | |||
+ | | ||
+ | !< | ||
+ | |||
+ | Files and directories matching the regular expression are ignored and not added | ||
+ | to the database. | ||
+ | |||
+ | | ||
+ | =< | ||
+ | |||
+ | 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 | ||
+ | "/" | ||
+ | |||
+ | Every regular expression has to start with an explicit "/" | ||
+ | | ||
+ | at the first position against the complete path. Special characters can be escaped us‐ | ||
+ | ing 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 | ||
+ | | ||
+ | |||
+ | See EXAMPLES for examples. | ||
+ | |||
+ | More in-depth discussion of the selection algorithm can be found in the AIDE manual. | ||
+ | |||
+ | RESTRICTED RULES | ||
+ | | ||
+ | AIDE v0.16). The following file types are supported: | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | The syntax of restricted rules is as follows: | ||
+ | |||
+ | | ||
+ | < | ||
+ | |||
+ | | ||
+ | !< | ||
+ | |||
+ | | ||
+ | =< | ||
+ | |||
+ | MACRO LINES | ||
+ | | ||
+ | Define variable VAR to value val. | ||
+ | |||
+ | | ||
+ | Undefine variable VAR. | ||
+ | |||
+ | @@if boolean_expression (added in AIDE v0.18) | ||
+ | | ||
+ | | ||
+ | @@if begins an if statement. It must be terminated with an @@endif | ||
+ | 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 | ||
+ | @@else and @@endif is used. | ||
+ | |||
+ | Available operators and functions in boolean expressions: | ||
+ | |||
+ | not boolean_expression | ||
+ | Evaluates to true if the boolean_expression is false, | ||
+ | boolean_expression is true. | ||
+ | |||
+ | | ||
+ | |||
+ | Evaluates to true if VARIABLE is defined. | ||
+ | |||
+ | | ||
+ | |||
+ | 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 | ||
+ | ' | ||
+ | |||
+ | | ||
+ | |||
+ | Evaluates to true if PATH exists. | ||
+ | |||
+ | | ||
+ | same as @@if defined VARIABLE | ||
+ | |||
+ | | ||
+ | same as @@if not defined VARIABLE | ||
+ | |||
+ | | ||
+ | same as @@if hostname HOSTNAME | ||
+ | |||
+ | | ||
+ | same as @@if not hostname HOSTNAME | ||
+ | |||
+ | | ||
+ | @@{VAR} | ||
+ | defined an empty string is used. | ||
+ | |||
+ | Variables are supported in strings | ||
+ | lines. | ||
+ | |||
+ | Pre-defined marco variables: | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | Include FILE. | ||
+ | The content of the file is used as if it were inserted in this part of the con‐ | ||
+ | fig file. | ||
+ | |||
+ | The maximum depth of nested includes is 16. | ||
+ | |||
+ | | ||
+ | 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 is set, all rules included by the statement | ||
+ | given RULE_PREFIX (added in AIDE v0.18). Prefixes from nested include statements | ||
+ | are concatenated. | ||
+ | |||
+ | The content of the files is used as if it were inserted in this part of the con‐ | ||
+ | fig file. | ||
+ | |||
+ | | ||
+ | | ||
+ | @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. | ||
+ | |||
+ | | ||
+ | |||
+ | Adds the variable | ||
+ | file execution. | ||
+ | |||
+ | Environment variable names are limited to alphanumeric | ||
+ | and the underscore ' | ||
+ | |||
+ | TYPES | ||
+ | bool | ||
+ | Valid values are yes, true, no or false. | ||
+ | |||
+ | | ||
+ | |||
+ | An attribute expression is of the following form: | ||
+ | |||
+ | < | ||
+ | | < | ||
+ | | < | ||
+ | |||
+ | URLS | ||
+ | Urls can be one of the following. Input urls cannot be used as outputs and vice | ||
+ | versa. | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | Input is read from path or output is written to path. | ||
+ | |||
+ | | ||
+ | Input is read from filedescriptor number or output is written to num‐ | ||
+ | ber. | ||
+ | |||
+ | | ||
+ | Output is written to syslog using LOG_FACILITY. | ||
+ | |||
+ | ATTRIBUTES | ||
+ | File attributes | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | selinux attributes (requires libselinux) | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | file attributes | ||
+ | nore_e2fsattrs | ||
+ | |||
+ | | ||
+ | |||
+ | Use 'aide --version' | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | v0.20) | ||
+ | |||
+ | Use growing+s attributes instead | ||
+ | |||
+ | | ||
+ | |||
+ | When I is used, the inode of the old file is used to search for a moved file in | ||
+ | the new database. | ||
+ | |||
+ | Source and target file have to be located in the same directory and must share | ||
+ | the same attributes | ||
+ | compressed). | ||
+ | |||
+ | For moved entries a change of the ctime attribute is ignored. | ||
+ | |||
+ | | ||
+ | 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 | ||
+ | hashsums of the old file | ||
+ | |||
+ | For hashsum attributes the growing attribute is ignored in compare mode. | ||
+ | |||
+ | | ||
+ | ignore compressed file (added in AIDE v0.18) | ||
+ | |||
+ | When compressed | ||
+ | (supported compressions: | ||
+ | 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 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. | ||
+ | |||
+ | | ||
+ | |||
+ | When ' | ||
+ | the report. | ||
+ | |||
+ | | ||
+ | |||
+ | When ' | ||
+ | are ignored in the report. | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | whirlpool checksum | ||
+ | |||
+ | | ||
+ | GOST R 34.11-2012, 256 bit checksum (libgcrypt only, added in AIDE v0.17) | ||
+ | |||
+ | | ||
+ | GOST R 34.11-2012, 512 bit checksum (libgcrypt only, added in AIDE v0.17) | ||
+ | |||
+ | Use 'aide --version' | ||
+ | |||
+ | EXAMPLES | ||
+ | / R This adds all files on your machine to the database. | ||
+ | qualified configuration file. | ||
+ | |||
+ | | ||
+ | |||
+ | =/foo R | ||
+ | Only /foo and /foobar are taken into the database. | ||
+ | added. | ||
+ | |||
+ | | ||
+ | Only /foo and its children (e.g. /foo/file and / | ||
+ | the database. | ||
+ | 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 | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | Check permissions, | ||
+ | |||
+ | Size = s+b | ||
+ | Check size and block count | ||
+ | |||
+ | | ||
+ | | ||
+ | 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 ' | ||
+ | the compiled | ||
+ | catch-all rule at the end of the rule list. | ||
+ | |||
+ | | ||
+ | / | ||
+ | Files that change their mtimes or ctimes but not their contents. | ||
+ | |||
+ | | ||
+ | / | ||
+ | Files that are recreated regularly but do not change their contents | ||
+ | |||
+ | | ||
+ | / | ||
+ | Files that change their contents during system operation | ||
+ | |||
+ | | ||
+ | / | ||
+ | Directories that change their contents during system operation | ||
+ | |||
+ | | ||
+ | / | ||
+ | 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 | ||
+ | | ||
+ | | ||
+ | of their rotation, and finally, they get deleted. | ||
+ | cases without generating reports, and it is still expected to flag the cases when an | ||
+ | | ||
+ | |||
+ | The following examples suggest a way to handle the common case of log rotation with the | ||
+ | | ||
+ | The vast majority of logs are rotated this way on most Linux systems. | ||
+ | |||
+ | | ||
+ | / | ||
+ | An Active Log is typically named foo.log. | ||
+ | The file does neither change its mode nor its inode number. | ||
+ | creases, and what is written to the file is not supposed | ||
+ | During | ||
+ | and the process is instructed to write to a new foo.log. | ||
+ | to a new file (ANF) and will eventually be renamed to foo.log.1 (I). The grow‐ | ||
+ | ing attribute | ||
+ | compared to the database. | ||
+ | |||
+ | | ||
+ | / | ||
+ | foo.log.0 or foo.log.1 is called the Rotated Log, the previously active log re‐ | ||
+ | named to the first name of the Log Series that is formed by the rotation mecha‐ | ||
+ | nism. Right after rotation, the file might still being written to by the dae‐ | ||
+ | mon. To aide, this looks like the Active Log's size decreases and its inode and | ||
+ | timestamps | ||
+ | once the process has stopped writing to it. Reports might be generated if aide | ||
+ | runs while the process still writes to the Rotated Log, but this is quite un‐ | ||
+ | likely to happen. | ||
+ | foo.log.1.gz, | ||
+ | |||
+ | | ||
+ | / | ||
+ | In the next rotation step, foo.log.1 gets compressed to foo.log.2.gz, | ||
+ | the Compressed Log in the Log Series. | ||
+ | step because it uncompresses the contents of the file and takes the checksum | ||
+ | the uncompressed | ||
+ | tribute changes are ignored (compressed). | ||
+ | |||
+ | | ||
+ | / | ||
+ | In the next log rotation, all foo.log.{x} get renamed | ||
+ | other attributes are not supposed to change. | ||
+ | |||
+ | | ||
+ | / | ||
+ | The configuration of the log rotation process specifies a number of log genera‐ | ||
+ | tions to keep. The last log in the series is therefore | ||
+ | (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 | ||
+ | method to cater for data protection regulation. | ||
+ | ries are identical, breaking the heuristics that aide uses to detect log rota‐ | ||
+ | tion. A possible workaround is to begin a newly rotated log with a timestamp. | ||
+ | With logrotate, this can be done in a postrotate scriptlet. | ||
+ | |||
+ | | ||
+ | With logrotate' | ||
+ | renaming it from the Active Log name. For the time being, it is recommended | ||
+ | always use the delaycompress option to avoid this behavior. | ||
+ | |||
+ | | ||
+ | tions to keep. The last log in the series is therefore | ||
+ | (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 | ||
+ | method to cater for data protection regulation. | ||
+ | ries are identical, breaking the heuristics that aide uses to detect log rota‐ | ||
+ | tion. A possible workaround is to begin a newly rotated log with a timestamp. | ||
+ | With logrotate, this can be done in a postrotate scriptlet. | ||
+ | |||
+ | | ||
+ | With logrotate' | ||
+ | renaming it from the Active Log name. For the time being, it is recommended | ||
+ | always use the delaycompress option to avoid this behavior. | ||
+ | |||
+ | | ||
+ | With logrotate' | ||
+ | created 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 al‐ | ||
+ | ready open file handle. | ||
+ | process. | ||
+ | Active Log. For the time being, it is recommended to avoid the copytruncate op‐ | ||
+ | tion 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 | ||
+ | | ||
+ | |||
+ | DISCLAIMER | ||
+ | | ||
+ | while making this webpage or this piece of software. | ||
+ | |||
+ | aide v0.18.8 | ||
+ | ++++ | ||
+ | |||
+ | ==== Konfiguration ==== | ||
+ | Die Konfiguration wird über die Dateien **''/ | ||
+ | # cp -av / | ||
+ | |||
+ | So können wir später leichter Änderungen mit Hilfe von **'' | ||
+ | |||
+ | Anpassungen und Änderungen an der Konfiguration nehmen mit mit dem Editor unserer Wahl , wie z.B. **'' | ||
+ | # sudo vim / | ||
+ | |||
+ | <file bash / | ||
+ | # More information about configuration options available in the aide.conf manpage. | ||
+ | # Inspired from https:// | ||
+ | |||
+ | # ┌───────────────────────────────────────────────────────────────┐ | ||
+ | # │ CONTENTS OF aide.conf | ||
+ | # ├───────────────────────────────────────────────────────────────┘ | ||
+ | # │ | ||
+ | # ├──┐VARIABLES | ||
+ | # │ ├── DATABASE | ||
+ | # │ └── REPORT | ||
+ | # ├──┐RULES | ||
+ | # │ ├── LIST OF ATTRIBUTES | ||
+ | # │ ├── LIST OF CHECKSUMS | ||
+ | # │ └── AVAILABLE RULES | ||
+ | # ├──┐PATHS | ||
+ | # │ ├──┐EXCLUDED | ||
+ | # │ │ ├── ETC | ||
+ | # │ │ ├── USR | ||
+ | # │ │ └── VAR | ||
+ | # │ └──┐INCLUDED | ||
+ | # │ | ||
+ | # │ | ||
+ | # │ | ||
+ | # │ | ||
+ | # │ | ||
+ | # └─────────────────────────────────────────────────────────────── | ||
+ | |||
+ | # ################################################################ | ||
+ | |||
+ | # ################################ | ||
+ | |||
+ | @@define DBDIR / | ||
+ | @@define LOGDIR / | ||
+ | |||
+ | # The location of the database to be read. | ||
+ | database_in=file: | ||
+ | |||
+ | # The location of the database to be written. | ||
+ | # | ||
+ | # | ||
+ | database_out=file: | ||
+ | |||
+ | # Whether to gzip the output to database | ||
+ | gzip_dbout=yes | ||
+ | |||
+ | # ################################ | ||
+ | |||
+ | # Default. | ||
+ | log_level=warning | ||
+ | report_level=changed_attributes | ||
+ | |||
+ | report_url=file: | ||
+ | report_url=stdout | ||
+ | # | ||
+ | #NOT IMPLEMENTED report_url=mailto: | ||
+ | #NOT IMPLEMENTED report_url=syslog: | ||
+ | |||
+ | # ################################################################ | ||
+ | |||
+ | # ################################ | ||
+ | |||
+ | # These are the default parameters we can check against. | ||
+ | #p: | ||
+ | #i: | ||
+ | #n: | ||
+ | #u: user | ||
+ | #g: group | ||
+ | #s: size | ||
+ | #b: block count | ||
+ | #m: mtime | ||
+ | #a: atime | ||
+ | #c: ctime | ||
+ | #S: check for growing size | ||
+ | #acl: | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # ################################ | ||
+ | |||
+ | #md5: md5 checksum | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # ################################ | ||
+ | |||
+ | # These are the default rules | ||
+ | #R: | ||
+ | #L: | ||
+ | #E: Empty group | ||
+ | #>: | ||
+ | |||
+ | # 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 = R+ALLXTRAHASHES | ||
+ | |||
+ | # 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, | ||
+ | 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, | ||
+ | # but we want to know when the data inside them changes | ||
+ | DATAONLY = p+n+u+g+s+acl+xattrs+sha256 | ||
+ | |||
+ | # ################################################################ | ||
+ | |||
+ | # Next decide what directories/ | ||
+ | |||
+ | # ################################ | ||
+ | |||
+ | # ################ | ||
+ | |||
+ | # Ignore backup files | ||
+ | !/etc/.*~ | ||
+ | |||
+ | # Ignore mtab | ||
+ | !/etc/mtab | ||
+ | |||
+ | # ################ | ||
+ | |||
+ | # These are too volatile | ||
+ | !/usr/src | ||
+ | !/usr/tmp | ||
+ | |||
+ | # ################ | ||
+ | |||
+ | # Ignore logs | ||
+ | !/ | ||
+ | !/ | ||
+ | !/ | ||
+ | !/ | ||
+ | !/ | ||
+ | !/ | ||
+ | |||
+ | # ################################ | ||
+ | |||
+ | # ################ | ||
+ | |||
+ | # Check only permissions, | ||
+ | /etc PERMS | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | # ################ | ||
+ | |||
+ | /usr | ||
+ | / | ||
+ | |||
+ | # ################ | ||
+ | |||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | # ################ | ||
+ | |||
+ | /boot NORMAL | ||
+ | /bin | ||
+ | /lib | ||
+ | / | ||
+ | /opt | ||
+ | /root NORMAL | ||
+ | </ | ||
+ | |||
+ | Wie eigentlich immer bei der Konfiguration von neuen Programmen lohnt es sich die zugehörige Konfigurationsdatei - in unserem Falle von **AIDE** die **''/ | ||
+ | |||
+ | * Die ersten Einstellungen die man sich überlegen sollte, wären wo die Datenbanken erstellt und vorgehalten werden sollen und ob diese gepackt werden sollen. | ||
+ | * Anschließend sollte man sich Gedanken machen, welche Hashingalgorithmen verwendet werden sollen. In den Standardeinstellungen bildet AIDE sieben verschiedene Checksummen 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 solten 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 individiuelle 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, | ||
+ | * 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 (Die Verwendung von sha256 oder sha512 ist hier empfohlen.) | ||
+ | * sha1: sha1 Prüfsumme (Die Verwendung von sha256 oder sha512 ist hier empfohlen.) | ||
+ | * sha256: sha256 Prüfsumme | ||
+ | * sha512: sha512 Prüfsumme | ||
+ | * rmd160: rmd160 Prüfsumme | ||
+ | * tiger: tiger Prüfsumme | ||
+ | * haval: haval Prüfsumme (MHASH only) | ||
+ | * gost: gost Prüfsumme (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 Verzeichniss ggf. ausgenommen werden sollen und welche Dateien und Verzeichnisse man in welcher Tiefe überwachen möchte. Die manpage zu **'' | ||
+ | |||
+ | Ist man mit der Konfiguration von **AIDE** soweit zufrieden und fertig, ist man gut beraten mit Hilfe der Option **'' | ||
+ | # 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 --help | ||
+ | < | ||
+ | |||
+ | 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 | ||
+ | |||
+ | Miscellaneous: | ||
+ | -D, | ||
+ | -p FILE_TYPE: | ||
+ | -v, | ||
+ | -h, | ||
+ | |||
+ | Options: | ||
+ | -c CFGFILE --config=CFGFILE Get config options from CFGFILE | ||
+ | -l REGEX --limit=REGEX Limit command to entries matching REGEX | ||
+ | -B " | ||
+ | -A " | ||
+ | -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) | ||
+ | </ | ||
+ | |||
+ | === Datenbank erstellen === | ||
+ | Zunächst erstellen wir initial unsere AIDE Datenbank entsprechend unserer [[# | ||
+ | [django@pml010074 ~]$ sudo aide --init | ||
+ | |||
+ | < | ||
+ | AIDE successfully initialized database. | ||
+ | New AIDE database written to / | ||
+ | |||
+ | Number of entries: | ||
+ | |||
+ | --------------------------------------------------- | ||
+ | The attributes of the (uncompressed) database(s): | ||
+ | --------------------------------------------------- | ||
+ | |||
+ | / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | / | ||
+ | |||
+ | |||
+ | End timestamp: 2025-02-09 13:22:34 +0100 (run time: 4m 39s) | ||
+ | </ | ||
+ | |||
+ | === positive Prüfen des Filesystems gegen die Datenbank === | ||
+ | Mit der Option **'' | ||
+ | [django@pml010074 ~]$ sudo aide --check | ||
+ | < | ||
+ | AIDE found NO differences between database and filesystem. Looks okay!! | ||
+ | |||
+ | Number of entries: | ||
+ | |||
+ | --------------------------------------------------- | ||
+ | The attributes of the (uncompressed) database(s): | ||
+ | --------------------------------------------------- | ||
+ | |||
+ | / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | End timestamp: 2025-02-09 16:53:10 +0100 (run time: 5m 40s) | ||
+ | </ | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | Führen wir erneut eine Überprüfung unseres Systems aus, sollte die neue unbekannte Datei entsprechend detektiert werden. | ||
+ | [django@pml010074 ~]$ sudo aide --check | ||
+ | |||
+ | < | ||
+ | AIDE found differences between database and filesystem!! | ||
+ | |||
+ | Summary: | ||
+ | Total number of entries: | ||
+ | Added entries: 1 | ||
+ | Removed entries: 1 | ||
+ | Changed entries: 5 | ||
+ | |||
+ | --------------------------------------------------- | ||
+ | Added entries: | ||
+ | --------------------------------------------------- | ||
+ | |||
+ | f+++++++++++++++: | ||
+ | |||
+ | --------------------------------------------------- | ||
+ | Removed entries: | ||
+ | --------------------------------------------------- | ||
+ | |||
+ | f---------------: | ||
+ | |||
+ | --------------------------------------------------- | ||
+ | Changed entries: | ||
+ | --------------------------------------------------- | ||
+ | |||
+ | d = ... mc.. : /root | ||
+ | d < ... mc.. : / | ||
+ | f > ... mci.H : / | ||
+ | f < ... mci.H : / | ||
+ | d > ... mc.. : /usr/bin | ||
+ | |||
+ | --------------------------------------------------- | ||
+ | Detailed information about changes: | ||
+ | --------------------------------------------------- | ||
+ | |||
+ | Directory: /root | ||
+ | | ||
+ | | ||
+ | |||
+ | Directory: / | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | File: / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | File: / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Directory: /usr/bin | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | --------------------------------------------------- | ||
+ | The attributes of the (uncompressed) database(s): | ||
+ | --------------------------------------------------- | ||
+ | |||
+ | / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | End timestamp: 2025-02-09 18:15:03 +0100 (run time: 5m 51s) | ||
+ | </ | ||
+ | |||
+ | In der Zusammenfassung sehen wir also in Summe 470.065 Datenbankeinträge, | ||
+ | Total number of entries: | ||
+ | Added entries: | ||
+ | Removed entries: 1 | ||
+ | Changed entries: 5 | ||
+ | |||
+ | Die Datei **''/ | ||
+ | |||
+ | Im Abschnitt **'' | ||
+ | < | ||
+ | d < ... mc.. : / | ||
+ | f > ... mci.H : / | ||
+ | f < ... mci.H : / | ||
+ | d > ... mc.. : / | ||
+ | * In der ersten Spalte kennzeichnet ein **'' | ||
+ | * In der zweiten Spalte wird eine Änderung angezeigt, ob sich die Grösse einer Datei bzw. des Verzeichnisses geändert hat. **'' | ||
+ | * Die mit jedem Buchstaben verbundenen Attribute sind wie folgt: | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * Die folgenden Buchstaben sind nur verfügbar, wenn sie explizit mit „configure“ aktiviert werden: | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | |||
+ | Im Abschnitt **'' | ||
+ | |||
+ | === Update Database === | ||
+ | Nach Änderungen am System, z.B. bei Konfigurationsänderungen, | ||
+ | $ sudo aide --update | ||
+ | |||
+ | Alternativ kann man auch direkt die Datenbank neu initialisieren: | ||
+ | $ sudo aide --init | ||
+ | |||
+ | **'' | ||
+ | |||
+ | Ein anderer Ansatz wäre dann ein **'' | ||
+ | |||
+ | === tägliche checks enablen === | ||
+ | Wiederkehrende | ||
+ | |||
+ | [django@pml010074 ~] $ sudo systemctl enable --now aidecheck.timer | ||
+ | |||
+ | Created symlink '/ | ||
+ | |||
+ | Den Status können wir wie gewohnt via **'' | ||
+ | [django@pml010074 ~] $ sudo systemctl status aidecheck.timer | ||
+ | < | ||
+ | <font style=" | ||
+ | | ||
+ | | ||
+ | | ||
+ | Trigger: Mon 2025-02-10 05:00:00 CET; 14h left | ||
+ | | ||
+ | |||
+ | Feb 09 13:47:17 pml010074 systemd[1]: Started Aide check every day at 5AM.</ | ||
+ | </ | ||
+ | |||
+ | === 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 | ||
+ | ==== 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: | ||
+ | |||
+ | 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. | ||
+ | |||
+ | ==== Lösung ==== | ||
+ | |||
+ | <WRAP center round tip 80%> | ||
+ | Der ungeduldigen Leser kann auch direkt zur Tat schreiten und das manuelle Anlegen der Inventory-Hülle, | ||
+ | |||
+ | < | ||
+ | -O - | tar -xz --strip-components=1 -C ~/ | ||
+ | |||
+ | Nach Anpassung der Daten im Inventory kann man anschliessend direkt **[[# | ||
+ | </ | ||
+ | |||
+ | === Vorbereitung - Daten im Inventory === | ||
+ | Bei unserem Konfigurationsbeispiel hier gehen wir von folgenden Parametern aus: | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | |||
+ | Die Konfigurationsdatei unseres **inventory** in unsere, Ansible-Verzeichnis beinhaltet demnach unter anderem: | ||
+ | $ vim inventories/ | ||
+ | ++++ inventories/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | |||
+ | Für alle Host aus der Gruppe **'' | ||
+ | $ vim inventories/ | ||
+ | ++++ inventories/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | |||
+ | Die beiden Beispiel-Hosts aus der Gruppe|Zone **'' | ||
+ | * Der Host **'' | ||
+ | * Der Host **'' | ||
+ | |||
+ | Wir legen uns also nun die Definitionsdateien für die beiden Hosts im SOHO an. | ||
+ | $ vim inventories/ | ||
+ | ++++ inventories/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | |||
+ | $ vim inventories/ | ||
+ | ++++ inventories/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | |||
+ | Unser Beispiels-Inventory hat also nunmehr folgenden Aufbau: | ||
+ | < | ||
+ | ├── group_vars | ||
+ | │ └── arch | ||
+ | │ | ||
+ | ├── hosts | ||
+ | └── hosts_vars | ||
+ | ├── pml010070 | ||
+ | └── 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:// | ||
+ | ++++ | ||
+ | |||
+ | Die Installation von AIDE wird in der ersten Task-Gruppe mit dem tag **'' | ||
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{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:// | ||
+ | ++++ | ||
+ | |||
+ | == templates == | ||
+ | Für die Erstellung der AIDE-Konfigurationsdatei **''/ | ||
+ | |||
+ | <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-/ | ||
+ | </ | ||
+ | |||
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | |||
+ | $ vim roles/ | ||
+ | ++++ roles/ | ||
+ | {{gh> https:// | ||
+ | ++++ | ||
+ | |||
+ | == 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:// | ||
+ | |||
+ |