AWS defense in depth - four layers explained
AWS provides four distinct network security layers operating at different OSI levels. Security Groups and NACLs are free and instance/subnet-level. Network Firewall provides VPC-wide IDS/IPS with Suricata rules. WAF protects HTTP/HTTPS traffic at Layer 7. Understanding which does what - and how they stack - is defense in depth.
SQL injection, XSS, bot protection for HTTP/HTTPS traffic
Suricata IDS/IPS rules, TLS inspection, domain filtering
Simple ALLOW rules, stateful, attached per ENI
ALLOW + DENY rules, subnet-wide, evaluated in order
| Criteria | WAF | Network Firewall | Security Groups | Network ACLs |
|---|---|---|---|---|
| OSI Layer | Layer 7 (HTTP/HTTPS only) | Layer 3/4/7 | Layer 3/4 | Layer 3/4 |
| Scope | CloudFront, ALB, API Gateway, AppSync | Entire VPC (subnet routing) | Per ENI (instance-level) | Per subnet |
| Stateful | N/A (request-level) | Yes | Yes | No - must define return traffic |
| DENY Rules | Yes (block rules) | Yes | No - allow only | Yes |
| IDS/IPS | No | Yes (Suricata) | No | No |
| TLS Inspection | N/A (sees decrypted HTTP) | Yes (additional cost) | No | No |
| Domain Filtering | No | Yes (allow/deny by FQDN) | No | No |
| Cost | Low (~$6+/mo) | High (~$285+/mo per endpoint) | Free | Free |
The correct architecture uses all four: Security Groups on instances, NACLs on subnets, Network Firewall at VPC level for IDS/IPS, and WAF on ALBs/CloudFront for web attacks.
Security Groups only support ALLOW rules. To explicitly block a specific IP or range, you must use NACLs or Network Firewall. This is the most common misunderstanding.
Unlike Security Groups, NACLs do not automatically allow response traffic. You must explicitly allow ephemeral ports (1024-65535) for return traffic or connections will fail.
At ~$285/month per endpoint (per AZ), Network Firewall is the most expensive option. For a 3-AZ deployment, that is $855/month before data processing charges. Plan accordingly.
These comparisons are a starting point. Every architecture is different. Contact us for tailored AWS security assessments and architectural guidance.