IDS, IPS and Host-Based Security
Where network controls stop and host agents, Network Firewall and IMDSv2 take over. Source/destination check, file integrity, metadata hardening.
Exam tasks: 3.3 (network controls that permit or prevent traffic: security groups, network ACLs, Network Firewall; north/south and east/west protection)
The decision: does the requirement need payload or process visibility, and must it block (IPS, inline appliance) or only detect?
Security groups and network ACLs decide on packet headers only (address, port, protocol). They cannot read payloads. Payload inspection, file integrity checks and process-level control need a host agent or an inline appliance such as AWS Network Firewall.
IDS versus IPS
| Item | What to remember |
|---|---|
| IDS | Watches traffic and hosts, then reports to admins or a SIEM. Detects only. |
| IPS | Detects and blocks or drops malicious packets automatically. |
| GuardDuty | Detection only. It is not an IPS. You can bolt on response with EventBridge and Lambda. |
| Where it runs | Host agent on EC2, inline appliance from AWS Marketplace, or AWS Network Firewall (Suricata-compatible IPS rules). |
| Management at scale | Systems Manager or Ansible installs and updates the agent on many instances. |
Host-based controls
| Need | Control |
|---|---|
| Application-level filtering | OS firewall such as iptables or Windows Firewall. Network firewalls cannot see processes or users. |
| Deep packet inspection | Host agent or proxy-based DPI software. Security groups and NACLs cannot do it. |
| Detect modified files | Host-based IDS with file integrity monitoring. It compares current files to a trusted baseline and alerts. |
| Virtual appliance (NAT, proxy, IPS) | Disable the source/destination check on its ENI so it can forward traffic that is not addressed to it. |
The source/destination check is on by default. An ENI with it enabled only sends or receives traffic for its own IPs.
More host controls
- A host firewall (iptables, nftables, Windows Defender Firewall) is a second layer, for example blocking IMDS for all users except root.
- Third-party HIDS, antivirus and file integrity monitoring are deployed and kept running with State Manager associations or Distributor packages.
- GuardDuty Runtime Monitoring gives process, file and network events on EC2, ECS and EKS (see GuardDuty).
- The CloudWatch agent ships OS and application logs for detection.
- EBS encryption by default, and Nitro Enclaves for processing highly sensitive data in isolation.
Gateway Load Balancer and third-party IDS/IPS
- GWLB sends traffic transparently to a fleet of virtual appliances (Palo Alto, Fortinet, Check Point, open-source Suricata) using GENEVE on port 6081, keeping the original packet intact.
- Consumers reach it through GWLB endpoints in their route tables, so the appliance fleet can live in a central security account.
- Keep flows symmetric: enable appliance mode on the transit gateway VPC attachment for the inspection VPC.
- Pick GWLB when the question names a vendor, requires a specific IPS signature feed, or reuses existing firewall licences. Otherwise Network Firewall is the lower-effort managed answer.
- Traffic Mirroring copies ENI traffic to an out-of-band IDS for detection only. It can't block.
Protecting instance metadata
Instance metadata lives at 169.254.169.254 and includes the role credentials at iam/security-credentials/<role>. Anyone who can run code or make the instance fetch a URL can steal them.
| IMDSv1 | IMDSv2 |
|---|---|
| Plain request and response | Session token. A PUT request returns a token, then each GET carries it in a header |
| Open to SSRF through a simple URL fetch | PUT is rejected when an X-Forwarded-For header is present, and the default response hop limit is 1, so proxies and containers are blocked |
| Allowed by default unless configured | Set the instance option to require tokens. Calls without a valid token get HTTP 401 |
Token lifetime runs from 1 second to 6 hours (21,600 seconds). Host firewall rules such as iptables can still restrict which local users reach the metadata address. Requiring IMDSv2 is the AWS-recommended control.
Exam signal
"Virtual appliance cannot forward traffic" means disable source/destination check. "Prevent SSRF from stealing instance role credentials" means require IMDSv2.
Exam trap
Security groups and NACLs cannot detect malware in a payload or a modified file. Pick a host-based IDS, a Network Firewall IPS rule group, or GuardDuty Malware Protection, not another SG rule.
Scenarios
GWLB is built for transparent, scalable inline appliances: it health checks targets, spreads flows, and keeps them symmetric with appliance mode. Network Firewall doesn't run the vendor's product or feeds. An ALB only handles HTTP(S) it terminates and can't be a route target. Traffic Mirroring sends copies, so it detects but can't block.
Related
Further reading
Attack Surface Reduction
Layered controls that shrink what an attacker can reach, from security group chaining to CloudFront and Shield Advanced.
Secrets Manager vs Parameter Store
When to store credentials in AWS Secrets Manager and when Systems Manager Parameter Store is enough, with tiers, rotation and limits.