AIDE.CONF(5)
π NAME π
okay bestie, this is the AIDE.CONF(5) page, and it's all about aide.conf β The configuration file for Advanced Intrusion Detection Environment. π«Ά
β¨ SYNOPSIS β¨
So like, aide.conf is the configuration file for Advanced Intrusion Detection Environment. It contains the runtime configuration AIDE uses to initialize or check the AIDE database. No cap. π
π¦ FILE FORMAT π¦
aide.conf is case-sensitive. Leading and trailing white spaces are ignored. Each config line must end with new line.
AIDE uses the backslash character (\) as escape character for ' ' (space), '@' and '\' (backslash) (e.g. '\ ' or '\@'). To literally match a '\' in a file path with a regular expression you have to escape the backslash twice (i.e. '\\\\'). π
There are three types of lines in aide.conf. First there are the configuration options which are used to set configuration parameters and define groups. Second, there are (restricted) rules that are used to indicate which files/directories from the file system are added to the database. Third, macro lines define or undefine variables within the config file. Lines beginning with # are ignored as comments.
π CONFIG OPTIONS π
These lines have the format parameter=value. See URLS for a list of valid urls. β¨
database_in(type: URL, default: see--versionoutput, added in AIDE v0.17) β The url from which database is read. There can only be one of these lines. If there are multipledatabaselines then the first is used.database(REMOVED in AIDE v0.19) β The url from which database is read. There can only be one of these lines. If there are multipledatabaselines then the first is used.
Examples:
database_in=file:/var/lib/aide/aide.dbβ Read database locally from/var/lib/aide/aide.db.database_in=stdinβ Read database from stdin.database_in=https://example.com/aide.dbβ Read database remotely fromhttps://example.com/aide.db.
database_out(type: URL, default: see--versionoutput) β The url to which the new database is written to. There can only be one of these lines. If there are multipledatabase_outlines then the first is used.database_new(type: URL, default:<none>) β The url from which the other database for--compareis read.database_attrs(type: attribute expression, default:H, added in AIDE v0.16) β The attributes of the (uncompressed) database files which are to be added to the reports in report level >=database_attributes. Only checksum attributes are supported. To disable setdatabase_attrsto'E'.database_add_metadata(type: bool, default:true, added in AIDE v0.16) β Whether to add the AIDE version and the time of database generation as comments to the database file or not. This option may be set tofalseby default in a future release.log_level(type: log level, default:warning, added in AIDE v0.17) β The log level to use. Log messages are written tostderr. If there are multiplelog_levellines then the first one is used. The--log-levelor-Lcommand line option overwrites this option.
The following log levels are available:
errorβ show unrecoverable issues that have to be handled by the user. Errors are fatal to the AIDE process.warningβ additionally show recoverable issues that most likely lead to unexpected behaviour and should be handled by the usernoticeβ additionally show recoverable issues that sometimes lead to unexpected behaviour and might be handled by the user.infoβ additionally show informational messagescompareβ additionally show messages to help to debug file comparison and (special) attribute handling
The log levels below are very verbose and can easily generate multiple gigabytes of log data (depending on the number of processed files and the size of the rule tree). For debugging it is recommended to use these log levels together with the--limitparameter (seeaide (1)for details).
ruleβ additionally show messages to help to debug the path rule matchingconfigβ additionally show messages to help to debug config and rule parsingdebugβ additionally show messages that are useful to debug the applicationlimitβ additionally show messages about skipped entries due to limit matchthreadβ additionally show messages about thread processing (e.g. broadcast events)traceβ additionally show messages about the internal data structures and the flow of the application (e.g. in-loop logging) (extremely verbose)
verbose(type: number, range:0 - 255, default:5, REMOVED in AIDE v0.17) β Removed, uselog_levelandreport_leveloptions instead.gzip_dbout(type: bool, default:false) β Whether the output to the database is gzipped or not. This option is available only if zlib support is compiled in.root_prefix(type: path, default:<empty>, added in AIDE v0.16) β The prefix to strip from each file name in the file system before applying the rules and writing to database. AIDE removes a trailing slash from the prefix. If there are multipleroot_prefixlines then the first one is used. This option has no effect in compare mode.acl_no_symlink_follow(type: bool, default:false) β Whether to check ACLs for symlinks or not. This option is available only if acl support is compiled in.warn_dead_symlinks(type: path, default:false) β Whether to warn about dead symlinks or not.config_version(type: string, default:<empty>) β The value ofconfig_versionis printed in the report and also printed to the database. This is for informational purposes only. It has no other functionality.config_check_warn_unrestricted_rules(type: bool, default:false, added in AIDE v0.18) β Whether to warn on unrestricted rules during config check. To explicitly define unrestricted rules use0(zero) as restriction character.num_workers(type:number|percentage, default:1, added in AIDE v0.18) β Specifies the number of simultaneous workers (threads) for file attribute processing (i.a. hashsum calculation).
The number of workers can be a positive integer (e.g. '4') or the percentage of the available processors (e.g. '60%'). The resulting number of workers is rounded up to the next integer (e.g. '60%' of 8 processors results in 5 workers).
If there are multiple num_workers lines then the first one is used.
Use 0 (zero) to disable (multi-threaded) workers.
The default value 1 (single worker thread) may be changed in a future release.
π REPORT OPTIONS π
report_url
(type: URL, default: stdout) β¨
The URL that the output gets written to. That's it, that's the vibe. π
Not me telling you that you can have multiple instances of the report_url option living together btw β yes bestie, more than one, they're poly. π«Ά
Examples, because we love a demo:
report_url=file:/var/log/aide.log
Write report to /var/log/aide.log.
report_url=stdout
Write report to stdout.
report_url=syslog:<LOG_FACILITY>
Write report to syslog using LOG_FACILITY.
Okay so the following report options are available β and heads up, to take effect they have to be set before report_url. Order matters, it's giving first-come-first-served. π
report_level
(type: report level, default: changed_attributes, added in AIDE v0.17)
The report level to use. The available report levels are as follows, and they stack up like a lil staircase of info: πͺ
minimalβ print a single line saying whether AIDE found differences to the database or not.summaryβ additionally print number of added, removed and changed files.database_attributesβ additionally print database checksums.list_entriesβ additionally print lists of added, removed and changed entries.changed_attributesβ additionally print details about changed entries.
Example:
File: /var/lib/apt/extended_states
Perm : -rw-r--r-- | -rw-------
Uid : 0 | 106
The left column shows the old value (e.g. from the database_in database) and the right column shows the new value (e.g. from the file system). Old on the left, glow-up on the right. π«
added_removed_attributesβ additionally print details about added and removed attributes.added_removed_entriesβ additionally print details about added and removed entries.
report_format
(type: report format, default: plain, added in AIDE v0.18)
The report format to use. The available report formats are as follows:
plainβ Print report in plain human-readable format.jsonβ Print report in json machine-readable format.
report_base16
(type: bool, default: false, added in AIDE v0.17)
Base16 encode the checksums in the report. The default is to report checksums in base64 encoding. Pick your encoding, queen. π‘
report_detailed_init
(type: bool, default: false, added in AIDE v0.16)
Report added files (report level >= list_entries) and their details (report level >= added_removed_entries) in initialization mode.
report_quiet
(type: bool, default: false, added in AIDE v0.16)
Suppress report output if no differences to the database have been found. Silence is golden, and honestly iconic. π€«
report_append
(type: bool, default: false, added in AIDE v0.17)
Append to the report URL.
report_grouped
(type: bool, default: true, added in AIDE v0.17) grouped (REMOVED in AIDE v0.19)
Group the files in the report by added, removed and changed files.
report_summarize_changes
(type: bool, default: true, added in AIDE v0.17) summarize_changes (REMOVED in AIDE v0.19)
Summarize changes in the added, removed and changed files sections of the report. Okay bestie this one is a whole β¨languageβ¨ so let's go:
The general format is like the string YlZbpugamcinHAXSECF, where Y is replaced by the file-type:
'f'for a regular file'd'for a directory'l'for a symbolic link'c'for a character device'b'for a block device'p'for a FIFO's'for a unix socket'D'for a Solaris door'P'for a Solaris event port'!'if file type has changed'?'otherwise
The Z is replaced as follows: a '=' means that the size has not changed, a '<' reports a shrinked size and a '>' reports a grown size. The other letters in the string are the actual letters that will be output if the associated attribute for the item has been changed or a '.' for no change.
Otherwise a '+' is shown if the attribute has been added, a '-' if it has been removed, a ':' if the attribute is ignored (but not forced) or a ' ' if the attribute has not been checked.
The exceptions to this are: (1) a newly created file replaces each letter with a '+', and (2) a removed file replaces each letter with a '-'.
The attribute that is associated with each letter is as follows:
- An
lmeans that the link name has changed. - A
bmeans that the block count has changed. - A
pmeans that the permissions have changed. - A
umeans that the uid has changed. - A
gmeans that the gid has changed. - An
ameans that the access time has changed. - An
mmeans that the modification time has changed. - A
cmeans that the change time has changed. - An
imeans that the inode has changed. - An
nmeans that the link count has changed. - An
Hmeans that one or more message digests have changed. - An
Fmeans that one file system type has changed (Linux only).
The following letters are only available when explicitly enabled using configure:
- An
Ameans that the access control list has changed. - An
Xmeans that the extended attributes have changed. - An
Smeans that the SELinux attributes have changed. - An
Emeans that the file attributes on a second extended file system have changed. - A
Cmeans that the file capabilities have changed.
report_ignore_added_attrs
(type: attribute expression, default: empty, added in AIDE v0.16)
Attributes whose addition is to be ignored in the report.
report_ignore_removed_attrs
(type: attribute expression, default: empty, added in AIDE v0.16)
Attributes whose removal is to be ignored in the report.
report_ignore_changed_attrs
(type: attribute expression, default: empty, added in AIDE v0.16) ignore_list (REMOVED in AIDE v0.17)
Attributes whose change is to be ignored in the report.
report_force_attrs
(type: attribute expression, default: empty, added in AIDE v0.16) report_attributes (REMOVED in AIDE v0.17)
Attributes which are always printed in the report for changed files. If an attribute is both ignored and forced the attribute is not considered for file change but printed in the final report as long as the file has been otherwise changed. Yeah, ignored and forced at the same time β the drama, but that's literally what the rule says. π
report_ignore_e2fsattrs
(type: string, default: 0, added in AIDE v0.16)
List (no delimiter) of ext2 file attributes which are to be ignored in the report. See chattr(1) for the available attributes. Use 0 (zero) to not ignore any attribute. Ignored attributes are represented by a ':' in the report.
By default AIDE also reports changes of the read-only attributes mentioned in chattr(1) (see example below how to ignore those changes).
Example:
Ignore changes of the read-only ext2 file attributes verify (V), inline data (N), indexed directory (I) and encrypted (E):
report_ignore_e2fsattrs=VNIE
π GROUPS π
Groups are aggregations of attributes. A lil squad of attributes, if you will. π«
Group definitions have the format <group name> = <attribute expression>.
Group names are limited to alphanumeric characters (A-Za-z0-9). That's the whole guest list, no specials allowed. π«
See ATTRIBUTES for a description of all available attributes.
Default groups
Rβp+ftype+i+l+n+u+g+s+m+c+sha3_256+XLβp+ftype+i+l+n+u+g+X>β Growing filep+ftype+l+u+g+i+n+s+growing+XHβ all compiled in (and not deprecated) hashsums (added in AIDE v0.17)Xβacl+selinux+xattrs+e2fsattrs+caps(if attributes are compiled in, added in AIDE v0.16)Eβ Empty group
Use aide --version to list the default compound groups. π
β RULES β
AIDE supports three types of rules:
Regular rule:
<regex> <attribute expression>
Files and directories matching the regular expression are added to the database.
Recursive negative rule:
!<regex>
Files and directories matching the regular expression are excluded and NOT added to the database. The children of directories and sub-directories are recursed into and only not added to the database if they also match the regular expression.
Non-recursive negative rule (added in AIDE v0.19)
-<regex>
Files and directories matching the regular expression are excluded and NOT added the database. The children of directories and sub-directories are not recursed into and hence not added to the database by any means.
Equals rule:
=<regex> <attribute expression>
Files and directories matching the regular expression are added to the database. The children of directories are only added if the regular expression ends with a /. The children of sub-directories are not added to the database.
Every regular expression has to start with an explicit /. An implicit ^ is added in front of each regular expression. In other words, the regular expressions are matched at the first position against the complete path. Special characters can be escaped using two-digit URL encoding (for example, %20 to represent a space). π
AIDE uses a deepest-match algorithm to find the tree node to search, but a first-match algorithm inside the node. (see also rule log level).
See EXAMPLES for examples.
More in-depth discussion of the selection algorithm can be found in the AIDE manual.
π RESTRICTED RULES π
okay so restricted rules? bestie, they're literally just regular rules but with a lil β¨filterβ¨ on top β you can lock them down by file type (that's been a thing since AIDE v0.16) and/or by file system type (added in AIDE v0.19, and heads up: Linux only π ).
Here's how you write each flavor:
Restricted regular rule
<regex> <restriction expression> <attribute expression>
Anything matching BOTH the regular expression AND the restriction expression gets added to the database. Both, babe β it's an and situation, no cap.
Restricted recursive negative rule
!<regex> <restriction expression>
Files and dirs matching both get excluded and NOT added to the database. But and this is the important part β the children of those directories and sub-directories are recursed into, and each one is only excluded if it also matches the regular expression as well as the restriction. So the exclusion re-checks every child individually π«Ά
Restricted non-recursive negative rule (added in AIDE v0.19)
-<regex> <restriction expression>
Same exclusion energy, matching files and dirs get excluded and NOT added to the database. BUT the children of those directories and sub-directories are not recursed into at all, so they don't get added by any means. the whole subtree just goes poof, periodt π
Restricted equals rule
=<regex> <restriction expression> <attribute expression>
Files and dirs matching both get added to the database. The children of directories are only added if the regular expression ends with a /. And the children of sub-directories are not added to the database at all, fr fr.
Restriction expression
A restriction expression is formatted like this:
<restriction expression>: <file types>
| =<file system type>
| <file types>=<file system type>
πΈ File types πΈ
These are the file types you can restrict a rule to:
fβ restrict rule to regular filesdβ restrict rule to directorieslβ restrict rule to symbolic linkscβ restrict rule to character devicesbβ restrict rule to block devicespβ restrict rule to FIFO filessβ restrict rule to UNIX socketsDβ restrict rule to Solaris doorsPβ restrict rule to Solaris event ports
You can stack multiple file type restrictions by making a comma-separated list π
π File system types (Linux only) π
You can specify the file system type restriction either by its magic number (like '0x01021994' for tmpfs) or by its name β run aide --version to list all the available file system type names. The magic number has to start with '0x' and be formatted in hexadecimal format, bestie, don't skip that part.
Empty restriction
To explicitly not restrict a rule, just use 0 (added in AIDE v0.18). Sometimes you just wanna say "no filter today" π
Examples
/ d,f R
Only add directories and files to the database.
/boot/efi$ d=vfat R
Only add /boot/efi to the database if it is a directory and mounted on vfat.
!/dev =0x01021994
Exclude /dev and any children that are mounted on tmpfs (tmpfs magic number: 0x01021994).
-/dev =tmpfs
Exclude /dev and all children, if /dev is mounted on tmpfs.
β¨ MACRO LINES β¨
@@define VAR valβ Define variable VAR to value val.@@undef VARβ Undefine variable VAR.@@if boolean_expression(added in AIDE v0.18),@@else,@@endifβ@@ifopens an if statement and it must be closed with an@@endifstatement, okay? The lines between@@ifand@@endifget used when the boolean_expression evaluates to true. If there's an@@elsein there, then the chunk between@@ifand@@elseis used when boolean_expression is true, otherwise the chunk between@@elseand@@endifis used. Choose your fighter π
The operators and functions you can use in boolean expressions:
not boolean_expressionβ evaluates to true if the boolean_expression is false, and false if the boolean_expression is true. yes, it's exactly that.defined VARIABLEβ evaluates to true if VARIABLE is defined.hostname HOSTNAMEβ evaluates to true if HOSTNAME equals the hostname of the machine that AIDE is running on. Note that hostname here is the name of the host without the domainname (ie'hostname', not'hostname.example.com').exists PATHβ evaluates to true if PATH exists.VERSION_STRING1 version_ge VERSION_STRING2(added in AIDE v0.19) β evaluates to true if VERSION_STRING1 is greater than or equal to VERSION_STRING2 (e.g.0.19.1 version_ge 0.18evaluates to true and2.17 version_ge 1.1to false). The version strings must be in the formatMAJOR.MINOR.PATCH(minor and patch version can be omitted, and any version suffix β like for pre-release β will be truncated).
@@ifdef VARIABLE(DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20) β same as@@if defined VARIABLE.@@ifndef VARIABLE(DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20) β same as@@if not defined VARIABLE.@@ifhost HOSTNAME(DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20) β same as@@if hostname HOSTNAME.@@ifnhost HOSTNAME(DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20) β same as@@if not hostname HOSTNAME.
bestie these four are on their way out π deprecated since v0.18 and getting removed in v0.20, so maybe don't build your whole config on them, iykyk
@@{VAR}β@@{VAR}gets replaced with the value of the variable VAR. And if the variable VAR isn't defined? you get an empty string, no drama.
Variables are supported in strings and in regular expressions of rules π
Pre-defined marco variables:
@@{AIDE_VERSION}: the version of AIDE@@{HOSTNAME}: the hostname of the current system
@@include FILEβ Include FILE.
The content of the file is used as if it were inserted right here in this part of the config file.
The maximum depth of nested includes is 16. so yes, you can go absolutely feral with your nesting, but only 16 levels deep π
@@include DIRECTORY REGEX [RULE_PREFIX](added in AIDE v0.17) β Include all (regular) files found in DIRECTORY matching regular expression REGEX (sub-directories are ignored, sad but true). The files are included in lexical sort order.
If RULE_PREFIX (added in AIDE v0.18) is set, all rules included by the statement are prefixed with the given RULE_PREFIX. And heads up β prefixes from nested include statements are concatenated π§
The content of the files is used as if it were inserted in this part of the config file.
@@x_include FILE(added in AIDE v0.17) and@@x_include DIRECTORY REGEX [RULE_PREFIX](added in AIDE v0.17) β@@x_includeis identical to@@include, except that if a config file is executable, it is run and the output is used as config. iconic behavior honestly π
If the executable file exits with status greater than zero or writes to stderr, aide stops with an error. no mercy.
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. this one is not a vibe suggestion, it's the law π
@@x_include_setenv VAR VALUE(added in AIDE v0.17) β Adds the variable VAR with the value VALUE to the environment used for config file execution.
Environment variable names are limited to alphanumeric characters (A-Za-z0-9) and the underscore '_', and must not begin with a digit. rules are rules babe β¨
π TYPES π
boolβ Valid values areyes,true,noorfalse. (yes, both yes and true are real. and both no and false. pick your fave π )attribute expressionβ An attribute expression is formatted like this:
<attribute expression>: <attribute/group>
| <attribute expression> + <attribute/group>
| <attribute expression> - <attribute/group>
URLSβ Urls can be one of the following. And important: input urls cannot be used as outputs and vice versa. that's the cardinal rule, don't cross the streams πstdoutstderrβ Output is sent to stdout, stderr respectively.stdinβ Input is read from stdin.file:/pathβ Input is read from path or output is written to path.fd:numberβ Input is read from filedescriptor number or output is written to number.syslog:LOG_FACILITYβ Output is written to syslog using LOG_FACILITY.
β¨ File attributes β¨
ftypeβ the file type bestie, added in AIDE v0.15 π«fstypeβ the file system type, Linux-only, added in AIDE v0.19pβ permissionsiβ inodelβ link name (symbolic links only, so don't @ her otherwise)nβ number of linksuβ usergβ groupsβ sizebβ block countmβ mtimeaβ atimecβ ctimeaclβ access control list (needslibacl, Linux-only)selinuxβ selinux attributes (needslibselinux, Linux-only)xattrsβ extended attributes (needslibattr, Linux-only)e2fsattrsβ file attributes on a Linux file system, see also thereport_ignore_e2fsattrsoption (needslibext2fs, added in AIDE v0.15)capsβ file capabilities (regular files only) (needslibcap, Linux-only, added in AIDE v0.17)
Use aide --version to show which compiled-in attributes are available. π
π¦ Special attributes π¦
Sβ check for growing size (DEPRECATED since AIDE v0.18, will be removed in AIDE v0.20 π). Usegrowing+sattributes instead, no cap.Iβ ignore changed filename. WhenIis used, the inode of the new file is used to search for a moved source file in the old database.
Source and target file have to be located in the same directory and must share the same attributes (except for special attributes ANF, ARF, I, growing, and compressed).
For moved entries a change of the ctime attribute is ignored.
growingβ ignore growing file (added in AIDE v0.18). Whengrowingis used, changes of the following attributes are ignored:size: if new size is greater than old sizebcount: if new bcount is greater than old bcountatime: if new atime is greater than old atimemtime: if new mtime is greater than old mtimectime: if new ctime is greater than old ctimehashsums: if the hashsum of the new file restricted to the old size equals the hashsums of the old file
For hashsum attributes the growing attribute is ignored in compare mode. ikyk
compressedβ ignore compressed file (added in AIDE v0.18). Whencompressedis used, the uncompressed hashsums of the new compressed file (supported compressions:gzip) are used to search for the uncompressed file in the old database.
The old uncompressed and the new compressed file have to be located in the same directory and must share the same attributes (except for special attributes ANF, ARF, I, growing, and compressed) including at least one common hashsum.
Changes of the inode, size, bcount and ctime attributes are ignored.
The growing attribute (i.e. the old file size) is not considered for compressed files during the calculation of the uncompressed hashsums.
The compressed attribute is ignored in compare mode.
ANFβ allow new files. WhenANFis used, new files are added to the new database, but are ignored in the report. She's chill like that πARFβ allow removed files. WhenARFis used, files missing on disk are omitted from the new database, but are ignored in the report.
π₯ Hashsums attributes (regular files only) π₯
sha256β SHA-256 checksumsha512β SHA-512 checksumsha512_256β (added in AIDE v0.19) SHA-512 checksum truncated to 256 output bitssha3_256β (added in AIDE v0.19) SHA3-256 checksumsha3_512β (added in AIDE v0.19) SHA3-512 checksumstribog256β (added in AIDE v0.17) GOST R 34.11-2012, 256 bit checksumstribog512β (added in AIDE v0.17) GOST R 34.11-2012, 512 bit checksummd5β (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21) MD5 checksum (not in libgcrypt FIPS mode)sha1β (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21) SHA-1 checksumrmd160β (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21) RIPEMD-160 checksumgostβ (DEPRECATED since AIDE v0.19, will be removed in AIDE v0.21) GOST R 34.11-94 checksumcrc32β (REMOVED in AIDE v0.19) crc32 checksumcrc32bβ (REMOVED in AIDE v0.19) crc32 checksumhavalβ (REMOVED in AIDE v0.19) haval256 checksumtigerβ (REMOVED in AIDE v0.19) tiger checksumwhirlpoolβ (REMOVED in AIDE v0.19) whirlpool checksum
Use aide --version to show which hashsums are available. β¨
π Hashsum transitions (since AIDE v0.19): π
AIDE has limited support for hashsum transitions (i.e. ensuring hashsum validation when hashsums are added/removed from existing entries). If both the old and the new entry do not share common hashsum(s) AIDE tries to additionally calculate the removed hashsum(s) also for the new entry (this is especially not supported for moved (I attribute) and compressed (compressed attribute) entries).
lowkey important: that "not supported" bit is real, bestie β don't come for me when your moved or compressed entries act up π
/ Rβ bestie, this one singular line is a whole entire valid config file π it drags every file on your machine into the database. That's it. That's the config.
!/dev$
ignores the whole /dev directory structure, bye π
=/foo R
Only /foo and /foobar get pulled into the database β none of their children, not a single one π«
=/foo/ R
Only /foo and its children (like /foo/file and /foo/directory) make it in. The children of those sub-directories (so /foo/directory/bar) do not get added. subtle but it matters fr fr
/ 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 a specific rule just for directories, main character behaviour honestly π
πΈ Suggested Groups πΈ
OwnerMode = p+u+g+ftypeβ checks permissions, owner, group and file type. the core four πSize = s+bβ checks size and block count π
InodeData = OwnerMode+n+i+Size+l+X
StaticFile = m+c+Checksums
Files that stay static, no cap π§
Full = InodeData+StaticFile
Full = ftype+p+l+u+g+s+m+c+a+i+b+n+H+X
/ 0 Full
This line defines the group Full. It has all the attributes, all compiled-in hashsums (H) and all compiled-in extra file attributes (X). Peep the --version output to see the compiled-in hashsums and extra groups π The example rule is the typical catch-all rule you slap at the very end of your rule list.
VarTime = InodeData+Checksums
/etc/ssl/certs/ca-certificates\\.crt$ VarTime
Files that change their mtimes or ctimes but not their contents β°
VarInode = VarTime-i
/var/lib/nfs/etab$ f VarInode
Files that get recreated regularly but don't change their contents, iconic π¦
VarFile = OwnerMode+n+l+X
/etc/resolv\\.conf$ f VarFile
Files whose contents change during system operation π
VarDir = OwnerMode+n+i+X
/var/lib/snmp$ d VarDir
Directories whose contents change during system operation π
RecreatedDir = OwnerMode+n+X
/run/samba$ d RecreatedDir
Directories that get recreated regularly and change their contents. chaos but make it configurable π
πͺ΅ Log Handling πͺ΅
Logs are lowkey the final boss of AIDE, bestie. An active log is nearly constantly being written to. Then log rotation starts renaming files that are supposed to have unaltered contents. And to save space, logs get compressed during rotation, and finally, they get deleted. AIDE is supposed to handle all of those cases without generating reports β while still flagging the cases where an attacker tampers with your logs. That's the whole bit π
The examples below suggest a way to handle the common case of log rotation with the logrotate(8) program, with its options compress, delaycompress and nocopytruncate set. On most Linux systems, the vast majority of logs are rotated exactly this way.
ActLog=Full+growing+ANF+I
/var/log/foo\\.log$ f ActLog
An Active Log is typically named foo.log. It is constantly being written to. The file changes neither its mode nor its inode number. The size only increases, and what's written to the file isn't supposed to change (growing). During log rotation, foo.log is typically renamed to foo.log.1 (or foo.log.0) and the process is told to write to a brand new foo.log. Log content is written to a new file (ANF) and will eventually be renamed to foo.log.1 (I). The growing attribute suppresses reports for files that just had content appended when compared to the database.
β οΈ A change of the old content is still reported! don't get it twisted π€
RotLog=Full
/var/log/foo\\.log\\.1$ f RotLog
foo.log.0 or foo.log.1 is called the Rotated Log β the previously active log, renamed to the first name of the Log Series that the rotation mechanism forms. Right after rotation, the file might still be getting written to by the daemon. To aide, this looks like the Active Log's size decreases and its inode and timestamps change π The Rotated Log isn't supposed to change its attributes once the process has stopped writing to it. Reports might still be generated if aide runs while the process is still writing to the Rotated Log, but this is quite unlikely to happen. Some log rotation mechanisms rename foo.log to foo.log.0 to foo.log.1.gz, others rename foo.log to foo.log.1 to foo.2.log.gz. pick your fighter I guess π₯
CompSerLog=Full+I+compressed
/var/log/foo\\.log\\.2\\.gz$ f CompSerLog
In the next rotation step, foo.log.1 gets compressed to foo.log.2.gz, becoming the Compressed Log in the Log Series. With this rule, AIDE does not report this step, because it uncompresses the contents of the file and takes the checksum of the uncompressed content. The contents strictly doesn't change, but some attribute changes are ignored (compressed). slay ποΈ
MidlSerLog=Full+I
/var/log/foo\\.log\\.[345]\\.gz$ f MidlSerLog
In the next log rotation, all foo.log.{x} get renamed to foo.log.{x+1}. The other attributes are not supposed to change. periodt π
LastSerLog=Full+ARF
/var/log/foo\\.log\\.6\\.gz$ f LastSerLog
The configuration of the log rotation process specifies a number of log generations to keep. The last log in the series is therefore removed from the disk (ARF). rip in peace πͺ¦
aide 0.18 does not yet support the following cases of log rotation:
- empty files β It might be the case that a log is actually created, but never written to. This commonly happens on rarely used web servers that use log rotation as a method to cater for data protection regulation. In result, all files in a series are identical, which breaks the heuristics that aide uses to detect log rotation. A possible workaround is to begin a newly rotated log with a timestamp. With
logrotate, this can be done in apostrotatescriptlet. π nodelaycompressβ Withlogrotate'snodelaycompressoption, a log is immediately compressed after renaming it from the Active Log name. For the time being, it is recommended to always use thedelaycompressoption to avoid this behavior.copytruncateβ Withlogrotate'scopytruncateoption, the Active Log is not renamed and newly 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 already open file handle.aideuses the Inode number to detect the rotation process. That doesn't work withcopytruncatebecause the Inode stays with the Active Log. For the time being, it is recommended to avoid thecopytruncateoption to avoid this behavior. π©
β¨ HINTS β¨
In the following, the first is not allowed in AIDE. Use the latter instead, bestie π«Ά
/foo epug
/foo e+p+u+g
π SEE ALSO π
π DISCLAIMER π
All trademarks are the property of their respective owners. No animals were harmed while making this webpage or this piece of software. πΎ (we checked. everyone's fine. iconic behaviour honestly)
and that's a wrap on the whole page, bestie!! π this was aide v0.19.3, dated 2026-01-31, and it's the AIDE.CONF(5) manual β go forth and configure your file integrity monitoring like the main character you are πβ¨
π¦ where this page comes from
- nixos 26.05: aide 0.19.3
- ubuntu stonking: aide 0.19.3-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms