Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
The audit daemon writes security events. ausearch filters them by message type (-m AVC for SELinux denials), time (-ts recent = last 10 minutes, today, boot), program, user, file or audit key. -i turns numbers (UIDs, syscalls, times) into names.
Zo schrijf je het
ausearch [OPTION]...Opties 38
Meest gebruikt
What
Who
When
Output and input
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1Recent SELinux denials
ausearch -m AVC -ts recentLast 10 minutes.
2Denials of one program today
ausearch -m AVC -c httpd -ts today -i-i gives readable names and times.
3Since the last boot
ausearch -m AVC,USER_AVC,SELINUX_ERR -ts bootAll SELinux problems of this boot.
4Explain the denials
ausearch -m AVC -ts recent | audit2whySays if a label, boolean or missing rule is the cause.
5Failed logins (security)
ausearch -m USER_LOGIN -sv no -ts today -iWho failed to log in, from where.
6Who really did it (after sudo)
ausearch -ul 1001 -ts today -i | lessloginuid stays the original user.
7Watch a file with an audit rule
auditctl -w /etc/passwd -p wa -k passwd_changes ausearch -k passwd_changes -iEvery write to /etc/passwd with user and program.
8SELinux mode changes
ausearch -m MAC_STATUS -ts this-week -iWho ran setenforce.
9Commands run as root
Needs audit rules for execve.
10Summary reports
aureport --avc --summary aureport -au -ts todayCounts instead of single events.
Niets past bij dit filter.
Bestanden
/var/log/audit/audit.log- The audit log.
/etc/audit/rules.d/- Audit rules.
/etc/audit/auditd.conf- auditd settings.
Exitcodes
0 | Events found. |
1 | Nothing found or error. |