Audit Framework
Kernel
To ensure that all process which may have started before
auditd are marked as auditable use boot time kernel param
audit=1.
Userspace
- Install the
auditpackage, enable and start theauditd.service. - The config file is
auditd.conf. - The rules are defined in
/etc/audit/audit.rules. auditctlcan be used to edit rules on the fly.ausearchandaureportare used to summarize and view data.
Rules
Read from
/etc/audit/auditd.rulesIf for example
/etc/audit/rules.d/syscalls.rulesis the sort of structure being followed,augenrulesis used to merge all the component rules files.- It is recommended to run first with the
--checkflag and--loadcan be used if there were no errors found. - The files are concatenated in order, based on their natural sort (see -v option of ls(1)) and stripped of empty and comment (#) lines.
- It is recommended to run first with the
rulesets:
- syscalls
- format:
-a action,list -S syscall -F field=value -k keyname
- format:
- files
- format:
-w path-to-file -p permissions -k keyname
- format:
- ..?
- syscalls
Further Reading
manpages (list here)- archwiki article
- syscalls docs
- update the format for rules