Understanding the popular Linux auditing system Auditd is important for being able to efficiently and effectively monitor IT systems. The Auditd package allows fine-tuned monitoring that is crucially important for security applications such as host intrusion detection. In this hands-on lab, we will create and use custom audit rules to monitor sensitive configuration files.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create audit rules to watch `/etc/passwd` for reads, `/etc/sudoers/` for reads and writes, and `/sbin/visudo` for executions.
Run the following commands:
auditctl -w /etc/passwd -p w -k userwatch
auditctl -w /sbin/visudo -p x -k sudowatch
auditctl -w /etc/sudoers -p rw -k sudowatch
- Generate an audit rule list in `/home/cloud_user/rules.txt`.
Run the command:
auditctl -l > /home/cloud_user/rules.txt
- Generate logs by creating a new user and running the `visudo` command.
Run the following commands:
useradd bob
visudo
- Generate the `userwatch.txt` and `sudowatch.txt` reports in `/home/cloud_user` by using the established audit keys `userwatch` and `sudowatch`, respectively.
Run the following commands:
ausearch -k userwatch > /home/cloud_user/userwatch.txt
ausearch -k sudowatch > /home/cloud_user/sudowatch.txt