Interview Prep/Linux/Security, hardening and incident response

You need to know when anyone modifies `/etc/sudoers`, `/etc/passwd` or SSH config. How?

IntermediateScenarioSecurity, hardening and incident response
Answer

Situation read → File watch rules with auditd, shipped centrally.

What I'd do → /etc/audit/rules.d/50-identity.rules:

-w /etc/passwd -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/sudoers -p wa -k sudoers
-w /etc/sudoers.d/ -p wa -k sudoers
-w /etc/ssh/sshd_config -p wa -k sshd

Load with sudo augenrules --load, query with ausearch -k sudoers -i.

Why → auditd records who (auid survives sudo), when and with which process.

Interview tip → Mention auid (login UID), which shows the original user even after sudo su -.

All Linux questions Roadmap: Linux

More on Security, hardening and incident response