Debian Codegraph @

doc/aide.conf.5

raw
1 .TH AIDE.CONF 5 "2026-08-30" "aide v0.19.4" "AIDE"
2 .SH NAME
3 aide.conf - The configuration file for Advanced Intrusion Detection
4 Environment
5 .PP
6 .SH SYNOPSIS
7 \fBaide.conf\fP is the configuration file for Advanced Intrusion
8 Detection Environment. \fBaide.conf\fP contains the runtime
9 configuration aide uses to initialize or check the AIDE database.
10 .PP
11 .SH "FILE FORMAT"
12 aide.conf is case-sensitive. Leading and trailing white spaces are
13 ignored. Each config line must end with new line.
14 .PP
15 AIDE uses the backslash character (\fB\e\fR) as escape character for ' '
16 (space), '@' and '\e' (backslash) (e.g. '\e ' or '\e@'). To literally match a '\fB\e\fR'
17 in a file path with a regular expression you have to escape the backslash
18 twice (i.e. '\fB\e\e\e\e\fR').
19 .PP
20 There are three types of lines in \fBaide.conf\fP. First there are the
21 configuration options which are used to set configuration parameters and
22 define groups. Second, there are (restricted) rules that are used to indicate
23 which files/directories from the file system are added to the database. Third,
24 macro lines define or undefine variables within the config file. Lines
25 beginning with # are ignored as comments.
26 .PP
27
28 .SH "CONFIG OPTIONS"
29 .PP
30 These lines have the format parameter=value. See URLS for a list of
31 valid urls.
32 .PP
33 .TP
34 database_in (type: URL, default: see \fB--version\fP output, added in AIDE v0.17)
35 .TQ
36 database (REMOVED in AIDE v0.19)
37 The url from which database is read. There can only be one of these
38 lines. If there are multiple database lines then the first is used.
39
40 .RS
41 .B Examples:
42
43 .RS 3
44 .nf
45 .B database_in=file:/var/lib/aide/aide.db
46 .fi
47
48 .RS 3
49 Read database locally from \fI/var/lib/aide/aide.db\fR.
50 .RE
51
52 .RE
53
54 .RS 3
55 .nf
56 .B database_in=stdin
57 .fi
58
59 .RS 3
60 Read database from \fIstdin\fR.
61 .RE
62
63 .RE
64
65 .RS 3
66 .nf
67 .B database_in=https://example.com/aide.db
68 .fi
69
70 .RS 3
71 Read database remotely from \fIhttps://example.com/aide.db\fR.
72 .RE
73
74 .RE
75
76 .RE
77
78 .IP "database_out (type: URL, default: see \fB--version\fP output)"
79 The url to which the new database is written to. There can only be one
80 of these lines. If there are multiple database_out lines then the
81 first is used.
82 .IP "database_new (type: URL, default: \fB<none>\fP)"
83 The url from which the other database for \-\-compare is read.
84 .IP "database_attrs (type: attribute expression, default: \fBH\fP, added in AIDE v0.16)"
85 The attributes of the (uncompressed) database files which are to be added to
86 the reports in report level >= \fBdatabase_attributes\fP . Only checksum attributes are
87 supported. To disable set
88 .I database_attrs
89 to
90 .RB ' E '.
91 .IP "database_add_metadata (type: bool, default: \fBtrue\fR, added in AIDE v0.16)"
92 Whether to add the AIDE version and the time of database generation as comments
93 to the database file or not. This option may be set to false by default in a
94 future release.
95
96 .IP "log_level (type: log level, default: \fBwarning\fR, added in AIDE v0.17)"
97 The log level to use. Log messages are written to \fIstderr\fR. If there are
98 multiple \fIlog_level\fR lines then the first one is used. The \-\-log-level or
99 \-L command line option overwrites this option.
100
101 .RS
102 The following log levels are available:
103
104 .RS
105 \fBerror\fP: show unrecoverable issues that have to be handled by the user. Errors are fatal to the AIDE process.
106
107 \fBwarning\fP: additionally show recoverable issues that most likely lead to unexpected behaviour and should be handled by the user
108
109 \fBnotice\fP: additionally show recoverable issues that sometimes lead to unexpected behaviour and might be handled by the user.
110
111 \fBinfo\fP: additionally show informational messages
112
113 \fBcompare\fP: additionally show messages to help to debug file comparison and (special) attribute handling
114
115 The log levels below are very verbose and can easily generate multiple gigabytes
116 of log data (depending on the number of processed files and the size of the
117 rule tree). For debugging it is recommended to use these log levels together with the
118 \fI--limit\fR parameter (see aide (1) for details).
119
120 \fBrule\fP: additionally show messages to help to debug the path rule matching
121
122 \fBconfig\fP: additionally show messages to help to debug config and rule parsing
123
124 \fBdebug\fP: additionally show messages that are useful to debug the application
125
126 \fBlimit\fP: additionally show messages about skipped entries due to limit match
127
128 \fBthread\fP: additionally show messages about thread processing (e.g. broadcast events)
129
130 \fBtrace\fP: additionally show messages about the internal data structures and the flow of the application (e.g. in-loop logging) (extremely verbose)
131
132 .RE
133
134 .RE
135
136 .IP "verbose (type: number, range: 0 - 255, default: \fB5\fR, REMOVED in AIDE v0.17)"
137 Removed, use \fBlog_level\fR and \fBreport_level\fR options instead.
138 .IP "gzip_dbout (type: bool, default: \fBfalse\fR)"
139 Whether the output to the database is gzipped or not. This option is available
140 only if zlib support is compiled in.
141 .IP "root_prefix (type: path, default: \fB<empty>\fR, added in AIDE v0.16)"
142 The prefix to strip from each file name in the file system before applying the
143 rules and writing to database. AIDE removes a trailing slash from the prefix.
144 If there are multiple root_prefix lines then the first one is used. This option
145 has no effect in compare mode.
146 .IP "acl_no_symlink_follow (type: bool, default: \fBfalse\fR)"
147 Whether to check ACLs for symlinks or not. This option
148 is available only if acl support is compiled in.
149 .IP "warn_dead_symlinks (type: path, default: \fBfalse\fR)"
150 Whether to warn about dead symlinks or not.
151 .IP "config_version (type: string, default: \fB<empty>\fR)"
152 The value of config_version is printed in the report and also printed
153 to the database. This is for informational purposes only. It has no
154 other functionality.
155 .IP "config_check_warn_unrestricted_rules (type: bool, default: \fBfalse\fR, added in AIDE v0.18)"
156 Whether to warn on unrestricted rules during config check. To explicitly
157 define unrestricted rules use \fB0\fR (zero) as restriction character.
158 .IP "num_workers (type: number|percentage, default: \fB1\fR, added in AIDE v0.18)"
159 Specifies the number of simultaneous workers (threads) for file attribute
160 processing (i.a. hashsum calculation).
161
162 The number of workers can be a positive integer (e.g. '4') or the percentage of
163 the available processors (e.g. '60%'). The resulting number of workers is
164 rounded up to the next integer (e.g. '60%' of 8 processors results in 5
165 workers).
166
167 If there are multiple \fInum_workers\fR lines then the first one is used.
168
169 Use 0 (zero) to disable (multi-threaded) workers.
170
171 The default value 1 (single worker thread) may be changed in a future release.
172
173 .PP
174
175 .SH REPORT OPTIONS
176 .PP
177
178 .IP "report_url (type: URL, default: \fBstdout\fR)"
179
180 The URL that the output is written to.
181
182 Multiple instances of the \fBreport_url\fR option are supported.
183
184 .RS
185 .B Examples:
186
187 .RS 3
188 .nf
189 .B report_url=file:/var/log/aide.log
190 .fi
191
192 .RS 3
193 Write report to \fI/var/log/aide.log\fR.
194 .RE
195 .RE
196
197 .RS 3
198 .nf
199 .B report_url=stdout
200 .fi
201
202 .RS 3
203 Write report to \fIstdout\fR.
204 .RE
205 .RE
206
207 .RS 3
208 .nf
209 .B report_url=syslog:<LOG_FACILITY>
210 .fi
211
212 .RS 3
213 Write report to \fIsyslog\fR using \fILOG_FACILITY\fR.
214 .RE
215 .RE
216
217 .RE
218
219 .PP
220 The following report options are available (to take effect they
221 have to be set before \fBreport_url\fR):
222 .PP
223
224 .IP "report_level (type: report level, default: \fBchanged_attributes\fR, added in AIDE v0.17)"
225
226 The report level to use. The available report levels are as follows:
227
228 .RS
229 \fBminimal\fP: print single line whether AIDE found differences to the database
230
231 \fBsummary\fP: additionally print number of added, removed and changed files
232
233 \fBdatabase_attributes\fP: additionally print database checksums
234
235 \fBlist_entries\fP: additionally print lists of added, removed and changed entries
236
237 \fBchanged_attributes\fP: additionally print details about changed entries
238
239 .RS
240 .B Example:
241 .RS 3
242
243 .EX
244 File: /var/lib/apt/extended_states
245 Perm : -rw-r--r-- | -rw-------
246 Uid : 0 | 106
247 .EE
248
249 .RE
250
251 The left column shows the old value (e.g. from the \fIdatabase_in\fR database) and the right
252 column shows the new value (e.g. from the file system).
253
254 .RE
255
256 \fBadded_removed_attributes\fP: additionally print details about added and removed attributes
257
258 \fBadded_removed_entries\fP: additionally print details about added and removed entries
259 .RE
260
261 .IP "report_format (type: report format, default: \fBplain\fR, added in AIDE v0.18)"
262 The report format to use. The available report formats are as follows:
263
264 .RS
265 \fBplain\fP: Print report in plain human-readable format.
266
267 \fBjson\fP: Print report in json machine-readable format.
268 .RE
269
270 .IP "report_base16 (type: bool, default: \fBfalse\fR, added in AIDE v0.17)"
271 Base16 encode the checksums in the report. The default is to
272 report checksums in base64 encoding.
273 .IP "report_detailed_init (type: bool, default: \fBfalse\fR, added in AIDE v0.16)"
274 Report added files (report level >= \fBlist_entries\fP) and their details (report
275 level >= \fBadded_removed_entries\fP) in initialization mode.
276 .IP "report_quiet (type: bool, default: \fBfalse\fR, added in AIDE v0.16)"
277 Suppress report output if no differences to the database have been found.
278 .IP "report_append (type: bool, default: \fBfalse\fR, added in AIDE v0.17)"
279 Append to the report URL.
280 .TP
281 report_grouped (type: bool, default: \fBtrue\fR, added in AIDE v0.17)
282 .TQ
283 grouped (REMOVED in AIDE v0.19)
284 Group the files in the report by added, removed and changed files.
285 .TP
286 report_summarize_changes (type: bool, default: \fBtrue\fR, added in AIDE v0.17)
287 .TQ
288 summarize_changes (REMOVED in AIDE v0.19)
289 Summarize changes in the added, removed and changed files
290 sections of the report.
291
292 The general format is like the string YlZbpugamcinHAXSECF, where Y is
293 replaced by the file-type ('\fBf\fP' for a regular file, '\fBd\fP' for a
294 directory, '\fBl\fP' for a symbolic link, '\fBc\fP' for a character
295 device, '\fBb\fP' for a block device, '\fBp\fP' for a FIFO, '\fBs\fP' for
296 a unix socket, '\fBD\fP' for a Solaris door, '\fBP\fP' for a Solaris
297 event port, '\fB!\fP' if file type has changed and '\fB?\fP' otherwise).
298
299 The Z is replaced as follows: A '\fB=\fP' means that the size has not changed,
300 a '\fB<\fP' reports a shrinked size and a '\fB>\fP' reports a grown size.
301 The other letters in the string are the actual letters that will be output
302 if the associated attribute for the item has been changed or a '\fB.\fP' for no
303 change.
304
305 Otherwise a '\fB+\fP' is shown if the attribute has been added, a '\fB-\fP' if
306 it has been removed, a '\fB:\fP' if the attribute is ignored (but not forced)
307 or a ' ' if the attribute has not been checked.
308
309 The exceptions to this are: (1) a newly created file replaces each letter with
310 a '\fB+\fP', and (2) a removed file replaces each letter with a '\fB-\fP'.
311
312 The attribute that is associated with each letter is as follows:
313
314 .RS
315 .IP o
316 An \fBl\fP means that the link name has changed.
317 .IP o
318 A \fBb\fP means that the block count has changed.
319 .IP o
320 A \fBp\fP means that the permissions have changed.
321 .IP o
322 A \fBu\fP means that the uid has changed.
323 .IP o
324 A \fBg\fP means that the gid has changed.
325 .IP o
326 An \fBa\fP means that the access time has changed.
327 .IP o
328 An \fBm\fP means that the modification time has changed.
329 .IP o
330 A \fBc\fP means that the change time has changed.
331 .IP o
332 An \fBi\fP means that the inode has changed.
333 .IP o
334 An \fBn\fP means that the link count has changed.
335 .IP o
336 An \fBH\fP means that one or more message digests have changed.
337 .IP o
338 An \fBF\fP means that one file system type has changed (Linux only).
339 .RE
340
341 .RS
342 The following letters are only available when explicitly enabled using configure:
343 .RE
344
345 .RS
346 .IP o
347 An \fBA\fP means that the access control list has changed.
348 .IP o
349 An \fBX\fP means that the extended attributes have changed.
350 .IP o
351 An \fBS\fP means that the SELinux attributes have changed.
352 .IP o
353 An \fBE\fP means that the file attributes on a second extended file system have changed.
354 .IP o
355 A \fBC\fP means that the file capabilities have changed.
356 .RE
357 .IP "report_ignore_added_attrs (type: attribute expression, default: \fBempty\fR, added in AIDE v0.16)"
358 Attributes whose addition is to be ignored in the report.
359 .IP "report_ignore_removed_attrs (type: attribute expression, default: \fBempty\fR, added in AIDE v0.16)"
360 Attributes whose removal is to be ignored in the report.
361 .TP
362 report_ignore_changed_attrs (type: attribute expression, default: \fBempty\fR, added in AIDE v0.16)
363 .TQ
364 ignore_list (REMOVED in AIDE v0.17)
365 Attributes whose change is to be ignored in the report.
366 .TP
367 report_force_attrs (type: attribute expression, default: \fBempty\fR, added in AIDE v0.16)
368 .TQ
369 report_attributes (REMOVED in AIDE v0.17)
370 Attributes which are always printed in the report for changed files. If an attribute is both ignored and forced the
371 attribute is not considered for file change but printed in the final report as long as the file has been otherwise changed.
372 .IP "report_ignore_e2fsattrs (type: string, default: \fB0\fR, added in AIDE v0.16)"
373 List (no delimiter) of ext2 file attributes which are to be ignored in the report.
374 See
375 .BR chattr (1)
376 for the available attributes. Use \fB0\fR (zero) to not ignore any
377 attribute. Ignored attributes are represented by a ':' in the report.
378
379 By default AIDE also reports changes of the read-only attributes mentioned in
380 .BR chattr (1)
381 (see example below how to ignore those changes).
382
383 .RS
384 .B Example:
385
386 .RS 3
387 Ignore changes of the read-only ext2 file attributes verify (V), inline data
388 (N), indexed directory (I) and encrypted (E):
389
390 .RS 3
391 .nf
392 report_ignore_e2fsattrs=VNIE
393 .fi
394 .RE
395 .RE
396 .RE
397
398 .PP
399 .SH "GROUPS"
400 .PP
401
402 Groups are aggregations of attributes.
403
404 Group definitions have the format <group name> = <attribute expression>.
405
406 Group names are limited to alphanumeric characters (\fBA-Za-z0-9\fP).
407
408 See ATTRIBUTES for a description of all available attributes.
409
410 .RE
411
412 .B Default groups
413 .TP
414 .B "R"
415 p+ftype+i+l+n+u+g+s+m+c+sha3_256+X
416 .TP
417 .B "L"
418 p+ftype+i+l+n+u+g+X
419 .TP
420 .B ">"
421 Growing file p+ftype+l+u+g+i+n+s+growing+X
422 .TP
423 .B "H"
424 all compiled in (and not deprecated) hashsums (added in AIDE v0.17)
425 .TP
426 .B "X"
427 acl+selinux+xattrs+e2fsattrs+caps (if attributes are compiled in, added in AIDE v0.16)
428 .TP
429 .B "E"
430 Empty group
431 .TP
432 Use 'aide --version' to list the default compound groups.
433
434 .RE
435
436 .PP
437 .SH "RULES"
438 .PP
439 AIDE supports three types of rules:
440 .TP
441 .B "Regular rule:"
442 <regex> <attribute expression>
443
444 Files and directories matching the regular expression
445 are added to the database.
446
447 .TP
448 .B "Recursive negative rule:"
449 !<regex>
450
451 Files and directories matching the regular expression are excluded and NOT
452 added to the database. The children of directories and sub-directories are
453 recursed into and only not added to the database if they also match the regular
454 expression.
455
456 .TP
457 .B "Non-recursive negative rule (added in AIDE v0.19)"
458 -<regex>
459
460 Files and directories matching the regular expression are excluded and NOT added
461 the database. The children of directories and sub-directories are not recursed
462 into and hence not added to the database by any means.
463
464 .TP
465 .B "Equals rule:"
466 =<regex> <attribute expression>
467
468 Files and directories matching the regular expression
469 are added to the database.
470 The children of directories are only added
471 if the regular expression ends with a "/".
472 The children of sub-directories are not added to the database.
473
474 .PP
475 Every regular expression has to start with an explicit "/".
476 An implicit ^ is added in front of each regular expression.
477 In other words,
478 the regular expressions are matched at the first position
479 against the complete path.
480 Special characters can be escaped using
481 two-digit URL encoding (for example, %20 to represent a space).
482
483 AIDE uses a deepest-match algorithm to find the tree node to search,
484 but a first-match algorithm inside the node.
485 (see also \fBrule\fP log level).
486
487 See EXAMPLES for examples.
488 .PP
489 More in-depth discussion of the selection algorithm can be found in
490 the AIDE manual.
491 .IP
492 .PP
493 .SH "RESTRICTED RULES"
494 Restricted rules are like normal rules but can be
495 restricted to file types (added in AIDE v0.16) and/or file system types (added
496 in AIDE v0.19, Linux only).
497
498 The syntax of restricted rules is as follows:
499
500 .B "Restricted regular rule"
501 .RS 3
502
503 .nf
504 <regex> <restriction expression> <attribute expression>
505 .fi
506
507 Files and directories matching both the regular expression and the restriction
508 expression are added the database.
509
510 .RE
511
512 .B "Restricted recursive negative rule"
513 .RS 3
514
515 .nf
516 !<regex> <restriction expression>
517 .fi
518
519 Files and directories matching both the regular expression and the restriction
520 expression are excluded and NOT added the database. The children of directories
521 and sub-directories are recursed into and only excluded if they also match the
522 regular expression as well as the restriction.
523
524 .RE
525
526 .B "Restricted non-recursive negative rule (added in AIDE v0.19)"
527 .RS 3
528
529 .nf
530 -<regex> <restriction expression>
531 .fi
532
533 Files and directories matching both the regular expression and the restriction
534 expression are excluded and NOT added the database. The children of directories
535 and sub-directories are not recursed into and hence not added to the database
536 by any means.
537
538 .RE
539
540 .B "Restricted equals rule"
541 .RS 3
542
543 .nf
544 =<regex> <restriction expression> <attribute expression>
545 .fi
546
547 Files and directories matching both the regular expression and the restriction
548 expression are added the database. The children of directories are only added
549 if the regular expression ends with a "/". The children of sub-directories are
550 not added to the database.
551
552 .RE
553
554 .B Restriction expression
555
556 .RS 3
557
558 An restriction expression is of the following form:
559
560 .nf
561 <restriction expression>: <file types>
562 | =<file system type>
563 | <file types>=<file system type>
564 .fi
565 .RE
566
567 .B File types
568
569 .RS 3
570
571 The following file types are supported:
572
573 .RS 3
574
575 .TP
576 .B "\fBf\fP"
577 restrict rule to regular files
578 .TP
579 .B "\fBd\fP"
580 restrict rule to directories
581 .TP
582 .B "\fBl\fP"
583 restrict rule to symbolic links
584 .TP
585 .B "\fBc\fP"
586 restrict rule to character devices
587 .TP
588 .B "\fBb\fP"
589 restrict rule to block devices
590 .TP
591 .B "\fBp\fP"
592 restrict rule to FIFO files
593 .TP
594 .B "\fBs\fP"
595 restrict rule to UNIX sockets
596 .TP
597 .B "\fBD\fP"
598 restrict rule to Solaris doors
599 .TP
600 .B "\fBP\fP"
601 restrict rule to Solaris event ports
602
603 .RE
604
605 .PP
606 Multiple file type restrictions can be given
607 as a comma-separated list.
608
609 .RE
610
611 .B "File system types (Linux only)"
612
613 .RS 3
614
615 The file system type restriction can be specified by file system types magic
616 number (e.g. '0x01021994' for tmpfs) or by its name (use 'aide --version' to
617 list the available file system type names). The magic number must start
618 with '0x' and be formatted in hexdecimal format.
619
620 .RE
621
622 .B "Empty restriction"
623
624 .RS 3
625
626 To explicitly don't restrict a rule use
627 .B "\fB0\fR"
628 (added in AIDE v0.18).
629
630 .RE
631
632 .B Examples:
633
634 .RS 3
635 .nf
636 / d,f R
637 .fi
638
639 .RS 3
640 Only add directories and files to the database.
641 .RE
642 .RE
643
644 .RS 3
645 .nf
646 /boot/efi$ d=vfat R
647 .fi
648
649 .RS 3
650 Only add \fB/boot/efi\fR to the database if it is a directory and mounted on \fBvfat\fR.
651 .RE
652 .RE
653
654 .RS 3
655 .nf
656 !/dev =0x01021994
657 .fi
658
659 .RS 3
660 Exclude \fB/dev\fR and any children that are mounted on \fBtmpfs\fR (\fBtmpfs\fR magic number: \fB0x01021994\fR).
661 .RE
662 .RE
663
664 .RS 3
665 .nf
666 -/dev =tmpfs
667 .fi
668
669 .RS 3
670 Exclude \fB/dev\fR and all children, if \fB/dev\fR is mounted on \fBtmpfs\fR.
671 .RE
672 .RE
673
674 .PP
675 .SH "MACRO LINES"
676 .PP
677 .IP "@@define \fBVAR\fR \fBval\fR"
678 Define variable \fBVAR\fR to value \fBval\fR.
679 .IP "@@undef \fBVAR\fR"
680 Undefine variable \fBVAR\fR.
681 .TP
682 @@if \fBboolean_expression\fR (added in AIDE v0.18)
683 .TQ
684 @@else
685 .TQ
686 @@endif
687 @@if begins an if statement. It must be terminated with an @@endif statement.
688 The lines between @@if and @@endif are used if the \fBboolean_expression\fR
689 evaluates to \fBtrue\fR. If there is an @@else statement then the part between
690 @@if and @@else is used if \fBboolean_expression\fR evaluates to \fBtrue\fR
691 otherwise the part between @@else and @@endif is used.
692
693 .RS
694 Available operators and functions in boolean expressions:
695
696 .RS 3
697 .nf
698 .B not \fIboolean_expression\fR
699 .fi
700 .RS 3
701 Evaluates to true if the \fIboolean_expression\fR is false, and false if the
702 \fIboolean_expression\fR is true.
703 .RE
704 .RE
705
706 .RS 3
707 .nf
708 .B defined \fIVARIABLE\fR
709 .fi
710
711 .RS 3
712 Evaluates to \fBtrue\fR if \fIVARIABLE\fR is defined.
713 .RE
714 .RE
715
716 .RS 3
717 .nf
718 .B hostname \fIHOSTNAME\fR
719 .fi
720
721 .RS 3
722 Evaluates to \fBtrue\fR if \fIHOSTNAME\fR equals the \fBhostname\fR of the machine
723 that AIDE is running on. \fBhostname\fR is the name of the host without the
724 domainname (ie 'hostname', not 'hostname.example.com').
725 .RE
726 .RE
727
728 .RS 3
729 .nf
730 .B exists \fIPATH\fR
731 .fi
732
733 .RS 3
734 Evaluates to \fBtrue\fR if \fIPATH\fR exists.
735 .RE
736 .RE
737
738 .RS 3
739 .nf
740 .B \fIVERSION_STRING1\fR \fBversion_ge\fR \fIVERSION_STRING2\fR (added in AIDE v0.19)
741 .fi
742
743 .RS 3
744 Evaluates to \fBtrue\fR if \fIVERSION_STRING1\fR is greater than or equal to
745 \fIVERSION_STRING2\fR (e.g. 0.19.1 \fBversion_ge\fR 0.18 evaluates to
746 \fBtrue\fR and 2.17 \fBversion_ge\fR 1.1 to \fBfalse\fR). The version strings
747 must be in the format MAJOR.MINOR.PATCH (minor and patch version can be
748 omitted, any version suffix (e.g. for pre-release) will be truncated).
749 .RE
750
751 .RE
752
753 .RE
754
755 .IP "@@ifdef \fBVARIABLE\fR (\fBDEPRECATED\fR since AIDE v0.18, will be removed in AIDE v0.20)"
756 same as \fB@@if defined VARIABLE\fR
757 .IP "@@ifndef \fBVARIABLE\fR (\fBDEPRECATED\fR since AIDE v0.18, will be removed in AIDE v0.20)"
758 same as \fB@@if not defined VARIABLE\fR
759 .IP "@@ifhost \fBHOSTNAME\fR (\fBDEPRECATED\fR since AIDE v0.18, will be removed in AIDE v0.20)"
760 same as \fB@@if hostname HOSTNAME\fR
761 .IP "@@ifnhost \fBHOSTNAME\fR (\fBDEPRECATED\fR since AIDE v0.18, will be removed in AIDE v0.20)"
762 same as \fB@@if not hostname HOSTNAME\fR
763
764 .IP "@@{\fBVAR\fR}"
765 @@{\fBVAR\fR} is replaced with the value of the variable \fBVAR\fR.
766 If variable \fBVAR\fR is not defined an empty string is used.
767
768 Variables are supported in strings and in regular expressions of rules.
769
770 .RS
771 Pre-defined marco variables:
772
773 .RS 3
774 \fB@@{AIDE_VERSION}\fP: the version of AIDE
775 .RE
776
777 .RS 3
778 \fB@@{HOSTNAME}\fP: the hostname of the current system
779 .RE
780
781 .RE
782
783 .IP "@@include \fBFILE\fR"
784 Include \fBFILE\fR.
785
786 The content of the file is used as if it were inserted in this part of the
787 config file.
788
789 The maximum depth of nested includes is 16.
790
791 .IP "@@include \fBDIRECTORY\fR \fBREGEX\fR [\fBRULE_PREFIX\fR] (added in AIDE v0.17)"
792 Include all (regular) files found in \fBDIRECTORY\fR matching regular
793 expression \fBREGEX\fR (sub-directories are ignored). The files are included in
794 lexical sort order.
795
796 If \fBRULE_PREFIX\fR (added in AIDE v0.18) is set, all rules included by the
797 statement are prefixed with given \fBRULE_PREFIX\fR. Prefixes from nested
798 include statements are concatenated.
799
800 The content of the files is used as if it were inserted in this
801 part of the config file.
802
803 .TP
804 @@x_include \fBFILE\fR (added in AIDE v0.17)
805 .TQ
806 @@x_include \fBDIRECTORY\fR \fBREGEX\fR [\fBRULE_PREFIX\fR] (added in AIDE v0.17)
807 \fB@x_include\fR is identical to \fB@@include\fR, except that if a config file
808 is executable is is run and the output is used as config.
809
810 If the executable file exits with status greater than zero or writes to stderr
811 aide stops with an error.
812
813 For security reasons \fBDIRECTORY\fR and each executable config file must be
814 owned by the current user or root. They must not be group- or world-writable.
815
816 .IP "@@x_include_setenv \fBVAR\fR \fBVALUE\fR (added in AIDE v0.17)"
817
818 Adds the variable \fBVAR\fR with the value \fBVALUE\fR to the environment used
819 for config file execution.
820
821 Environment variable names are limited to alphanumeric characters
822 (\fBA-Za-z0-9\fP) and the underscore '\fB_\fR' and must not begin with a digit.
823
824 .PP
825
826 .SH TYPES
827
828 .B bool
829 .RS 3
830 Valid values are \fByes\fR, \fBtrue\fR, \fBno\fR or \fBfalse\fR.
831 .RE
832
833 .B "attribute expression"
834 .RS 3
835
836 An attribute expression is of the following form:
837 .IP
838 .nf
839 <attribute expression>: <attribute/group>
840 | <attribute expression> + <attribute/group>
841 | <attribute expression> - <attribute/group>
842 .fi
843 .RE
844
845 .B URLS
846 .RS 3
847 Urls can be one of the following. Input urls cannot be used as outputs
848 and vice versa.
849 .RS
850
851 .IP "stdout"
852 .IP "stderr"
853 Output is sent to stdout, stderr respectively.
854 .IP "stdin"
855 Input is read from stdin.
856 .IP "file:/\fBpath\fR"
857 Input is read from \fBpath\fR or output is written to \fBpath\fR.
858 .IP "fd:\fBnumber\fR"
859 Input is read from filedescriptor \fBnumber\fR or output is written to
860 \fBnumber\fR.
861 .IP "syslog:\fBLOG_FACILITY\fR"
862 Output is written to syslog using \fILOG_FACILITY\fR.
863
864 .RE
865
866 .RE
867
868 .SH "ATTRIBUTES"
869 .PP
870 .B "File attributes"
871 .TP
872 .B "\fBftype\fR"
873 file type (added in AIDE v0.15)
874 .TP
875 .B "\fBfstype\fR"
876 file system type (Linux-only, added in AIDE v0.19)
877 .TP
878 .B "\fBp\fR"
879 permissions
880 .TP
881 .B "\fBi\fR"
882 inode
883 .TP
884 .B "\fBl\fR"
885 link name (symbolic links only)
886 .TP
887 .B "\fBn\fR"
888 number of links
889 .TP
890 .B "\fBu\fR"
891 user
892 .TP
893 .B "\fBg\fR"
894 group
895 .TP
896 .B "\fBs\fR"
897 size
898 .TP
899 .B "\fBb\fR"
900 block count
901 .TP
902 .B "\fBm\fR"
903 mtime
904 .TP
905 .B "\fBa\fR"
906 atime
907 .TP
908 .B "\fBc\fR"
909 ctime
910 .TP
911 .B "\fBacl\fR"
912 access control list
913 (requires \fIlibacl\fR, Linux-only)
914 .TP
915 .B "\fBselinux\fR"
916 selinux attributes
917 (requires \fIlibselinux\fR, Linux-only)
918 .TP
919 .B "\fBxattrs\fR"
920 extended attributes
921 (requires \fIlibattr\fR, Linux-only)
922 .TP
923 .B "\fBe2fsattrs\fR"
924 file attributes on a Linux file system,
925 see also \fB report_ignore_e2fsattrs \fP option
926 (requires \fIlibext2fs\fR, added in AIDE v0.15)
927 .TP
928 .B "\fBcaps\fR"
929 file capabilities (regular files only)
930 (requires \fIlibcap\fR, Linux-only, added in AIDE v0.17)
931 .PP
932
933 Use 'aide --version' to show which compiled-in attributes are available.
934 .PP
935 .B "Special attributes"
936 .TP
937 .B "\fBS\fR"
938 check for growing size
939 (\fBDEPRECATED\fR since AIDE v0.18, will be removed in AIDE v0.20)
940
941 Use \fBgrowing+s\fR attributes instead
942 .TP
943 .B "\fBI\fR"
944 ignore changed filename
945
946 When \fBI\fR is used, the inode of the new file is used to search for
947 a moved source file in the old database.
948
949 Source and target file have to be located in the same directory and must share
950 the same attributes (except for special attributes
951 \fBANF\fR, \fBARF\fR, \fBI\fR, \fBgrowing\fR, and \fBcompressed\fR).
952
953 For moved entries a change of the \fBctime\fR attribute is ignored.
954
955 .TP
956 .B "\fBgrowing\fR"
957 ignore growing file (added in AIDE v0.18)
958
959 When \fBgrowing\fR is used, changes of the following attributes are
960 ignored:
961
962 \fBsize\fR: if new size is greater than old size
963
964 \fBbcount\fR: if new bcount is greater than old bcount
965
966 \fBatime\fR: if new atime is greater than old atime
967
968 \fBmtime\fR: if new mtime is greater than old mtime
969
970 \fBctime\fR: if new ctime is greater than old ctime
971
972 \fBhashsums\fR: if the hashsum of the new file restricted to the old size equals the hashsums of the old file
973
974 For hashsum attributes the \fBgrowing\fR attribute is ignored in compare mode.
975
976 .TP
977 .B "\fBcompressed\fR"
978 ignore compressed file (added in AIDE v0.18)
979
980 When \fBcompressed\fR is used, the uncompressed hashsums of the
981 new compressed file (supported compressions: \fBgzip\fR) are used to search for the
982 uncompressed file in the old database.
983
984 The old uncompressed and the new compressed file have to be located in the same
985 directory and must share the same attributes (except for special attributes
986 \fBANF\fR, \fBARF\fR, \fBI\fR, \fBgrowing\fR, and \fBcompressed\fR) including at least
987 one common hashsum.
988
989 Changes of the \fBinode\fR, \fBsize\fR, \fBbcount\fR and \fBctime\fR attributes are ignored.
990
991 The \fBgrowing\fR attribute (i.e. the old file size) is not considered for
992 compressed files during the calculation of the uncompressed hashsums.
993
994 The \fBcompressed\fR attribute is ignored in compare mode.
995
996 .TP
997 .B "\fBANF\fR"
998 allow new files
999
1000 When 'ANF' is used, new files are added to the new database, but are
1001 ignored in the report.
1002 .TP
1003 .B "\fBARF\fR"
1004 allow removed files
1005
1006 When 'ARF' is used, files missing on disk are omitted from the new database,
1007 but are ignored in the report.
1008 .PP
1009
1010 .B Hashsums attributes (regular files only)
1011
1012 .RS 3
1013
1014 .TP
1015 \fBsha256\fR
1016 SHA-256 checksum
1017 .TP
1018 \fBsha512\fR
1019 SHA-512 checksum
1020 .TP
1021 \fBsha512_256\fR (added in AIDE v0.19)
1022 SHA-512 checksum truncated to 256 output bits
1023 .TP
1024 \fBsha3_256\fR (added in AIDE v0.19)
1025 SHA3-256 checksum
1026 .TP
1027 \fBsha3_512\fR (added in AIDE v0.19)
1028 SHA3-512 checksum
1029 .TP
1030 \fBstribog256\fR (added in AIDE v0.17)
1031 GOST R 34.11-2012, 256 bit checksum
1032 .TP
1033 \fBstribog512\fR (added in AIDE v0.17)
1034 GOST R 34.11-2012, 512 bit checksum
1035 .TP
1036 md5 (\fBDEPRECATED\fR since AIDE v0.19, will be removed in AIDE v0.21)
1037 MD5 checksum
1038 (not in \fIlibgcrypt\fR FIPS mode)
1039 .TP
1040 sha1 (\fBDEPRECATED\fR since AIDE v0.19, will be removed in AIDE v0.21)
1041 SHA-1 checksum
1042 .TP
1043 rmd160 (\fBDEPRECATED\fR since AIDE v0.19, will be removed in AIDE v0.21)
1044 RIPEMD-160 checksum
1045 .TP
1046 gost (\fBDEPRECATED\fR since AIDE v0.19, will be removed in AIDE v0.21)
1047 GOST R 34.11-94 checksum
1048 .TP
1049 crc32 (\fBREMOVED\fR in AIDE v0.19)
1050 crc32 checksum
1051 .TP
1052 crc32b (\fBREMOVED\fR in AIDE v0.19)
1053 crc32 checksum
1054 .TP
1055 haval (\fBREMOVED\fR in AIDE v0.19)
1056 haval256 checksum
1057 .TP
1058 tiger (\fBREMOVED\fR in AIDE v0.19)
1059 tiger checksum
1060 .TP
1061 whirlpool (\fBREMOVED\fR in AIDE v0.19)
1062 whirlpool checksum
1063 .PP
1064
1065 Use 'aide --version' to show which hashsums are available.
1066
1067 .B Hashsum transitions (since AIDE v0.19):
1068
1069 AIDE has limited support for hashsum transitions (i.e. ensuring hashsum
1070 validation when hashsums are added/removed from existing entries). If
1071 both the old and the new entry do mot share common hashsum(s) AIDE tries to
1072 additionally calculate the removed hashsum(s) also for the new entry (this is
1073 especieally not supported for moved (\fBI\fR attribute) and compressed
1074 (\fBcompressed\fR attribute) entries).
1075
1076 .RE
1077
1078 .PP
1079 .SH EXAMPLES
1080 .TP
1081 .B "/ R"
1082 This adds all files on your machine to the database.
1083 This one line is a fully qualified configuration file.
1084 .TP
1085 .B "!/dev$"
1086 This ignores the /dev directory structure.
1087 .TP
1088 .B "=/foo R"
1089 Only /foo and /foobar are taken into the database.
1090 None of their children are added.
1091 .TP
1092 .B "=/foo/ R"
1093 Only /foo and its children
1094 (e.g. /foo/file and /foo/directory)
1095 are taken into the database.
1096 The children of sub-directories
1097 (e.g. /foo/directory/bar) are not added.
1098 .TP
1099 .B "/ d,f R"
1100 Only add directories and files to the database
1101 .TP
1102 .B "!/run d"
1103 .TQ
1104 .B "/run R"
1105 Add all but directory entries to the database
1106 .TP
1107 .B "/run d R-m-c-i"
1108 .TQ
1109 .B "/run R"
1110 Use specific rule for directories
1111 .TP
1112 Suggested Groups
1113 .TP
1114 .B "\fBOwnerMode\fR = p+u+g+ftype"
1115 Check permissions, owner, group and file type
1116 .TP
1117 .B "\fBSize\fR = s+b"
1118 Check size and block count
1119 .TP
1120 .B "\fBInodeData\fR = OwnerMode+n+i+Size+l+X"
1121 .TQ
1122 .B "\fBStaticFile\fR = m+c+Checksums"
1123 Files that stay static
1124 .PP
1125 .B "\fBFull\fR = InodeData+StaticFile"
1126 .TQ
1127 .B "\fBFull\fR = ftype+p+l+u+g+s+m+c+a+i+b+n+H+X"
1128 .TQ
1129 .B "/ 0 Full"
1130 This line defines group \fBFull\fR.
1131 It has all attributes,
1132 all compiled in hashsums (\fBH\fR) and
1133 all compiled in extra file attributes (\fBX\fR).
1134 See '--version' output for the compiled in hashsums and extra groups.
1135 The example rule is the typical catch-all rule
1136 at the end of the rule list.
1137 .TP
1138 .B "\fBVarTime\fR = InodeData+Checksums"
1139 .TQ
1140 .B "/etc/ssl/certs/ca-certificates\e\e.crt$ VarTime"
1141 Files that change their mtimes or ctimes but not their contents.
1142 .TP
1143 .B "\fBVarInode\fR = VarTime-i"
1144 .TQ
1145 .B "/var/lib/nfs/etab$ f VarInode"
1146 Files that are recreated regularly but do not change their contents
1147 .TP
1148 .B "\fBVarFile\fR = OwnerMode+n+l+X"
1149 .TQ
1150 .B "/etc/resolv\e\e.conf$ f VarFile"
1151 Files that change their contents during system operation
1152 .TP
1153 .B "\fBVarDir\fR = OwnerMode+n+i+X"
1154 .TQ
1155 .B "/var/lib/snmp$ d VarDir"
1156 Directories that change their contents during system operation
1157 .TP
1158 .B "\fBRecreatedDir\fR = OwnerMode+n+X"
1159 .TQ
1160 .B "/run/samba$ d RecreatedDir"
1161 Directories that are recreated regularly and change their contents
1162 .TP
1163 Log Handling
1164 .PP
1165 Logs pose a number of special challenges to AIDE.
1166 An active log is nearly constantly being written to.
1167 The process of log rotation changes file names for
1168 files that are supposed to have unaltered contents.
1169 To save space, Logs are compressed in the process of their rotation,
1170 and finally, they get deleted.
1171 AIDE is supposed to handle all those cases without generating reports,
1172 and it is still expected to flag the cases when
1173 an attacker tampers with logs.
1174 .PP
1175 The following examples suggest a way to handle the
1176 common case of log rotation with the logrotate(8) program,
1177 with its options \fBcompress\fR, \fBdelaycompress\fR and \fBnocopytruncate\fR set.
1178 The vast majority of logs are rotated this way on most Linux systems.
1179 .TP
1180 .B "\fBActLog\fR=Full+growing+ANF+I"
1181 .TQ
1182 .B "/var/log/foo\e\e.log$ f ActLog"
1183 An Active Log is typically named foo.log.
1184 It is constanty being written to.
1185 The file does neither change its mode nor its inode number.
1186 The size only increases,
1187 and what is written to the file is not supposed to change (growing).
1188 During log rotation,
1189 foo.log is typically renamed to foo.log.1 (or foo.log.0)
1190 and the process is instructed to write to a new foo.log.
1191 Log content is written to a new file (ANF)
1192 and will eventually be renamed to foo.log.1 (I).
1193 The growing attribute suppresses reports for files that
1194 just had content appended when compared to the database.
1195 A change of the old content is still reported!
1196 .TP
1197 .B "\fBRotLog\fR=Full"
1198 .TQ
1199 .B "/var/log/foo\e\e.log\e\e.1$ f RotLog"
1200 foo.log.0 or foo.log.1 is called the Rotated Log,
1201 the previously active log renamed to the
1202 first name of the Log Series that is formed by the rotation mechanism.
1203 Right after rotation, the file might still being written to by the daemon.
1204 To aide, this looks like the Active Log's size decreases and its
1205 inode and timestamps change.
1206 The Rotated Log is not supposed to change its attributes
1207 once the process has stopped writing to it.
1208 Reports might be generated if aide runs while the process
1209 still writes to the Rotated Log,
1210 but this is quite unlikely to happen.
1211 Some log rotation mechanisms rename
1212 foo.log to foo.log.0 to foo.log.1.gz,
1213 others rename foo.log to foo.log.1 to foo.2.log.gz.
1214 .TP
1215 .B "\fBCompSerLog\fR=Full+I+compressed"
1216 .TQ
1217 .B "/var/log/foo\e\e.log\e\e.2\e\e.gz$ f CompSerLog"
1218 In the next rotation step,
1219 foo.log.1 gets compressed to foo.log.2.gz,
1220 becoming the Compressed Log in the Log Series.
1221 With this rule,
1222 AIDE does not report this step because it
1223 uncompresses the contents of the file
1224 and takes the checksum of the uncompressed content.
1225 The contents strictly doesn't change,
1226 but some attribute changes are ignored (compressed).
1227 .TP
1228 .B "\fBMidlSerLog\fR=Full+I"
1229 .TQ
1230 .B "/var/log/foo\e\e.log\e\e.[345]\e\e.gz$ f MidlSerLog"
1231 In the next log rotation, all foo.log.{x} get renamed to foo.log.{x+1}.
1232 The other attributes are not supposed to change.
1233 .TP
1234 .B "\fBLastSerLog\fR=Full+ARF"
1235 .TQ
1236 .B "/var/log/foo\e\e.log\e\e.6\e\e.gz$ f LastSerLog"
1237 The configuration of the log rotation process specifies a number of log
1238 generations to keep. The last log in the series is therefore removed
1239 from the disk (ARF).
1240 .PP
1241 aide 0.18 does not yet support the following cases of log rotation:
1242 .TP
1243 .B "empty files"
1244 It might be the case that a log is actually created, but never written to.
1245 This commonly happens on rarely used web servers that use the log rotation
1246 as a method to cater for data protection regulation.
1247 In result, all files in a series are identical,
1248 breaking the heuristics that aide uses to detect log rotation.
1249 A possible workaround is to begin a newly rotated log with a timestamp.
1250 With logrotate, this can be done in a postrotate scriptlet.
1251 .TP
1252 .B "nodelaycompress"
1253 With logrotate's \fBnodelaycompress\fR option,
1254 a log is immediately compressed after renaming it from the Active Log name.
1255 For the time being, it is recommended to always use the \fBdelaycompress\fR option
1256 to avoid this behavior.
1257 .TP
1258 .B "copytruncate"
1259 With logrotate's \fBcopytruncate\fR option,
1260 the Active Log is not renamed and newly created but
1261 copied to the new file name.
1262 After the copy operation, the old file is truncated to zero size,
1263 allowing the daemon to continuously write to the already open file handle.
1264 aide uses the Inode number to detect the rotation process.
1265 That doesn't work with \fBcopytruncate\fR because the Inode stays
1266 with the Active Log.
1267 For the time being, it is recommended to avoid the \fBcopytruncate\fR option
1268 to avoid this behavior.
1269 .PP
1270 .SH HINTS
1271 In the following, the first is not allowed in AIDE. Use the latter instead.
1272 .IP
1273 .B "/foo epug"
1274 .IP
1275 .B "/foo e+p+u+g"
1276 .PP
1277 .SH "SEE ALSO"
1278 .BR aide (1)
1279 .SH DISCLAIMER
1280 All trademarks are the property of their respective owners.
1281 No animals were harmed while making this webpage or this piece of
1282 software.