iac.htora.dev · security templates

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

  1. Someone changes a watched file or runs a command as root: after signing in as themselves.
  2. The kernel records it: with the signed-in account, which sudo does not change.
  3. auditd writes it: tagged with a key you search by.
  4. syslog carries it off the host: through the host log template (Standard).
PlatformUsesThe part that catches people
Linuxauditd rules in /etc/audit/rules.d, loaded with augenrulesauditd refuses a plain systemctl restart.

Run the quick start

Reach the Linux machinesansible all -i inventory.ini -m ping
Previewansible-playbook -i inventory.ini playbook.yml --check --diff
Runansible-playbook -i inventory.ini playbook.yml
Run again, expect changed=0ansible-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.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.