Home/Refreshers/Record what investigations ask first: refresher
Record what investigations ask first
auditd rules on Linux for account changes, sudo rights, SSH keys, persistence, kernel modules, and commands people ran as root.
Remember
- Someone changes a watched file or runs a command as root: after signing in as themselves.
- The kernel records it: with the signed-in account, which sudo does not change.
- auditd writes it: tagged with a key you search by.
- syslog carries it off the host: through the host log template (Standard).
| Platform | Uses | The part that catches people |
|---|---|---|
| Linux | auditd rules in /etc/audit/rules.d, loaded with augenrules | auditd refuses a plain systemctl restart. |
Run the quick start
| Reach the Linux machines | ansible all -i inventory.ini -m ping |
| Preview | ansible-playbook -i inventory.ini playbook.yml --check --diff |
| Run | ansible-playbook -i inventory.ini playbook.yml |
| Run again, expect changed=0 | ansible-playbook -i inventory.ini playbook.yml |
Watch out
- Every rule carries a key.
- auid is the account that signed in.
Check it worked
Change a watched file, such as adding a file to /etc/sudoers.d. ausearch -k privilege shows it with the account that did it.