1AIDE.CONF(5) AIDE AIDE.CONF(5)
2
3
4
6 aide.conf - The configuration file for Advanced Intrusion Detection En‐
7 vironment
8
10 aide.conf is the configuration file for Advanced Intrusion Detection
11 Environment. aide.conf contains the runtime configuration aide uses to
12 initialize or check the AIDE database.
13
15 aide.conf is case-sensitive. Leading and trailing white spaces are ig‐
16 nored. Each config lines must end with new line.
17
18 AIDE uses the backslash character (\) as escape character for ' '
19 (space), '@' and '\' (backslash) (e.g. '\ ' or '\@'). To literally
20 match a '\' in a file path with a regular expression you have to escape
21 the backslash twice (i.e. '\\\\').
22
23 There are three types of lines in aide.conf. First there are the con‐
24 figuration options which are used to set configuration parameters and
25 define groups. Second, there are (restricted) rules that are used to
26 indicate which files are added to the database. Third, macro lines de‐
27 fine or undefine variables within the config file. Lines beginning with
28 # are ignored as comments.
29
31 These lines have the format parameter=value. See URLS for a list of
32 valid urls.
33
34 database_in (type: URL, default: see --version output, added in AIDE
35 v0.17)
36 database (DEPRECATED since AIDE v0.17, will be removed in AIDE v0.19)
37 The url from which database is read. There can only be one of
38 these lines. If there are multiple database lines then the first
39 is used.
40
41 Examples:
42
43 database_in=file:/var/lib/aide/aide.db
44
45 Read database locally from /var/lib/aide/aide.db.
46
47
48 database_in=stdin
49
50 Read database from stdin.
51
52
53 database_in=https://example.com/aide.db
54
55 Read database remotely from https://example.com/aide.db.
56
57
58
59
60 database_out (type: URL, default: see --version output)
61 The url to which the new database is written to. There can only
62 be one of these lines. If there are multiple database_out lines
63 then the first is used.
64
65 database_new (type: URL, default: <none>)
66 The url from which the other database for --compare is read.
67
68 database_attrs (type: attribute expression, default: H, added in AIDE
69 v0.16)
70 The attributes of the (uncompressed) database files which are to
71 be added to the reports in report level >= database_attributes .
72 Only checksum attributes are supported. To disable set data‐
73 base_attrs to 'E'.
74
75 database_add_metadata (type: bool, default: true, added in AIDE v0.16)
76 Whether to add the AIDE version and the time of database genera‐
77 tion as comments to the database file or not. This option may be
78 set to false by default in a future release.
79
80
81 log_level (type: log level, default: warning, added in AIDE v0.17)
82 The log level to use. Log messages are written to stderr. If
83 there are multiple log_level lines then the first one is used.
84 The --log-level or -L command line option overwrites this op‐
85 tion.
86
87 The following log levels are available:
88
89 error: show unrecoverable issues that have to be handled
90 by the user. Errors are fatal to the AIDE process.
91
92 warning: additionally show recoverable issues that most
93 likely lead to unexpected behaviour and should be handled
94 by the user
95
96 notice: additionally show recoverable issues that some‐
97 times lead to unexpected behaviour and might be handled
98 by the user.
99
100 info: additionally show informational messages
101
102 rule: additionally show messages to help to debug the
103 path rule matching
104
105 compare: additionally show messages to help to debug file
106 comparison and (special) attribute handling
107
108 config: additionally show messages to help to debug con‐
109 fig and rule parsing
110
111 debug: additionally show messages that are useful to de‐
112 bug the application (very verbose)
113
114 thread: additionally show messages about thread process‐
115 ing (e.g. broadcast events)
116
117 trace: detailed information about the flow of the appli‐
118 cation (e.g. in-loop logging) (even more verbose)
119
120
121
122
123 verbose (type: number, range: 0 - 255, default: 5, REMOVED in AIDE
124 v0.17)
125 Removed, use log_level and report_level options instead.
126
127 gzip_dbout (type: bool, default: false)
128 Whether the output to the database is gzipped or not. This op‐
129 tion is available only if zlib support is compiled in.
130
131 root_prefix (type: path, default: <empty>, added in AIDE v0.16)
132 The prefix to strip from each file name in the file system be‐
133 fore applying the rules and writing to database. AIDE removes a
134 trailing slash from the prefix. If there are multiple root_pre‐
135 fix lines then the first one is used. This option has no effect
136 in compare mode.
137
138 acl_no_symlink_follow (type: bool, default: false)
139 Whether to check ACLs for symlinks or not. This option is avail‐
140 able only if acl support is compiled in.
141
142 warn_dead_symlinks (type: path, default: false)
143 Whether to warn about dead symlinks or not.
144
145 config_version (type: string, default: <empty>)
146 The value of config_version is printed in the report and also
147 printed to the database. This is for informational purposes
148 only. It has no other functionality.
149
150 config_check_warn_unrestricted_rules (type: bool, default: false, added
151 in AIDE v0.18)
152 Whether to warn on unrestricted rules during config check. To
153 explicitly define unrestricted rules use 0 (zero) as restriction
154 character.
155
156 num_workers (type: number|percentage, default: 1, added in AIDE v0.18)
157 Specifies the number of simultaneous workers (threads) for file
158 attribute processing (i.a. hashsum calculation).
159
160 The number of workers can be a positive integer (e.g. '4') or
161 the percentage of the available processors (e.g. '60%'). The re‐
162 sulting number of workers is rounded up to the next integer
163 (e.g. '60%' of 8 processors results in 5 workers).
164
165 If there are multiple num_workers lines then the first one is
166 used.
167
168 Use 0 (zero) to disable multi-threading.
169
170 The default value 1 (single worker thread) may be changed in a
171 future release.
172
173
175 report_url (type: URL, default: stdout)
176
177 The URL that the output is written to.
178
179 Multiple instances of the report_url option are supported.
180
181 Examples:
182
183 report_url=file:/var/log/aide.log
184
185 Write report to /var/log/aide.log.
186
187 report_url=stdout
188
189 Write report to stdout.
190
191 report_url=syslog:<LOG_FACILITY>
192
193 Write report to syslog using LOG_FACILITY.
194
195
196
197 The following report options are available (to take effect they have to
198 be set before report_url):
199
200 report_level (type: report level, default: changed_attributes, added in
201 AIDE v0.17)
202
203 The report level to use. The available report levels are as fol‐
204 lows:
205
206 minimal: print single line whether AIDE found differences to the
207 database
208
209 summary: additionally print number of added, removed and changed
210 files
211
212 database_attributes: additionally print database checksums
213
214 list_entries: additionally print lists of added, removed and
215 changed entries
216
217 changed_attributes: additionally print details about changed en‐
218 tries
219
220 Example:
221
222 File: /var/lib/apt/extended_states
223 Perm : -rw-r--r-- | -rw-------
224 Uid : 0 | 106
225
226
227 The left column shows the old value (e.g. from the data‐
228 base_in database) and the right column shows the new
229 value (e.g. from the file system).
230
231
232 added_removed_attributes: additionally print details about added
233 and removed attributes
234
235 added_removed_entries: additionally print details about added
236 and removed entries
237
238
239 report_format (type: report format, default: plain, added in AIDE
240 v0.18)
241 The report format to use. The available report formats are as
242 follows:
243
244 plain: Print report in plain human-readable format.
245
246 json: Print report in json machine-readable format.
247
248
249 report_base16 (type: bool, default: false, added in AIDE v0.17)
250 Base16 encode the checksums in the report. The default is to re‐
251 port checksums in base64 encoding.
252
253 report_detailed_init (type: bool, default: false, added in AIDE v0.16)
254 Report added files (report level >= list_entries) and their de‐
255 tails (report level >= added_removed_entries) in initialization
256 mode.
257
258 report_quiet (type: bool, default: false, added in AIDE v0.16)
259 Suppress report output if no differences to the database have
260 been found.
261
262 report_append (type: bool, default: false, added in AIDE v0.17)
263 Append to the report URL.
264
265 report_grouped (type: bool, default: true, added in AIDE v0.17)
266 grouped (DEPRECATED since AIDE v0.17, will be removed in AIDE v0.19)
267 Group the files in the report by added, removed and changed
268 files.
269
270 report_summarize_changes (type: bool, default: true, added in AIDE
271 v0.17)
272 summarize_changes (DEPRECATED since AIDE v0.17, will be removed in AIDE
273 v0.19)
274 Summarize changes in the added, removed and changed files sec‐
275 tions of the report.
276
277 The general format is like the string YlZbpugamcinHAXSEC, where
278 Y is replaced by the file-type ('f' for a regular file, 'd' for
279 a directory, 'l' for a symbolic link, 'c' for a character de‐
280 vice, 'b' for a block device, 'p' for a FIFO, 's' for a unix
281 socket, 'D' for a Solaris door, 'P' for a Solaris event port,
282 '!' if file type has changed and '?' otherwise).
283
284 The Z is replaced as follows: A '=' means that the size has not
285 changed, a '<' reports a shrinked size and a '>' reports a grown
286 size. The other letters in the string are the actual letters
287 that will be output if the associated attribute for the item has
288 been changed or a '.' for no change.
289
290 Otherwise a '+' is shown if the attribute has been added, a '-'
291 if it has been removed, a ':' if the attribute is ignored (but
292 not forced) or a ' ' if the attribute has not been checked.
293
294 The exceptions to this are: (1) a newly created file replaces
295 each letter with a '+', and (2) a removed file replaces each
296 letter with a '-'.
297
298 The attribute that is associated with each letter is as follows:
299
300
301 o A l means that the link name has changed.
302
303 o A b means that the block count has changed.
304
305 o A p means that the permissions have changed.
306
307 o An u means that the uid has changed.
308
309 o A g means that the gid has changed.
310
311 o An a means that the access time has changed.
312
313 o A m means that the modification time has changed.
314
315 o A c means that the change time has changed.
316
317 o An i means that the inode has changed.
318
319 o A n means that the link count has changed.
320
321 o A H means that one or more message digests have changed.
322
323 The following letters are only available when explicitly enabled
324 using configure:
325
326
327 o A A means that the access control list has changed.
328
329 o A X means that the extended attributes have changed.
330
331 o A S means that the SELinux attributes have changed.
332
333 o A E means that the file attributes on a second extended
334 file system have changed.
335
336 o A C means that the file capabilities have changed.
337
338 report_ignore_added_attrs (type: attribute expression, default: empty,
339 added in AIDE v0.16)
340 Attributes whose addition is to be ignored in the report.
341
342 report_ignore_removed_attrs (type: attribute expression, default:
343 empty, added in AIDE v0.16)
344 Attributes whose removal is to be ignored in the report.
345
346 report_ignore_changed_attrs (type: attribute expression, default:
347 empty, added in AIDE v0.16)
348 ignore_list (REMOVED in AIDE v0.17)
349 Attributes whose change is to be ignored in the report.
350
351 report_force_attrs (type: attribute expression, default: empty, added
352 in AIDE v0.16)
353 report_attributes (REMOVED in AIDE v0.17)
354 Attributes which are always printed in the report for changed
355 files. If an attribute is both ignored and forced the attribute
356 is not considered for file change but printed in the final re‐
357 port as long as the file has been otherwise changed.
358
359 report_ignore_e2fsattrs (type: string, default: 0, added in AIDE v0.16)
360 List (no delimiter) of ext2 file attributes which are to be ig‐
361 nored in the report. See chattr(1) for the available at‐
362 tributes. Use 0 (zero) to not ignore any attribute. Ignored at‐
363 tributes are represented by a ':' in the report.
364
365 By default AIDE also reports changes of the read-only attributes
366 mentioned in chattr(1) (see example below how to ignore those
367 changes).
368
369 Example:
370
371 Ignore changes of the read-only ext2 file attributes verify
372 (V), inline data (N), indexed directory (I) and encrypted
373 (E):
374
375 report_ignore_e2fsattrs=VNIE
376
377
379 Groups are aggregations of attributes.
380
381 Group definitions have the format <group name> = <attribute expres‐
382 sion>.
383
384 Group names are limited to alphanumeric characters (A-Za-z0-9).
385
386 See ATTRIBUTES for a description of all available attributes.
387
388
389 Default groups
390
391 R p+ftype+i+l+n+u+g+s+m+c+md5+X
392
393 L p+ftype+i+l+n+u+g+X
394
395 > Growing file p+ftype+l+u+g+i+n+s+growing+X
396
397 H all compiled in hashsums (added in AIDE v0.17)
398
399 X acl+selinux+xattrs+e2fsattrs+caps (if attributes are compiled
400 in, added in AIDE v0.16)
401
402 E Empty group
403
404 Use 'aide --version' to list the default compound groups.
405
406
407
409 AIDE supports three types of rules:
410
411 Regular rule:
412 <regex> <attribute expression>
413
414 Files and directories matching the regular expression are added
415 to the database.
416
417
418 Negative rule:
419 !<regex>
420
421 Files and directories matching the regular expression are ig‐
422 nored and not added to the database. The children of matching
423 directories are also ignored.
424
425
426 Equals rule:
427 =<regex> <attribute expression>
428
429 Files and directories matching the regular expression are added
430 to the database. The children of directories are only added if
431 the regular expression ends with a "/". The children of sub-di‐
432 rectories are not added at all.
433
434
435 Every regular expression has to start with an explicit "/". An im‐
436 plicit ^ is added in front of each regular expression. In other words,
437 the regular expressions are matched at the first position against the
438 complete path. Special characters can be escaped using two-digit URL
439 encoding (for example, %20 to represent a space).
440
441 AIDE uses a deepest-match algorithm to find the tree node to search,
442 but a first-match algorithm inside the node. (see also rule log
443 level).
444
445 See EXAMPLES for examples.
446
447 More in-depth discussion of the selection algorithm can be found in the
448 AIDE manual.
449
451 Restricted rules are like normal rules but can be restricted to file
452 types (added in AIDE v0.16). The following file types are supported:
453
454
455 f restrict rule to regular files
456
457 d restrict rule to directories
458
459 l restrict rule to symbolic links
460
461 c restrict rule to character devices
462
463 b restrict rule to block devices
464
465 p restrict rule to FIFO files
466
467 s restrict rule to UNIX sockets
468
469 D restrict rule to Solaris doors
470
471 P restrict rule to Solaris event ports
472
473 0 empty restriction, i.e. don't restrict rule (added in AIDE
474 v0.18)
475
476 Multiple restrictions can be given as a comma-separated list.
477
478 The syntax of restricted rules is as follows:
479
480 Restricted regular rule
481 <regex> <file types> <attribute expression>
482
483 Restricted negative rule
484 !<regex> <file types>
485
486 Restricted equals rule
487 =<regex> <file types> <attribute expression>
488
489
490
492 @@define VAR val
493 Define variable VAR to value val.
494
495 @@undef VAR
496 Undefine variable VAR.
497
498 @@if boolean_expression (added in AIDE v0.18)
499 @@else
500 @@endif
501 @@if begins an if statement. It must be terminated with an @@en‐
502 dif statement. The lines between @@if and @@endif are used if
503 the boolean_expression evaluates to true. If there is an @@else
504 statement then the part between @@if and @@else is used if bool‐
505 ean_expression evaluates to true otherwise the part between
506 @@else and @@endif is used.
507
508 Available operators and functions in boolean expressions:
509
510 not boolean_expression
511 Evaluates to true if the boolean_expression is false, and
512 false if the boolean_expression is true.
513
514 defined VARIABLE
515
516 Evaluates to true if VARIABLE is defined.
517
518 hostname HOSTNAME
519
520 Evaluates to true if HOSTNAME equals the hostname of the
521 machine that AIDE is running on. hostname is the name of
522 the host without the domainname (ie 'hostname', not 'host‐
523 name.example.com').
524
525 exists PATH
526
527 Evaluates to true if PATH exists.
528
529
530
531 @@ifdef VARIABLE (DEPRECATED since AIDE v0.18, will be removed in AIDE
532 v0.20)
533 same as @@if defined VARIABLE
534
535 @@ifndef VARIABLE (DEPRECATED since AIDE v0.18, will be removed in AIDE
536 v0.20)
537 same as @@if not defined VARIABLE
538
539 @@ifhost HOSTNAME (DEPRECATED since AIDE v0.18, will be removed in AIDE
540 v0.20)
541 same as @@if hostname HOSTNAME
542
543 @@ifnhost HOSTNAME (DEPRECATED since AIDE v0.18, will be removed in
544 AIDE v0.20)
545 same as @@if not hostname HOSTNAME
546
547
548 @@{VAR}
549 @@{VAR} is replaced with the value of the variable VAR. If
550 variable VAR is not defined an empty string is used.
551
552 Variables are supported in strings and in regular expressions of
553 selection lines.
554
555 Pre-defined marco variables:
556
557 @@{HOSTNAME}: hostname of the current system
558
559
560
561 @@include FILE
562 Include FILE.
563
564 The content of the file is used as if it were inserted in this
565 part of the config file.
566
567 The maximum depth of nested includes is 16.
568
569
570 @@include DIRECTORY REGEX [RULE_PREFIX] (added in AIDE v0.17)
571 Include all (regular) files found in DIRECTORY matching regular
572 expression REGEX (sub-directories are ignored). The file are in‐
573 cluded in lexical sort order.
574
575 If RULE_PREFIX is set, all rules included by the statement are
576 prefixed with given RULE_PREFIX (added in AIDE v0.18). Prefixes
577 from nested include statements are concatenated.
578
579 The content of the files is used as if it were inserted in this
580 part of the config file.
581
582
583 @@x_include FILE (added in AIDE v0.17)
584 @@x_include DIRECTORY REGEX [RULE_PREFIX] (added in AIDE v0.17)
585 @x_include is identical to @@include, except that if a config
586 file is executable is is run and the output is used as config.
587
588 If the executable file exits with status greater than zero or
589 writes to stderr aide stops with an error.
590
591 For security reasons DIRECTORY and each executable config file
592 must be owned by the current user or root. They must not be
593 group- or world-writable.
594
595
596 @@x_include_setenv VAR VALUE (added in AIDE v0.17)
597
598 Adds the variable VAR with the value VALUE to the environment
599 used for config file execution.
600
601 Environment variable names are limited to alphanumeric charac‐
602 ters (A-Za-z0-9) and the underscore '_' and must not begin with
603 a digit.
604
605
607 bool
608 Valid values are yes, true, no or false.
609
610 attribute expression
611
612 An attribute expression is of the following form:
613
614 <attribute/group>
615 | <expr> + <attribute/group>
616 | <expr> - <attribute/group>
617
618 URLS
619 Urls can be one of the following. Input urls cannot be used as out‐
620 puts and vice versa.
621
622
623 stdout
624
625 stderr Output is sent to stdout, stderr respectively.
626
627 stdin Input is read from stdin.
628
629 file:/path
630 Input is read from path or output is written to path.
631
632 fd:number
633 Input is read from filedescriptor number or output is
634 written to number.
635
636 syslog:LOG_FACILITY
637 Output is written to syslog using LOG_FACILITY.
638
639
640
641
643 File attributes
644
645 ftype file type (added in AIDE v0.15)
646
647 p permissions
648
649 i inode
650
651 l link name
652
653 n number of links
654
655 u user
656
657 g group
658
659 s size
660
661 b block count
662
663 m mtime
664
665 a atime
666
667 c ctime
668
669 acl access control list (requires libacl)
670
671 selinux
672 selinux attributes (requires libselinux)
673
674 xattrs extended attributes (requires libattr)
675
676 e2fsattrs
677 file attributes on a second extended file system, see also re‐
678 port_ignore_e2fsattrs option (requires libext2fs, added in AIDE
679 v0.15)
680
681 caps file capabilities (requires libcap2, added in AIDE v0.17)
682
683 Use 'aide --version' to show which compiled-in attributes are avail‐
684 able.
685
686 Special attributes
687
688 S check for growing size (DEPRECATED since AIDE v0.18, will be re‐
689 moved in AIDE v0.20)
690
691 Use growing+s attributes instead
692
693 I ignore changed filename
694
695 When I is used, the inode of the old file is used to search for
696 a moved file in the new database.
697
698 Source and target file have to be located in the same directory
699 and must share the same attributes (except for special at‐
700 tributes ANF, ARF, I, growing, and compressed).
701
702 For moved entries a change of the ctime attribute is ignored.
703
704
705 growing
706 ignore growing file (added in AIDE v0.18)
707
708 When growing is used, changes of the following attributes are
709 ignored:
710
711 size: if new size is greater than old size
712
713 bcount: if new bcount is greater than old bcount
714
715 atime: if new atime is greater than old atime
716
717 mtime: if new mtime is greater than old mtime
718
719 ctime: if new ctime is greater than old ctime
720
721 hashsums: if the hashsum of the new file restricted to the old
722 size equals the hashsums of the old file
723
724 For hashsum attributes the growing attribute is ignored in com‐
725 pare mode.
726
727
728 compressed
729 ignore compressed file (added in AIDE v0.18)
730
731 When compressed is used, the uncompressed hashsums of the new
732 compressed file (supported compressions: gzip) are used to
733 search for the uncompressed file in the old database.
734
735 The old uncompressed and the new compressed file have to be lo‐
736 cated in the same directory and must share the same attributes
737 (except for special attributes ANF, ARF, I, growing, and com‐
738 pressed) including at least one hashsum.
739
740 Changes of the inode, size, bcount and ctime attributes are ig‐
741 nored.
742
743 The growing attribute (i.e. the old file size) is not considered
744 for compressed files during the calculation of the uncompressed
745 hashsums.
746
747 The compressed attribute is ignored in compare mode.
748
749
750 ANF allow new files
751
752 When 'ANF' is used, new files are added to the new database, but
753 are ignored in the report.
754
755 ARF allow removed files
756
757 When 'ARF' is used, files missing on disk are omitted from the
758 new database, but are ignored in the report.
759
760 Hashsums attributes
761
762 md5 MD5 checksum (not in libgcrypt FIPS mode)
763
764 sha1 SHA-1 checksum
765
766 sha256 SHA-256 checksum
767
768 sha512 SHA-512 checksum
769
770 rmd160 RIPEMD-160 checksum
771
772 tiger tiger checksum
773
774 haval haval256 checksum (libmhash only)
775
776 crc32 crc32 checksum
777
778 crc32b crc32 checksum (libmhash only)
779
780 gost GOST R 34.11-94 checksum
781
782 whirlpool
783 whirlpool checksum
784
785 stribog256
786 GOST R 34.11-2012, 256 bit checksum (libgcrypt only, added in
787 AIDE v0.17)
788
789 stribog512
790 GOST R 34.11-2012, 512 bit checksum (libgcrypt only, added in
791 AIDE v0.17)
792
793 Use 'aide --version' to show which hashsums are available.
794
795
796
798 / R This adds all files on your machine to the database. This one
799 line is a fully qualified configuration file.
800
801 !/dev$ This ignores the /dev directory structure.
802
803 =/foo R
804 Only /foo and /foobar are taken into the database. None of
805 their children are added.
806
807 =/foo/ R
808 Only /foo and its children (e.g. /foo/file and /foo/directory)
809 are taken into the database. The children of sub-directories
810 (e.g. /foo/directory/bar) are not added.
811
812 / d,f R
813 Only add directories and files to the database
814
815 !/run d
816 /run R Add all but directory entries to the database
817
818 /run d R-m-c-i
819 /run R Use specific rule for directories
820
821 Suggested Groups
822
823 OwnerMode = p+u+g+ftype
824 Check permissions, owner, group and file type
825
826 Size = s+b
827 Check size and block count
828
829 InodeData = OwnerMode+n+i+Size+l+X
830 StaticFile = m+c+Checksums
831 Files that stay static
832
833 Full = InodeData+StaticFile
834 Full = ftype+p+l+u+g+s+m+c+a+i+b+n+H+X
835 / 0 Full
836 This line defines group Full. It has all attributes, all com‐
837 piled in hashsums (H) and all compiled in extra file attributes
838 (X). See '--version' output for the compiled in hashsums and
839 extra groups. The example rule is the typical catch-all rule at
840 the end of the rule list.
841
842 VarTime = InodeData+Checksums
843 /etc/ssl/certs/ca-certificates\\.crt$ VarTime
844 Files that change their mtimes or ctimes but not their contents.
845
846 VarInode = VarTime-i
847 /var/lib/nfs/etab$ f VarInode
848 Files that are recreated regularly but do not change their con‐
849 tents
850
851 VarFile = OwnerMode+n+l+X
852 /etc/resolv\\.conf$ f VarFile
853 Files that change their contents during system operation
854
855 VarDir = OwnerMode+n+i+X
856 /var/lib/snmp$ d VarDir
857 Directories that change their contents during system operation
858
859 RecreatedDir = OwnerMode+n+X
860 /run/samba$ d RecreatedDir
861 Directories that are recreated regularly and change their con‐
862 tents
863
864 Log Handling
865
866 Logs pose a number of special challenges to AIDE. An active log is
867 nearly constantly being written to. The process of log rotation
868 changes file names for files that are supposed to have unaltered con‐
869 tents. To save space, Logs are compressed in the process of their ro‐
870 tation, and finally, they get deleted. AIDE is supposed to handle all
871 those cases without generating reports, and it is still expected to
872 flag the cases when an attacker tampers with logs.
873
874 The following examples suggest a way to handle the common case of log
875 rotation with the logrotate(8) program, with its options compress, de‐
876 laycompress and nocopytruncate set. The vast majority of logs are ro‐
877 tated this way on most Linux systems.
878
879 ActLog=Full+growing+ANF+I
880 /var/log/foo\\.log$ f ActLog
881 An Active Log is typically named foo.log. It is constanty being
882 written to. The file does neither change its mode nor its inode
883 number. The size only increases, and what is written to the
884 file is not supposed to change (growing). During log rotation,
885 foo.log is typically renamed to foo.log.1 (or foo.log.0) and the
886 process is instructed to write to a new foo.log. Log content is
887 written to a new file (ANF) and will eventually be renamed to
888 foo.log.1 (I). The growing attribute suppresses reports for
889 files that just had content appended when compared to the data‐
890 base. A change of the old content is still reported!
891
892 RotLog=Full
893 /var/log/foo\\.log\\.1$ f RogLog
894 foo.log.0 or foo.log.1 is called the Rotated Log, the previously
895 active log renamed to the first name of the Log Series that is
896 formed by the rotation mechanism. Right after rotation, the
897 file might still being written to by the daemon. To aide, this
898 looks like the Active Log's size decreases and its inode and
899 timestamps change. The Rotated Log is not supposed to change
900 its attributes once the process has stopped writing to it. Re‐
901 ports might be generated if aide runs while the process still
902 writes to the Rotated Log, but this is quite unlikely to happen.
903 Some log rotation mechanisms rename foo.log to foo.log.0 to
904 foo.log.1.gz, others rename foo.log to foo.log.1 to
905 foo.2.log.gz.
906
907 CompSerLog=Full+I+compressed
908 /var/log/foo\\.log\\.2\\.gz$ f CompSerLog
909 In the next rotation step, foo.log.1 gets compressed to
910 foo.log.2.gz, becoming the Compressed Log in the Log Series.
911 With this rule, AIDE does not report this step because it uncom‐
912 presses the contents of the file and takes the checksum of the
913 uncompressed content. The contents strictly doesn't change, but
914 some attribute changes are ignored (compressed).
915
916 MidlSerLog=Full+I
917 /var/log/foo\\.log\\.[345]\\.gz$ f MidlSerLog
918 In the next log rotation, all foo.log.{x} get renamed to
919 foo.log.{x+1}. The other attributes are not supposed to change.
920
921 LastSerLog=Full+ARF
922 /var/log/foo\\.log\\.6\\.gz$ f LastSerLog
923 The configuration of the log rotation process specifies a number
924 of log generations to keep. The last log in the series is there‐
925 fore removed from the disk (ARF).
926
927 aide 0.18 does not yet support the following cases of log rotation:
928
929 empty files
930 It might be the case that a log is actually created, but never
931 written to. This commonly happens on rarely used web servers
932 that use the log rotation as a method to cater for data protec‐
933 tion regulation. In result, all files in a series are identi‐
934 cal, breaking the heuristics that aide uses to detect log rota‐
935 tion. A possible workaround is to begin a newly rotated log
936 with a timestamp. With logrotate, this can be done in a postro‐
937 tate scriptlet.
938
939 nodelaycompress
940 With logrotate's nodelaycompress option, a log is immediately
941 compressed after renaming it from the Active Log name. For the
942 time being, it is recommended to always use the delaycompress
943 option to avoid this behavior.
944
945 copytruncate
946 With logrotate's copytruncate option, the Active Log is not re‐
947 named and newly created but copied to the new file name. After
948 the copy operation, the old file is truncated to zero size, al‐
949 lowing the daemon to continuously write to the already open file
950 handle. aide uses the Inode number to detect the rotation
951 process. That doesn't work with copytruncate because the Inode
952 stays with the Active Log. For the time being, it is recom‐
953 mended to avoid the copytruncate option to avoid this behavior.
954
956 In the following, the first is not allowed in AIDE. Use the latter in‐
957 stead.
958
959 /foo epug
960
961 /foo e+p+u+g
962
964 aide(1)
965
967 All trademarks are the property of their respective owners. No animals
968 were harmed while making this webpage or this piece of software.
969
970
971
972aide v0.18.4 2023-06-13 AIDE.CONF(5)