AWS Network Security Components: Defense in Depth
Network security components (for example, security groups, network ACLs, routing, AWS Network Firewall, AWS WAF, AWS Shield)
AWS Network Security Components: Defense in Depth
This study guide covers the essential network security components required for the AWS Certified DevOps Engineer - Professional (DOP-C02) exam, focusing on automating security controls and implementing layered protection.
Learning Objectives
- Differentiate between stateful and stateless filtering mechanisms (Security Groups vs. Network ACLs).
- Architect multi-layered security using AWS WAF, AWS Shield, and AWS Network Firewall.
- Implement automated security controls for traffic filtering and routing in multi-account environments.
- Understand the role of Intrusion Detection and Prevention Systems (IDS/IPS) in the cloud.
Key Terms & Glossary
- Stateful Filtering: A firewall that tracks the state of active connections and automatically allows return traffic. (Example: Security Groups).
- Stateless Filtering: A firewall that treats each packet as an isolated unit; return traffic must be explicitly allowed. (Example: Network ACLs).
- IDS/IPS (Intrusion Detection/Prevention System): Tools that monitor network traffic for malicious activity and can take action to block it. (Example: AWS Network Firewall).
- DDoS (Distributed Denial of Service): An attempt to make an online service unavailable by overwhelming it with traffic from multiple sources. (Example protected by: AWS Shield).
- WAF (Web Application Firewall): A firewall that monitors and filters HTTP/S traffic to protect web applications from common exploits like SQL injection. (Example: AWS WAF).
The "Big Idea"
The core philosophy of AWS Network Security is Defense in Depth. No single tool is a "silver bullet." Instead, security is achieved by layering controls at the edge (CloudFront/WAF/Shield), the network perimeter (Network Firewall/Routing), and the resource level (Security Groups). This ensures that if one layer is compromised, others remain to protect the data.
Formula / Concept Box
| Component | Layer | Nature | Scope |
|---|---|---|---|
| AWS WAF | Layer 7 (Application) | Stateful | CloudFront, ALB, API Gateway |
| Security Group | Layer 4 (Instance) | Stateful | Elastic Network Interface (ENI) |
| Network ACL | Layer 4 (Subnet) | Stateless | Subnet Boundary |
| Network Firewall | Layer 3-7 (VPC) | Stateful/Stateless | VPC Perimeter/Transit Gateway |
Hierarchical Outline
- I. Host-Level Security
- Security Groups (SG)
- Stateful: Automatically allows response traffic.
- Rules: Allow-only (implicit deny).
- Evaluation: All rules are evaluated before traffic is allowed.
- Security Groups (SG)
- II. Subnet-Level Security
- Network Access Control Lists (NACL)
- Stateless: Requires separate inbound/outbound rules.
- Rules: Support Allow and Deny.
- Evaluation: Processed in numbered order (lowest first).
- Network Access Control Lists (NACL)
- III. VPC Perimeter & Inter-VPC Security
- AWS Network Firewall
- Managed IDS/IPS capabilities.
- Fine-grained filtering for outbound (egress) traffic (FQDN filtering).
- Deep packet inspection for VPC-to-VPC traffic.
- AWS Network Firewall
- IV. Edge & Application Security
- AWS WAF: Protections against SQLi, XSS, and bot scrapers.
- AWS Shield: Standard (free) vs. Advanced (paid DDoS protection with specialized support).
Visual Anchors
Traffic Flow Inspection
VPC Layering
Definition-Example Pairs
- FQDN Filtering: Restricting outbound traffic to specific domain names rather than just IP addresses.
- Example: A DevOps engineer uses AWS Network Firewall to ensure that internal servers can only reach
*.updates.microsoft.comandgithub.comfor patches, blocking all other internet-bound traffic.
- Example: A DevOps engineer uses AWS Network Firewall to ensure that internal servers can only reach
- WAF Rule Groups: Pre-configured sets of rules (managed by AWS or partners) to block common threats.
- Example: Enabling the "Core Rule Set" (CRS) in AWS WAF to automatically block common OWASP Top 10 vulnerabilities like Shellshock or SQL injection without writing custom regex.
Worked Examples
Scenario: Securing a High-Traffic API
Problem: An API hosted on an Application Load Balancer (ALB) is being targeted by a distributed botnet performing credential stuffing.
Step-by-Step Solution:
- Deploy AWS WAF: Associate a Web ACL with the ALB.
- Enable Rate-based Rules: Set a threshold (e.g., 100 requests per 5 minutes per IP) to slow down the botnet.
- Implement Managed Rules: Add the "Anonymous IP list" and "Known bad inputs" rule groups from AWS Managed Rules.
- AWS Shield Advanced: Subscribe to Shield Advanced for higher-level DDoS protection and access to the Shield Response Team (SRT).
Checkpoint Questions
- Why would you use a Network ACL to block a specific IP address instead of a Security Group?
- Which service would you use to perform deep packet inspection for traffic moving between two different VPCs connected via Transit Gateway?
- If a Security Group has an inbound rule allowing port 80, but the NACL has no outbound rules, will the web server be able to respond to requests? Why or why not?
Muddy Points & Cross-Refs
- SG vs. NACL: This is a classic exam trap. Remember: SG = Resource level/Stateful; NACL = Subnet level/Stateless. If you block an IP in an SG, it only affects that resource. If you block it in a NACL, it affects everything in that subnet.
- WAF vs. Network Firewall: WAF is Layer 7 (HTTP/S) only. Network Firewall can handle Layer 3-7 and is used for non-web protocols (like SSH, SFTP, or general outbound traffic).
- Shield Standard vs. Advanced: Standard is automatic and free (Layer 3/4). Advanced provides Layer 7 protection, cost protection (bill credits for scaling during an attack), and 24/7 expert support.
Comparison Tables
Security Groups vs. Network ACLs
| Feature | Security Group | Network ACL |
|---|---|---|
| Layer | Instance / ENI (Layer 4) | Subnet (Layer 4) |
| State | Stateful (Returns allowed) | Stateless (Must allow both ways) |
| Rules | Allow rules only | Allow and Deny rules |
| Processing | All rules evaluated | Processed in order |
| Recommended Use | Granular resource protection | Default 'safety net' for subnets |
AWS WAF vs. AWS Network Firewall
| Feature | AWS WAF | AWS Network Firewall |
|---|---|---|
| Primary Goal | Web Application Protection | VPC/Perimeter Protection |
| Traffic Type | HTTP / HTTPS (Layer 7) | IP, TCP/UDP, FQDN (Layer 3-7) |
| Deployment | ALB, CloudFront, API Gateway | VPC Endpoints, Transit Gateway |
| Key Capability | SQLi/XSS blocking, Bot control | IDS/IPS, Egress filtering |