Host-Based IDS, IPS and Firewalls
Endpoints and servers need protection that travels with them and sees what network devices cannot. This lesson explains host-based intrusion detection and prevention systems, file integrity monitoring and host-based firewalls.
Learning outcomes
After completing this lesson, you will be able to:
- Explain why host-based controls are needed.
- Describe HIDS and file integrity monitoring.
- Describe HIPS.
- Describe host-based firewall practices.
Why protect at the host
Network controls protect traffic between systems, but they cannot see inside encrypted connections, cannot protect a laptop on a hotel network, and do not see what happens on the host itself: which processes run, which files change and who logs in. Host-based controls run on each endpoint or server, see activity after decryption and protect the device wherever it is. They complement network controls as part of defence in depth.
Host-based intrusion detection systems
A host-based intrusion detection system (HIDS) monitors a single host and alerts on suspicious activity. It analyses operating system and application logs, monitors logins and privilege use, watches running processes and network connections, and performs file integrity monitoring (FIM): it records cryptographic hashes and attributes of critical files (system binaries, configuration files, web application code) and alerts when they change. FIM is required by standards such as PCI DSS and is effective at detecting web shells, unauthorised configuration changes and tampering. Examples include AIDE, OSSEC, Wazuh and Tripwire.
A HIDS runs on the host it protects, so an attacker with administrative rights may try to disable it or alter its records. Its baseline and alerts should therefore be stored off the host, for example sent to the SIEM, and a sudden silence from a host's HIDS should itself raise an alert.
sudo aide --init
sudo cp /var/lib/aide/aide.db.new /var/lib/aide/aide.db
sudo aide --checkThese commands initialise an AIDE baseline database of file hashes and then check the system against it, reporting added, removed and changed files. The lab for this module uses a simple integrity monitor.
Host-based intrusion prevention systems
A host-based intrusion prevention system (HIPS) monitors host activity and blocks malicious behaviour as it happens. It can intercept system calls and stop a process from writing to protected areas, injecting code into another process, modifying security settings, disabling security tools or executing from unusual locations. Many HIPS capabilities are now part of endpoint protection platforms and EDR, together with exploit protection features such as preventing memory corruption techniques.
Like a network IPS, a HIPS must be tuned: overly strict rules block legitimate software and frustrate users. New rules are typically tested in audit mode before enforcement.
Host-based or network-based?
Host-based firewalls
A host-based firewall, such as Windows Defender Firewall, or nftables, iptables, firewalld and ufw on Linux, filters traffic to and from the individual host. It protects laptops on untrusted networks, limits lateral movement by blocking unnecessary connections between internal hosts (for example, blocking workstation-to-workstation SMB and RDP), and can apply rules per application and per network profile (domain, private, public).
Good practice is default deny for inbound traffic with explicit allows only for required services, outbound restrictions on servers, logging of blocked connections, and central management through Group Policy, endpoint management or configuration management tools so that users cannot disable it. The following nftables rules show a minimal server policy that allows only established traffic, loopback and SSH from the management network.
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
ct state established,related accept
iif lo accept
ip saddr 10.10.99.0/24 tcp dport 22 accept
}
}The following diagram compares open workstations with host firewall rules for limiting ransomware's spread.

Host-based firewalls
Detecting a web shell
Attackers upload a small PHP file to a web server's upload directory and use it to run commands. Which host-based control would most directly detect the change, and how should it be configured?
File integrity monitoring on the HIDS: monitoring the web root and application directories for new and changed files would alert on the unexpected PHP file. Its baseline and alerts should be sent to the SIEM, and the upload directory should be configured so that uploaded files cannot execute.
Stopping lateral movement
In a ransomware incident, the attacker moved from one workstation to hundreds of others using remote administration over SMB and RDP. Which endpoint control would have limited this?
Host-based firewalls centrally configured to block inbound SMB and RDP between workstations, allowing them only from designated administrative hosts. Workstations rarely need to accept such connections from each other, so the rule has little business impact and greatly limits lateral movement.
Why should HIDS alerts and baselines be stored off the host?
Show answer
An attacker with administrative access could alter or delete them on the host to hide changes.
Exam Tips
Remember for the exam
- HIDS alerts; HIPS blocks; file integrity monitoring detects changes to critical files.
- Store HIDS baselines and alerts off the host.
- Host-based firewalls: default deny inbound, central management, block workstation-to-workstation admin protocols.