Information
Record events affecting the modification of user or group information, including that of passwords and old passwords if in use.
- /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use
Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts.
Solution
- Add the audit rule(s) that monitor changes to /etc/security/opasswd . The procedure adds each rule only for targets that exist, so augenrules --load does not error. Run:
#!/usr/bin/env bash
{
[ -e /etc/security/opasswd ] && printf '%s\n' "-a always,exit -S all -F path=/etc/security/opasswd -F perm=wa -F key=identity"
} >> /etc/audit/rules.d/50-identity.rules
- Merge and load the rules into active configuration:
# augenrules --load
- Check if reboot is required:
# if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi