| -b <backlog> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set max number of outstanding audit buffers allowed (Kernel Default=64) If all buffers are full, the failure flag is consulted by the kernel for action. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -e [0|1] | Set enabled flag. This can be used to temporarily disable auditing or re-enable it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -f [0..2] | Set failure flag 0=silent 1=printk 2=panic. This option lets you determine how you want the kernel to handle critical errors. Example conditions where this flag is consulted includes: transmission errors to userspace audit daemon, backlog limit exceeded, out of kernel memory, and rate limit exceeded. The default value is 1. Secure environments will probably want to set this to 2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -h | Help | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -i | Ignore errors when reading rules from a file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -l | List all rules 1 per line. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -k <key> | Set a filter key on an audit rule. The filter key is an arbitrary string of text that can be up to 31 bytes long. It can uniquely identify the audit records produced by the watch. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -m text | Send a user space message into the audit system. This can only be done by the root user. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -p [r|w|x|a] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set permissions filter for a file system watch. r=read, w=write, x=execute, a=attribute change. These permissions are not the standard file permissions, but rather the kind of syscall that would do this kind of thing. The read & write syscalls are omitted from this set since they would overwhelm the logs. But rather for reads or writes, the open flags are looked at to see what permission was requested. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -r <rate> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set limit in messages/sec (0=none). If this rate is non-zero and is exceeded, the failure flag is consulted by the kernel for action. The default value is 0. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -R <file> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Read rules from a file. The rules must be 1 per line and in the order that they are to be executed in. The rule file must be owned by root and not readable by other users or it will be rejected. The rule file may have comments embedded by starting the line with a # character. Rules that are read from a file are identical to what you would type on a command line except they are not preceeded by auditctl (since auditctl is the one executing the file). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -s | Report status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -a <l,a> |
Append rule to the end of <l>ist with <a>ction. Please note the comma separating the two values. Omitting it will cause errors. The following describes the valid list names:
The following describes the valid actions for the rule:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -A <l,a> | Add rule to the beginning <l>ist with <a>ction | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -d <l,a> | Delete rule from <l>ist with <a>ction. The rule is deleted only if it exactly matches syscall name and field names. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -D | Delete all rules and watches. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -S [Syscall name or number|all] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Any syscall name or number may be used. The word all may also be used.If this syscall is made by a program, then start an audit record. If a field rule is given and no syscall is specified, it will default to all syscalls. You may also specify multiple syscalls in the same rule. Doing so improves performance since fewer rules need to be evaluated. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -F [n=v | n!=v | n<v | n>v | n<=v | n>=v] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Build a rule field: name, operation, value. You may have up to 64 fields passed on a single command line. Each one must start with -F. Each field equation is anded with each other to trigger an audit record. There are 6 operators supported - equal, not equal, less than, greater than, less than or equal, and greater than or equal. Fields that take a user ID may instead have the users name; the program will convert the name to user ID. The same is true of group names. Valid fields are:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -w <path> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Insert a watch for the file system object at <path>. You cannot insert a watch to the top level directory. This is prohibited by the kernel. Wildcards are not supported either and will generate a warning. The way that watches work is by tracking the inode internally. This means that if you put a watch on a directory, you will see what appears to be file events, but it is really just the updating of meta data. You might miss a few events by doing this. If you need to watch all files in a directory, its recommended to place an individual watch on each file. Unlike syscall auditing rules, watches do not impact performance based on the number of rules sent to the kernel. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -W <path> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Remove a watch for the file system object at <path> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
auditctl -a entry,always -S all -F pid=1005
To see files opened by a specific user:
auditctl -a exit,always -S open -F auid=510
To see unsuccessful open calls:
auditctl -a exit,always -S open -F success!=0