AWS Network Firewall
The network protection options on AWS, and AWS Network Firewall for layer 3 to layer 7 protection of a whole VPC with stateful rules, domain filtering and intrusion prevention.
Network protection on AWS
To protect a network on AWS, the options so far are:
- network ACLs (NACLs);
- Amazon VPC security groups;
- AWS WAF (protects against malicious HTTP requests);
- AWS Shield and Shield Advanced;
- AWS Firewall Manager (to manage them across accounts).
But what if the goal is to protect the entire VPC in a sophisticated way?
AWS Network Firewall
AWS Network Firewall protects an entire Amazon VPC.
- From layer 3 to layer 7 protection.
- Any direction, it can inspect:
- VPC to VPC traffic;
- outbound to the internet;
- inbound from the internet;
- to and from Direct Connect and Site-to-Site VPN.
- Internally, AWS Network Firewall uses the AWS Gateway Load Balancer.
- Rules can be centrally managed cross-account by AWS Firewall Manager to apply to many VPCs.
Fine-grained controls
- Supports thousands of rules:
- IP and port: for example, filtering tens of thousands of IPs;
- protocol: for example, block the SMB protocol for outbound communications;
- stateful domain list rule groups: only allow outbound traffic to
*.mycorp.comor a third-party software repository; - general pattern matching using regex (it uses Suricata-compatible rules).
- Traffic filtering: allow, drop or alert for the traffic that matches the rules.
- Active flow inspection to protect against network threats with intrusion-prevention capabilities (like Gateway Load Balancer, but all managed by AWS).
- Send logs of rule matches to S3, CloudWatch Logs and Data Firehose.
Exam tips
- "Protect the entire VPC", "filter outbound traffic by domain name", "intrusion prevention (IPS) for a VPC" → AWS Network Firewall.
- "Block malicious HTTP requests to an ALB" → AWS WAF instead.
- "Same firewall rules across many accounts" → Firewall Manager with Network Firewall policies.
Common traps
- "Security groups can filter by domain name." They filter by IP, port and protocol; domain filtering needs Network Firewall.
Check yourself
A Network Firewall endpoint costs about $0.40 an hour per AZ, so instead:
Deploy AWS Network Firewall in the VPC's internet path with a stateful domain list rule group allowing only that domain, and send alert logs to CloudWatch Logs or S3.
AWS documentation
VPC Flow Logs and Traffic Mirroring
VPC Flow Logs at the VPC, subnet and ENI level, their record format, troubleshooting security groups and NACLs with them, common architectures, and VPC Traffic Mirroring.
VPC peering
VPC peering for private connections between two VPCs, the no-overlap and no-transitivity rules, route tables, cross-account and cross-Region peering, and referencing security groups.