File system security is essential for ensuring that sensitive data is protected from unauthorized access and modifications. This project will guide you through a file system security assessment, focusing on identifying unauthorized access and changes to files. You will use various tools to monitor, analyze, and secure the file system.
- Basic understanding of file system concepts (permissions, file types, etc.)
- Familiarity with the Linux command line
- A computer with a Linux operating system (preferably Ubuntu)
- Internet connection to download necessary tools
- Lab Environment: A single Linux machine with sudo access.
- Tools:
- Auditd
- Tripwire
- AIDE (Advanced Intrusion Detection Environment)
- OSSEC
- Chkrootkit
Objective: Use Auditd to monitor and log file access events.
Steps:
-
Install Auditd:
sudo apt-get update sudo apt-get install auditd
-
Configure Audit Rules:
sudo auditctl -w /etc/passwd -p wa -k passwd_changes
- This command sets up monitoring for write and attribute change access to
/etc/passwd
.
- This command sets up monitoring for write and attribute change access to
-
View Audit Logs:
sudo ausearch -k passwd_changes
Expected Output:
- Log entries showing access events for the monitored file.
Objective: Use Tripwire to detect unauthorized changes to files.
Steps:
-
Install Tripwire:
sudo apt-get install tripwire
-
Initialize Tripwire Database:
sudo tripwire --init
-
Run a File Integrity Check:
sudo tripwire --check
Expected Output:
- Report detailing any changes or modifications to the monitored files.
Objective: Use AIDE to perform a system integrity check.
Steps:
-
Install AIDE:
sudo apt-get install aide
-
Initialize AIDE Database:
sudo aideinit
-
Run an Integrity Check:
sudo aide --check
Expected Output:
- Report highlighting any differences between the current file system state and the baseline.
Objective: Use OSSEC to monitor the system for suspicious activity.
Steps:
-
Install OSSEC:
wget -q -O - https://updates.atomicorp.com/installers/atomic | sudo bash sudo yum install ossec-hids ossec-hids-server
-
Configure OSSEC:
- Edit
/var/ossec/etc/ossec.conf
to define what should be monitored.
- Edit
-
Start OSSEC:
sudo systemctl start ossec
-
View Alerts:
sudo tail -f /var/ossec/logs/alerts/alerts.log
Expected Output:
- Log entries showing detected suspicious activity.
Objective: Use Chkrootkit to detect rootkits on the system.
Steps:
-
Install Chkrootkit:
sudo apt-get install chkrootkit
-
Run Chkrootkit:
sudo chkrootkit
Expected Output:
- Report indicating whether any rootkits were found on the system.
By completing these exercises, you have learned how to monitor and assess file system security to detect unauthorized access and modifications. These skills are essential for maintaining the integrity and confidentiality of sensitive data in your system.