What Is AWS Network Firewall? Network Firewall vs WAF, Architecture, Pricing ($0.395/Hour), Setup, Routing and Rule Examples

Logeshwaran
—

AWS Network Firewall is a managed, stateful network firewall and intrusion prevention system for your VPCs: it inspects every packet that enters or leaves a VPC (or moves between VPCs through a transit gateway), of any protocol, and can block traffic by IP address and port, by domain name, or with Suricata intrusion-prevention rules. AWS WAF is different: it is a web application firewall that sits in front of CloudFront, load balancers and APIs and inspects only HTTP and HTTPS requests, looking for attacks such as SQL injection, cross-site scripting and bots. So the short answer to WAF vs network firewall is that a WAF protects a web application from bad requests, while a network firewall controls which connections can happen at all; most companies with both public websites and sensitive networks use both. Price: Network Firewall costs $0.395 per endpoint-hour (about $288 a month per Availability Zone) plus $0.065 per GB processed in US East, while WAF costs $5 per web ACL a month, $1 per rule and $0.60 per million requests. Below: how Network Firewall works, the architectures, rules with examples, TLS inspection, pricing with worked costs, step-by-step setup and routing, logging, and a decision table for which firewall you need.

Ethan's client, a small online accounting firm, had a simple question after a security review: "Our auditor says we need a firewall. We already have AWS WAF on the website. Isn't that a firewall?" It is, Ethan explained, but it guards the front door of one web application. The auditor wanted to know what stopped a compromised server inside the VPC from connecting to anything on the internet, and the honest answer was: nothing except security groups that allowed all outbound traffic. Jake, who had dropped by Ethan's office with a laptop to fix, listened to the call and asked the question the rest of this page answers: "So which firewall do they actually need?"

⚡ Quick Answer

• Network Firewall: stateful firewall and IPS for VPC traffic, any protocol, domain filtering, Suricata rules. Explained.

• WAF: inspects HTTP/HTTPS requests to web apps and APIs. Different job. WAF vs firewall.

• Price: $0.395/endpoint-hour + $0.065/GB (US East); NAT gateway charges waived when chained. Worked costs.

• Setup: a dedicated firewall subnet per AZ, then route traffic through the endpoint. Steps.

Every AWS firewall · Architecture · Rule examples · TLS inspection · Which do I need? · FAQ.

New to AWS networking security? The cards below cover WAF, security groups, network ACLs and the gateways that Network Firewall works alongside.

🧭 NEW HERE? READ THESE FIRST

These five pages explain the pieces this comparison builds on:

📌 Bookmark this; the decision table and the routing steps are the parts you will come back for.

What is AWS Network Firewall?

AWS Network Firewall is a firewall you place inside your own VPC, managed by AWS so you never patch or scale firewall servers yourself. You decide where traffic should be inspected, AWS creates firewall endpoints in subnets you choose, and you change your VPC route tables so that traffic flows through those endpoints on its way in, out or between networks. Everything that passes through is checked against your rules and either passed, dropped, rejected or logged.

It filters at the perimeter of the VPC: traffic to and from an internet gateway, a NAT gateway, a VPN or AWS Direct Connect, and traffic between VPCs when you route it through a transit gateway. Under the hood, the stateful engine is Suricata, the open-source intrusion prevention system, which is why you can write Suricata-compatible rules and why it can recognize protocols such as HTTPS regardless of the port they use.

What you can do with it, in plain terms:

  • Allow only the destinations your servers need, for example only AWS service endpoints and your software update servers, and drop everything else. This is egress filtering, and it is what most audits ask for.
  • Block known-bad domains with a deny list, so a compromised machine cannot reach its command-and-control server even if the attacker uses a new IP address.
  • Detect and block attacks with intrusion prevention rules, including AWS managed threat signature rule groups that AWS keeps up to date.
  • Inspect encrypted traffic with TLS inspection, if you choose to decrypt it.
  • Log flows and alerts to S3, CloudWatch Logs or Amazon Data Firehose for investigation and evidence.

By default it works in source-preservation mode: it inspects traffic and sends it on with the original source and destination IP addresses intact, for every protocol (TCP, UDP, ICMP). A second mode that acts as an explicit forward proxy is in preview in one Region; for almost everyone today, Network Firewall means the transparent, route-based firewall described on this page.

WAF vs firewall: what is the difference?

"WAF vs firewall difference" is one of the most searched security questions, and the cleanest way to answer it is by what each one looks at.

A network firewall looks at connections. Its basic questions are: where is this traffic coming from, where is it going, which port and protocol is it using, and (for a stateful firewall) is it part of a connection that was already allowed? Modern network firewalls also recognize applications and domain names, and with intrusion prevention they can spot known attack patterns in the traffic. Its job is to decide which conversations are allowed to happen.

A web application firewall (WAF) looks inside web requests. It sees the URL, the headers, the cookies, the query string and the body of each HTTP request, and asks whether this request is an attack on the application: a SQL injection in a form field, a script hidden in a parameter, a login attempt from a bot, a flood of requests from one address. Its job is to decide which requests a web application should answer. WAF stands for web application firewall, and it works at layer 7, the application layer, while a classic network firewall works at layers 3 and 4.

The two overlap less than their names suggest:

AWS WAFAWS Network Firewall
ProtectsWeb applications and APIsVPCs and everything in them
Traffic it seesHTTP/HTTPS requests to the resources it is attached toAll traffic routed through it, any protocol, both directions
Attaches toCloudFront, Application Load Balancers, API Gateway, AppSync, Cognito user pools and moreFirewall endpoints in your VPC subnets, reached through route tables
StopsSQL injection, XSS, bad bots, account takeover attempts, request floodsUnwanted connections, outbound traffic to bad domains, known exploits and malware traffic (IPS)
Outbound (egress) controlNoYes, its main use
Pricing basisPer web ACL, per rule, per million requestsPer endpoint-hour and per GB processed
Typical monthly cost, small setup$6 to $20About $290 per Availability Zone before data

Neither replaces the other. A WAF in front of your website cannot stop a compromised server from sending your data to the internet, and a network firewall will happily pass a perfectly formed HTTPS request that carries a SQL injection to your application. If you run public web applications, you want a WAF; if you need to control what your servers can talk to, or an auditor asks for network-level inspection, you want a network firewall. Our AWS WAF guide covers the web side in depth.

Jake: "So the WAF is the bouncer at the front door, and the network firewall is the guard who checks who leaves the building?"

Ethan: "Close enough. The bouncer reads every guest's invitation. The guard decides which doors open at all, and in which direction."

And "next-generation firewall" (NGFW)?

NGFW is the industry name for network firewalls that add application awareness, intrusion prevention and threat intelligence to classic port and address filtering. AWS Network Firewall covers much of that list (stateful inspection, Suricata IPS, protocol detection, domain filtering, TLS inspection, managed threat signatures), but it does not identify users or offer the application catalogs of commercial NGFW products. If your company is standardized on one of those vendors, Palo Alto Networks Cloud NGFW and Fortinet's cloud firewall are available on AWS through AWS Marketplace, and AWS Firewall Manager can deploy them across accounts.

Every firewall on AWS, and what each one is for

AWS has more than one thing called a firewall, and people often mean different ones. Here is the whole set, from the closest to your servers outward:

ControlWhere it worksCostUse it for
Security groupEach network interface (instance, load balancer, database)FreeAllowing only the ports each resource needs; stateful, allow rules only
Network ACLEach subnetFreeCoarse allow and deny rules at the subnet edge; stateless
AWS Network FirewallVPC perimeter and between VPCsPer endpoint-hour + per GBEgress filtering, domain lists, intrusion prevention, central inspection
Route 53 Resolver DNS FirewallDNS lookups from VPCsPer million queriesBlocking resolution of malicious domains, cheaply
AWS WAFIn front of web resourcesPer web ACL, rule and requestProtecting web applications and APIs from malicious requests
AWS ShieldAWS edge and resourcesStandard free; Advanced paidDDoS protection
Gateway Load Balancer + appliancesVPC traffic sent to your own appliance fleetLoad balancer + appliance licensesRunning third-party firewall appliances at scale
AWS Firewall ManagerAcross all accountsPer policy per RegionDeploying the above consistently in an organization

Security groups and network ACLs are free and should always be your first layer; our guide to security groups vs network ACLs explains how they differ. The comparison people search for most, "AWS Network Firewall vs security group", comes down to scope and intelligence: a security group decides which ports one resource accepts, and it can only allow, never explicitly deny; Network Firewall sees traffic for whole VPCs, can deny, and understands domain names and attack signatures. Network Firewall does not replace security groups; it adds a perimeter layer around them.

How Network Firewall works: endpoints, subnets and routes

Four resources make up a Network Firewall deployment:

  1. Rule groups: sets of rules. Stateless rule groups look at each packet on its own (addresses, ports, protocol, TCP flags); stateful rule groups look at packets in the context of their connection and include 5-tuple rules, domain lists and Suricata rules.
  2. A firewall policy: which rule groups to use, in what order, and the default actions for traffic that matches nothing.
  3. A firewall: ties the policy to a VPC and, for each Availability Zone you want to protect, one firewall subnet where AWS creates a firewall endpoint.
  4. Route table changes, which you make yourself in Amazon VPC, to send traffic through the endpoints.

Packets arriving at an endpoint first meet the stateless engine. Stateless rules can pass, drop or forward packets to the stateful engine; a common setup forwards everything (the action aws:forward_to_sfe) so that all the real decisions happen in the stateful engine, which tracks each connection in its state table and applies your stateful rules.

Two details about firewall subnets cause most early mistakes. A firewall endpoint cannot inspect traffic that starts or ends in its own subnet, so the firewall subnet must hold nothing but the endpoint: no instances, no NAT gateway. And each endpoint serves one Availability Zone; you create one firewall subnet per AZ and route each AZ's protected subnets to the endpoint in the same AZ. Routing traffic from one AZ to an endpoint in another works, but it adds cross-AZ data charges and makes you depend on the other zone.

Architecture: where to put the firewall

"AWS Network Firewall architecture" is one of the most searched topics around it, because the right design depends on how many VPCs you have and which traffic you want to inspect. There are three common patterns.

1. Distributed: a firewall in each VPC

Each VPC that needs protection gets its own firewall endpoints, between its workloads and its internet gateway. This is the simplest design to understand and the easiest to start with: traffic flows from the protected subnets to the firewall endpoint, then to the internet gateway, and incoming traffic takes the reverse path. It suits a handful of VPCs with their own internet access. The cost scales with the number of VPCs, because each VPC pays for its own endpoints.

2. Centralized: one inspection VPC behind a transit gateway

All VPCs connect to a transit gateway, and the transit gateway routes traffic through a dedicated inspection VPC that holds the firewall endpoints, often together with NAT gateways for central internet egress. One set of endpoints inspects traffic for every VPC, both to the internet (north-south) and between VPCs (east-west). It costs less per VPC at scale and gives you one place for rules and logs, but routing is more involved: the transit gateway attachment for the inspection VPC needs appliance mode so both directions of a connection use the same AZ, and you must extend the firewall's HOME_NET variable to include the spoke VPC ranges (more on that below). Our Transit Gateway routing guide covers the route tables. AWS now also offers a Network Firewall attachment directly on the transit gateway, which creates and manages the inspection infrastructure for you.

3. Combined

Larger companies often mix the two: central inspection for east-west traffic and shared egress, plus a distributed firewall in a VPC that has its own internet ingress, such as a VPC hosting public services behind load balancers.

Jake: "Why not just put a firewall in every VPC? Seems simpler."

Ethan: "It is simpler, until the bill arrives. Every VPC pays for its own endpoints around the clock. With one VPC that's fine. With ten, you pay ten times for the same rules."

Whichever you choose, decide which traffic you actually need to inspect. Inspecting everything between every VPC multiplies the data processing charge; many teams inspect internet egress and traffic between environments (production and development), and rely on security groups inside each environment.

Rules, with examples you can copy

Most firewall policies combine three kinds of stateful rules.

Domain lists are the easiest way to control outbound web traffic. You give Network Firewall a list of domain names and choose Allow or Deny. A name such as updates.example.com matches only that host; a name with a leading dot, such as .example.com, matches the domain and all its subdomains. For HTTPS, the firewall reads the server name from the TLS handshake (SNI); for plain HTTP, it reads the Host header. It does not look up IP addresses, so a client that connects directly to an IP address, or forges the SNI, needs separate IP-based rules if you want to catch that too.

5-tuple rules match source and destination address, port and protocol, the classic firewall rule, but statefully, so return traffic for an allowed connection passes automatically.

Suricata rules give you full control in a standard syntax. Each rule names an action, a protocol, the source and destination, and options; every rule needs a unique sid. Three examples for an egress policy:

pass tls $HOME_NET any -> $EXTERNAL_NET 443 (tls.sni; content:"updates.example.com"; endswith; flow:to_server, established; msg:"allow update server"; sid:1000101; rev:1;)
drop tcp $HOME_NET any -> $EXTERNAL_NET 22 (flow:to_server; msg:"block outbound SSH"; sid:1000102; rev:1;)
alert http $HOME_NET any -> $EXTERNAL_NET any (http.host; content:"suspicious.example.net"; flow:to_server, established; msg:"alert on suspicious host"; sid:1000103; rev:1;)

On top of your own rules, AWS managed rule groups add threat signature rules (for malware, exploits, botnet traffic and more) and domain lists that AWS maintains, so you do not have to write or update known-threat signatures yourself.

Rule order: choose strict order

A firewall policy evaluates stateful rules in one of two ways. With action order, Suricata processes all pass rules first, then drop, then reject, then alert, regardless of where you wrote them, which surprises people who expect top-to-bottom evaluation. With strict order, rule groups are evaluated by their priority number and the rules inside each group in the order you wrote them, like most firewalls you have used. Strict order is the recommended choice for new policies, and it is what makes a "default deny, allow only these destinations" policy straightforward.

With strict order you also choose default actions for traffic that matches no rule. For an allow-list egress policy, the usual choice is Drop established, which lets the TCP handshake through (so the firewall can see the TLS SNI or HTTP Host and apply your domain rules) and then drops established connections that no pass rule allowed. Pair it with Alert established while you are tuning, so the logs show what would be dropped before you enforce it.

HOME_NET: the setting that breaks central firewalls

Suricata rules and domain lists refer to $HOME_NET, your "inside" network. By default, Network Firewall sets it to the CIDR range of the VPC where the firewall is deployed. In a distributed design, that is exactly right. In a centralized design, the traffic comes from other VPCs through the transit gateway, so their addresses are outside the default HOME_NET, and your domain list and Suricata rules quietly ignore them. Set HOME_NET in the rule group's variables to include every spoke VPC's range plus the inspection VPC's own. If a centralized firewall passes traffic it should block, check this before anything else.

Can Network Firewall inspect encrypted traffic?

Yes, if you turn on TLS inspection. Without it, the firewall still sees the unencrypted parts of a TLS connection, most usefully the server name (SNI), which is why domain lists work on HTTPS. With TLS inspection, Network Firewall decrypts the traffic, applies your stateful rules to the contents, and re-encrypts it before sending it on, using certificates you provide through AWS Certificate Manager. For outbound inspection, your servers must trust the certificate authority whose certificate the firewall uses to re-sign connections.

TLS inspection is billed as an extra hourly charge per endpoint on top of the standard rate, and decryption is a policy decision as much as a technical one: you are reading traffic that may include passwords, health data or banking sessions. Most teams start with SNI-based domain filtering, which needs no decryption, and add TLS inspection only for traffic where they need to see inside, excluding sensitive destinations with scope settings.

AWS Network Firewall pricing, with worked costs

"Why is AWS Network Firewall so expensive" is a real search, and the answer is the hourly endpoint charge. In US East (N. Virginia):

  • Firewall endpoint: $0.395 per hour, per Availability Zone. That is about $288 a month for each endpoint, running all the time, whether traffic flows or not.
  • Data processed: $0.065 per GB, for every GB the firewall inspects.
  • Secondary endpoints (extra endpoints for the same firewall, for example in other VPCs): $0.158 per hour each.
  • Advanced options: TLS inspection and advanced threat protection are billed on top, as extra hourly or per-GB charges.
  • NAT gateway waiver: if you place a NAT gateway next to Network Firewall in a service chain in the same account and Region, the standard NAT gateway hourly and data processing charges are waived, which offsets a large part of the firewall's cost for egress designs.

Worked examples:

  • One VPC, two Availability Zones, 1 TB a month: endpoints 2 × $288 = $577; data 1,000 GB × $0.065 = $65. About $642 a month.
  • The same VPC, three AZs for full high availability: endpoints $865; data $65. About $930 a month.
  • Two firewalls in two AZs with NAT gateways, 5,000 GB a month: $893.80 a month in total, with the NAT gateway charges waived.
  • Centralized inspection for 10 VPCs: one inspection VPC with endpoints in two or three AZs costs the same endpoint charges as a single VPC, plus data for all the traffic you send through it, instead of ten times the endpoint charges for distributed firewalls.

Compare that with AWS WAF: a web ACL with five rules protecting a site that serves 10 million requests a month costs $5 + $5 + $6 = $16. The services are priced so differently because they do different work; the useful comparison is not WAF against Network Firewall, but Network Firewall against the security risk and audit requirement it addresses, and against the free controls (security groups, network ACLs) and the cheaper partial ones (DNS Firewall at $0.60 per million queries) that may be enough for your situation.

Jake: "Two hundred and eighty-eight dollars a month for one box that nobody sees? I sell phone cases for less."

Ethan: "It's not for your shop. For a firm that holds clients' tax records, one leaked database costs more than ten years of firewall."

Is AWS Network Firewall free? No; there is no free tier. If the cost is hard to justify for a small environment, the usual alternatives are tight security groups with explicit outbound rules, Route 53 Resolver DNS Firewall for domain blocking, and a single egress VPC so you pay for one set of endpoints rather than many. Our page on NAT gateway bills covers the egress side of the cost.

Set up Network Firewall in one VPC, step by step

This is the distributed pattern for a VPC with public and private subnets in two Availability Zones, inspecting all traffic to and from the internet.

  1. Create a firewall subnet in each AZ. A small subnet (a /28 is enough) used for nothing else. Give it its own route table.
  2. Create rule groups. For a first deployment: a stateful domain list rule group allowing the domains your servers need (operating system updates, package repositories, the AWS services you call, your partners), and optionally an AWS managed threat signature rule group.
  3. Create a firewall policy with strict rule order, your rule groups, and default actions Alert established only, at first. Set the stateless default action to forward packets to the stateful engine.
  4. Create the firewall, choosing the VPC, the firewall subnets and the policy. Wait until its status shows the endpoints are ready, and note each endpoint's ID (it starts with vpce-) per AZ.
  5. Change the routes, as described in the next section, one AZ at a time.
  6. Turn on logging for alert and flow logs, and watch the alerts for a few days.
  7. Enforce: add the Drop established default action once the alert logs show only traffic you mean to block.

The same can be done from the AWS CLI. Once your firewall policy exists, creating the firewall itself looks like this:

aws network-firewall create-firewall --firewall-name egress-fw \
  --firewall-policy-arn arn:aws:network-firewall:us-east-1:111122223333:firewall-policy/egress-policy \
  --vpc-id vpc-0123456789abcdef0 \
  --subnet-mappings SubnetId=subnet-0aaa1111bbbb2222c SubnetId=subnet-0ddd3333eeee4444f

# find the endpoint ID for each Availability Zone, to use in route tables
aws network-firewall describe-firewall --firewall-name egress-fw \
  --query "FirewallStatus.SyncStates"

In infrastructure code, the CloudFormation resources are AWS::NetworkFirewall::RuleGroup, AWS::NetworkFirewall::FirewallPolicy and AWS::NetworkFirewall::Firewall, and Terraform has matching aws_networkfirewall_* resources. Route changes are ordinary AWS::EC2::Route or aws_route resources pointing at the endpoint ID.

Routing: the part that makes it work

Network Firewall inspects only traffic that your route tables send to it, so routing is where setups succeed or fail. For the VPC above, with the internet gateway, the routes per AZ are:

  • Protected (application) subnet route table: 0.0.0.0/0 to the firewall endpoint in the same AZ (vpce-...), instead of to the internet gateway.
  • Firewall subnet route table: 0.0.0.0/0 to the internet gateway.
  • Internet gateway route table (a route table associated with the internet gateway itself, called an edge association): the protected subnet's CIDR to the firewall endpoint in that subnet's AZ, so incoming traffic is inspected on the way in too.

If your private servers reach the internet through a NAT gateway, the firewall goes between the NAT gateway and the internet gateway: private subnets send 0.0.0.0/0 to the NAT gateway as before, the NAT gateway's public subnet sends 0.0.0.0/0 to the firewall endpoint, the firewall subnet sends 0.0.0.0/0 to the internet gateway, and the internet gateway's edge route table sends the public subnet's range back to the firewall endpoint. Our guide to the internet gateway and NAT gateway explains the two gateways if this is new to you.

Jake: "So the firewall does nothing until you change the routes?"

Ethan: "Nothing at all. It's a toll booth on a road nobody drives down until you move the road."

The classic failure is asymmetric routing: traffic goes out through the firewall but comes back around it (or through the endpoint in a different AZ), the stateful engine sees only half of each connection, and connections hang or drop. Every return path must pass through the same endpoint as the outbound path. When something breaks after a routing change, check the internet gateway's edge route table first, then whether each subnet uses the endpoint in its own AZ.

Network Firewall vs Gateway Load Balancer with your own appliances

Before Network Firewall existed, the AWS way to inspect VPC traffic was to run firewall appliances (virtual machines from vendors such as Palo Alto Networks, Fortinet or Check Point) and spread traffic across them. A Gateway Load Balancer makes that practical: it sits in the traffic path like a firewall endpoint, sends packets to a fleet of appliances using the GENEVE protocol on port 6081, and brings them back, so you can scale the appliances and replace failed ones without changing routes.

The trade-off is ownership. With Network Firewall, AWS runs, scales and patches the firewall, and you manage rules. With Gateway Load Balancer and appliances, you choose the vendor and get its full feature set and familiar management console, but you also run the instances, size them, license them and patch them. Many companies pick Gateway Load Balancer because their security team already knows a particular vendor's product and its rules; teams without that history usually find Network Firewall far less work. Vendor-managed cloud firewalls in AWS Marketplace sit in between: the vendor's rule engine, without you running the instances. Our load balancer comparison explains where Gateway Load Balancer fits among AWS load balancers.

Network Firewall as a proxy (preview)

"AWS Network Firewall proxy" searches refer to a newer mode. Everything above describes the default source-preservation mode, where the firewall is invisible to your servers: traffic is routed through it and keeps its original addresses. A second mode, no-source-preservation, turns Network Firewall into an explicit forward proxy. Clients are configured to send their traffic to the proxy through a PrivateLink endpoint; the firewall checks it against your rules and, if allowed, opens a new connection to the destination using the IP address of an attached NAT gateway. The original client address is hidden from the destination, which is where the mode's name comes from.

At the time of writing, this mode is in preview and available only in US East (Ohio). It suits environments that already use an explicit proxy for outbound web traffic and want a managed replacement. For most readers, the transparent, route-based mode remains the one to deploy, because it needs no client configuration and handles every protocol.

Logs: alerts, flows and TLS

Network Firewall can send three kinds of logs: alert logs for traffic that matched a rule with a drop, reject or alert action; flow logs describing the flows the stateful engine handled; and TLS logs for TLS inspection events. Each can go to an S3 bucket, a CloudWatch Logs log group or an Amazon Data Firehose stream. Alert logs are where you tune rules and investigate incidents; flow logs are large and usually belong in S3, queried with Athena when needed.

Logs cost money at the destination, and full flow logs for busy VPCs add up, so many teams send alert logs to CloudWatch Logs for quick searches and flow logs to S3 with a lifecycle rule. For traffic that never reaches the firewall, VPC Flow Logs remain the tool; our VPC Flow Logs guide covers them.

Which firewall do you need?

Your situationWhat to use
A public website or APIAWS WAF with managed rules, plus Shield Standard (automatic)
Servers must reach only approved destinationsNetwork Firewall with a domain allow list; or, on a budget, DNS Firewall plus strict security group outbound rules
An auditor requires network intrusion preventionNetwork Firewall with AWS managed threat signature rule groups
Many VPCs and accountsCentralized Network Firewall behind a transit gateway, deployed with Firewall Manager
Your company uses a specific firewall vendorThat vendor's cloud firewall from AWS Marketplace, or appliances behind a Gateway Load Balancer
Block malicious domains only, cheaplyRoute 53 Resolver DNS Firewall
Control which ports each server acceptsSecurity groups (always, whatever else you use)

Ethan's accounting firm ended up with three layers: the WAF it already had on the website, tightened security groups with explicit outbound rules, and one Network Firewall in a shared egress VPC with a domain allow list of about forty names. The firewall costs a little under $600 a month across two Availability Zones, and the NAT gateway charges it replaced paid for part of that. The auditor's next question, "show me what is blocked", was answered with an Athena query over the alert logs.

Coming from Azure?

The Azure names map neatly: Azure Firewall is the counterpart of AWS Network Firewall (a managed stateful firewall for virtual networks), and Azure Web Application Firewall on Application Gateway or Front Door is the counterpart of AWS WAF. So "Azure Firewall vs WAF" is the same question as on AWS, with the same answer: one controls network connections, the other protects web applications, and most organizations run both.

Best practices and common mistakes

  • Keep firewall subnets dedicated to firewall endpoints, one per AZ, and route each AZ to its own endpoint.
  • Use strict rule order and an explicit default action, and start with alert-only default actions before you drop.
  • Set HOME_NET to every network you inspect in centralized designs.
  • Turn on appliance mode on the transit gateway attachment of an inspection VPC, or return traffic can land on a different AZ's endpoint and be dropped.
  • Chain a NAT gateway with the firewall in egress designs to get the NAT gateway charge waiver.
  • Prefer domain lists for egress, and add IP-based rules for destinations reached by address.
  • Use managed threat signatures rather than writing your own for known threats, and keep custom Suricata rules for your specific policy.
  • Keep security groups tight anyway: the firewall is a perimeter, and security groups remain the control around each resource.
  • Watch the bill per AZ: endpoints you no longer route traffic to still cost $288 a month each.

The mistakes behind most support tickets: a firewall subnet that also contains workloads (their traffic is not inspected), a missing internet gateway edge route table (inbound traffic bypasses the firewall), a centralized firewall with the default HOME_NET, action order rules that pass traffic the author expected a later drop rule to block, and expecting Network Firewall to stop web attacks that only a WAF can see.

Frequently asked questions

What is AWS Network Firewall?

A managed, stateful network firewall and intrusion prevention service for Amazon VPC. It inspects traffic routed through firewall endpoints in your VPC and can filter by address and port, by domain name, and with Suricata-compatible rules.

What is the difference between a WAF and a firewall?

A network firewall controls which connections can happen, based on addresses, ports, protocols and domains, for all kinds of traffic. A WAF inspects the content of web requests to stop attacks on web applications, such as SQL injection and bots.

AWS WAF vs Network Firewall: which do I need?

WAF for public web applications and APIs; Network Firewall to control and inspect VPC traffic, especially outbound traffic. They solve different problems, and many organizations use both.

Is AWS Network Firewall stateful or stateless?

Both. Stateless rule groups examine each packet on its own; stateful rule groups track connections and include domain lists and Suricata rules. Most policies forward all traffic to the stateful engine.

Is AWS Network Firewall a layer 7 firewall?

Partly. It can recognize application protocols and read the HTTP Host header and TLS server name, and it runs Suricata intrusion prevention rules, but it is not a web application firewall and does not protect application logic the way AWS WAF does.

Is AWS Network Firewall a next-generation firewall?

It covers many NGFW features (stateful inspection, IPS, protocol detection, domain filtering, TLS inspection, managed threat signatures) but not user-based rules or commercial application catalogs. Vendor NGFWs are available through AWS Marketplace.

How much does AWS Network Firewall cost?

In US East, $0.395 per endpoint-hour (about $288 a month per Availability Zone) plus $0.065 per GB processed, with extra charges for TLS inspection and advanced threat protection. NAT gateway charges are waived when chained with the firewall.

Is AWS Network Firewall free?

No, there is no free tier. Security groups, network ACLs and Shield Standard are the free controls.

Why is AWS Network Firewall so expensive?

Each endpoint is billed every hour it exists, about $288 a month per Availability Zone, before any data. Centralizing inspection in one VPC and chaining it with NAT gateways are the main ways to reduce the cost.

Can AWS Network Firewall inspect encrypted traffic?

Yes, with TLS inspection, which decrypts, inspects and re-encrypts traffic using certificates in AWS Certificate Manager. Without it, the firewall can still filter HTTPS by server name (SNI).

What is a Network Firewall secondary endpoint?

An additional endpoint for an existing firewall, in the same or another VPC, that uses the same policy. It is billed at a lower hourly rate ($0.158 in US East) than the primary endpoints.

Does Network Firewall replace security groups?

No. Security groups control which ports each resource accepts and stay your first layer; Network Firewall adds a perimeter layer with denies, domain filtering and intrusion prevention.

How do I set up AWS Network Firewall?

Create a dedicated firewall subnet per Availability Zone, rule groups and a firewall policy, then the firewall itself, and change your route tables so traffic flows through the firewall endpoint in each AZ, including an internet gateway edge route table for inbound traffic.

What is HOME_NET in AWS Network Firewall?

The variable that defines your inside network for domain lists and Suricata rules. It defaults to the deployment VPC's CIDR; in centralized designs you must add the spoke VPC ranges or their traffic is not filtered by those rules.

What is the difference between strict order and action order?

Action order evaluates all pass rules before drop, reject and alert rules regardless of position; strict order evaluates rule groups by priority and rules in the order written. Strict order is the recommended choice.

How does a domain list rule group match subdomains?

Start the name with a dot: .example.com matches example.com and every subdomain. A name without the dot matches only that exact host.

Where do Network Firewall logs go?

Alert, flow and TLS logs can go to Amazon S3, CloudWatch Logs or Amazon Data Firehose.

Can I use Network Firewall with a transit gateway?

Yes, in a centralized inspection VPC with appliance mode on its transit gateway attachment, or through a Network Firewall attachment directly on the transit gateway.

What is the difference between Network Firewall and Firewall Manager?

Network Firewall is the firewall; Firewall Manager deploys and enforces Network Firewall (and WAF, security groups and more) across many accounts in an organization.

Is Azure Firewall the same as AWS Network Firewall?

They are counterparts: both are managed stateful network firewalls. Azure Web Application Firewall corresponds to AWS WAF.

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Security – Specialty (SCS-C03) • Solutions Architect – Associate (SAA-C03) • CloudOps Engineer – Associate (SOA-C03).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. A company must allow its EC2 instances to reach only a list of approved internet domains and block all other outbound traffic. Which service fits?

AWS Network Firewall with a stateful domain list rule group (allow list).

2. A web application behind an Application Load Balancer must be protected from SQL injection and cross-site scripting. Which service should be used?

AWS WAF with managed rule groups.

3. After deploying AWS Network Firewall, inbound traffic from the internet is not being inspected. What is the most likely missing configuration?

An internet gateway route table (edge association) that routes the protected subnets' CIDRs to the firewall endpoints.

4. A centralized Network Firewall behind a transit gateway does not apply its domain list rules to traffic from spoke VPCs. What should be changed?

The HOME_NET rule variable, to include the spoke VPC CIDR ranges.

5. Which AWS feature lets a fleet of third-party firewall appliances inspect VPC traffic transparently and at scale?

Gateway Load Balancer.

6. A network team wants firewall rules evaluated in the exact order they are written. Which firewall policy setting achieves this?

Strict rule evaluation order.

7. Which free AWS controls should remain in place even when AWS Network Firewall is deployed?

Security groups and network ACLs.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

πŸ“š ALSO READ

Where to go next, from flow logs to DNS Firewall:

📌 Bookmark this; the decision table and the routing steps are the parts you will come back for.

Two weeks later, the firewall's first real alert arrived: a test server, set up by an intern and forgotten, was trying to reach a cryptocurrency mining pool every few minutes. The domain was not on the allow list, so the firewall dropped it, the alert log named the server, and Ethan shut it down before lunch. The WAF on the website never saw any of it, which was exactly his point to the client.

📌 If you keep one line from this page

AWS WAF protects web applications from malicious requests; AWS Network Firewall controls and inspects all VPC traffic, including what your servers send out, for $0.395 per endpoint-hour plus $0.065 per GB in US East; use a dedicated firewall subnet per AZ, strict rule order, and symmetric routing.

Different jobs · most companies need both · security groups stay underneath.

Revision note. Written October 21, 2026. Prices are US East list prices on that date. We will update this page when Network Firewall features or prices change.

Related