50 System Hardening – Advanced Intrusion Detection Environment (AIDE)
Julian Romano and Mathew J. Heath Van Horn, PhD
AIDE (Advanced Intrusion Detection Environment) is an integrity checker used to detect authorized and unauthorized changes to a system. It is a host intrusion detection system that works by creating a baseline of the system and producing alerts based on comparing the current system state to the baseline. AIDE can help identify tampering, intrusions, and even accidental modifications to files on a system. Below, we will walk through setting up AIDE and testing it by modifying a simple file.
Phase 0 – Professional Alignment
Maintaining the integrity of enterprise systems requires continuously monitoring critical files for unauthorized or unexpected changes. In this chapter, you will deploy the Advanced Intrusion Detection Environment (AIDE) to establish a trusted baseline, monitor protected files, and identify modifications that may indicate system compromise or configuration drift. These activities reinforce the importance of file integrity monitoring as a fundamental component of enterprise system hardening and continuous security monitoring.
DCWF Work Roles
The knowledge and skills developed in this chapter align with the following Department of Defense Cyber Workforce Framework (DCWF) work roles:
- 451 – System Security Analyst
- 541 – Cyber Defense Analyst
- 531 – Systems Administrator
NICE Work Roles
This chapter supports competencies associated with the following NICE Workforce Framework for Cybersecurity work roles:
- Cyber Defense Analyst
- Cyber Defense Infrastructure Support Specialist
- Systems Administrator
Professional Skills
By completing this chapter, you will begin developing the ability to:
- Deploy and configure AIDE to monitor critical system files.
- Establish trusted file integrity baselines for enterprise systems.
- Detect unauthorized file additions, modifications, and deletions.
- Interpret file integrity reports to identify potential security events.
- Validate system integrity following configuration changes.
- Troubleshoot file integrity monitoring configurations and baseline management.
What You’ll Be Able to Do
After completing this chapter, you should be able to:
- Install and configure AIDE on a Linux system.
- Create and initialize a trusted file integrity baseline.
- Perform integrity checks to identify changes to monitored files.
- Interpret AIDE reports to distinguish expected from unexpected file modifications.
- Update the integrity baseline following authorized system changes.
- Explain how file integrity monitoring supports enterprise security monitoring and incident detection.
Learning Objectives
- Demonstrate the capacity to use analytical, software monitoring, and network management tools to discover potential threats and vulnerabilities for a given network.
- Understand the principles of packet inspection, intrusion detection, and denial of service, as well as the components of a network that can be used to mitigate risk from these and other types of network operation issues.
Prerequisites
Deliverables
- Configuration File
- Baseline scan
- Scan after a file change
- Scan after file deletion
Resources
Contributors and Testers
- Alec Parish
Phase I – Installing AIDE
- Start a Kali Linux VM (GNS3 is not needed for this lab)
- Open a terminal and update/upgrade your Kali Linux VM
- Update
sudo apt update
- Upgrade
sudo apt upgrade
- Update
- Install AIDE by typing
sudo apt install aide -y
Phase II – CONFIGURING AIDE
AIDE requires some configuration file editing. It isn’t that difficult, but you will need to pay attention to detail! For simplicity, we will detect changes to the Kali desktop; however, we can detect changes to any directory.
- Verify your desktop’s directory full path by typing
echo $HOME/Desktop
- The results will vary by user, but in this example, our path is /home/kali/Desktop
- Edit the aide configuration file by typing the following in the terminal
sudo vi /etc/aide/aide.conf
- Place your cursor at the top of the page and remove all contents by typing (you will not see it being typed!)
300dd
- The configuration should look like this

Figure 1 – setting the config file - Save the file and quit the VIM editor by hitting the Esc key and typing
:wq
- Double-check your configuration by typing
sudo aide --config-check --config /etc/aide/aide.conf
- If there are no errors, you will not receive a message. If there are any errors, resolve them before moving on
Phase III – Using AIDE
AIDE depends on saved information stored in a database. We are going to create a file for the desktop, create an AIDE database of the current state of the desktop, then change the file, then run AIDE again and view the results.
- Open another terminal session
- Type the following to create a file on the desktop (remember, your desktop path may be different than this example!)
echo ‘blue kangaroos are fun!’ > /home/kali/desktop/Kangaroo.txt
- You should see a new text file on the desktop

Figure 2 – new text file is added - Return to the original terminal to initialize the database for a baseline by typing
sudo aideinit
NOTE: If you run this command multiple times, you may need to type Y to overwrite the old baseline.
- This creates a new database file, typically located at /var/lib/aide/aide.db/new
- Check for any changes on the desktop compared to our baseline
sudo aide --config /etc/aide/aide.conf --check
- You should see no change in the report

Figure 3 – no change detected - We will now change our kangaroo file
- Double-click on the kangaroo.txt file
- Capitalize the word “Kangaroos”
- Save the file
- Run the check again

Figure 4 – changes were detected - You can see that changes were detected. The report tells you that the file kangaroo.txt was changed
- Delete the kangaroo file

Figure 5 – delete the file - Run the check again

Figure 6 – changes were detected – file was removed - You can see that AIDE detected the file deletion
Career Connection
File integrity monitoring is an essential security control used to detect unauthorized modifications that may indicate malware, insider threats, or system compromise. Systems administrators, cybersecurity analysts, and incident responders use tools such as AIDE to establish trusted baselines, monitor critical operating system files, and investigate unexpected changes before they develop into larger security incidents. The skills developed in this chapter reflect common enterprise security practices where continuous integrity monitoring supports compliance, incident response, and the long-term protection of critical systems.
End of LAB
Deliverables
Four (4) screenshots are needed to receive credit for the walk-through exercise
- Configuration File
- Baseline scan
- Scan after a file change
- Scan after file deletion
Homeworks
Assignment 1 – Monitor another folder for changes.
- Modify your configuration file to monitor another folder
- Add/modify/delete files in this folder and observe how AIDE reports the changes.
- Can you trick AIDE?
- RECOMMENDED GRADING CRITERIA:
- Screenshot of the new configuration file
- Screenshot of baseline scan using the new configuration file
- Screenshot of scan after a change to the directory
- Screenshot of scan after an add/delete of files
Assignment 2 – Explore additional uses of AIDE
- AIDE is a powerful tool that can be used in a variety of ways:
- Create cron jobs to automatically run AIDE scans
- Monitor ACLs, inode changes, xattrs, and other deep cryptographic attributes
- Forensic investigation assistance
- Intrusion detection
- Connect to Ansible for centralized monitoring
- Select a use of AIDE that was not addressed in the walk through and implement it
- RECOMMEDED GRADIN CRITERA:
- Screenshot of the new configuration file
- Screenshot of baseline scan using the new configuration file
- Screenshot of scan after a change to the directory
- Screenshot of scan after an add/delete of files