Skip to Content

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 the whole VPC from layer 3 to layer 7: it inspects traffic in every direction, to and from the internet, to and from on premises over Direct Connect and Site-to-Site VPN, and to peered VPCs, with stateful rules and intrusion prevention AWS Network Firewall protects the whole VPC from layer 3 to layer 7: it inspects traffic in every direction, to and from the internet, to and from on premises over Direct Connect and Site-to-Site VPN, and to peered VPCs, with stateful rules and intrusion prevention

One firewall for every path in and out of the VPC.

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.com or 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:

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt