Hands-on task
sudo audit: who quietly became root
An access audit on the server. Three service accounts should have only the rights their jobs need: deployer restarts the service (/usr/bin/systemctl restart app), monitor checks the size of the logs (/usr/bin/du -sh /var/log), and archiver shouldn't have sudo at all. But the rules have piled up over the years, and one of them has effectively been given full root through sudo.
Remove everything that lets these accounts run arbitrary commands through sudo, keep both job rules, and don't break the sudo configuration. Don't delete the accounts themselves or their groups.
- sudo -l -U
- sudoers.d
- User_Alias
- NOPASSWD
- visudo -c
- access audit