Security groups and network ACLs decide which ports and addresses can talk inside a VPC, but they cannot see domain names, inspect payloads or stop a compromised workload from calling out to an attacker's server over port 443. AWS Network Firewall is the managed service that fills that gap: a stateful firewall and intrusion prevention engine, built on Suricata, that sits in the routing path at the VPC perimeter. Deploying it well is mostly about routing, rule evaluation order and logging, and getting any of the three wrong produces a firewall that is billed, attached and quietly passing everything. This guide covers how the service is built, who should be allowed to change it, how rule groups, managed rules and TLS inspection fit together, what to log and alert on, and a hardening baseline with rollout and rollback steps. It is written for cloud network and security engineers; for VPC fundamentals such as security groups, NACLs and endpoints, see the Amazon VPC Security Guide.
This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.
Key takeaways
- Routing is the control. The firewall only inspects traffic your VPC route tables send to its endpoints in dedicated firewall subnets; a missing route or an asymmetric path means traffic bypasses inspection without any error.
- Use strict rule order with a default drop. AWS recommends strict evaluation order. The default action order runs every pass rule before any drop rule regardless of priority, which surprises teams writing allow lists.
- Only stateful traffic is logged. Flow, alert and TLS logs cover traffic forwarded to the stateful engine; packets passed or dropped by stateless rules appear only in CloudWatch metrics.
- Managed rule groups are a fast start, not a policy. AWS maintains active threat defence, domain and IP, and threat signature groups, but egress allow lists for your own workloads still have to be written and owned.
- TLS inspection changes the trust model. Outbound decryption needs a CA certificate in AWS Certificate Manager that clients trust, drops non-TLS traffic in scope; plan separately for ECH, QUIC and StartTLS traffic, which sits outside TLS inspection (confirm current scope with AWS).
How AWS Network Firewall works
The service is defined by four resource types and two inspection engines.
| Resource | What it holds | Security relevance |
|---|---|---|
| Firewall | The primary VPC, one firewall subnet per Availability Zone, logging, encryption settings, delete protection | Changing subnets or logging changes what is inspected and recorded |
| VpcEndpointAssociation | Extra firewall endpoints for the same firewall in the primary VPC or other VPCs | Policy variables such as HOME_NET do not carry over automatically and must be set per association |
| FirewallPolicy | Stateless default actions, stateful engine options (rule order, stream exception policy, flow timeouts), policy variables, rule group references, optional TLS inspection configuration | One policy can be shared by many firewalls, so a policy edit has fleet-wide effect. Rule order is fixed at creation |
| RuleGroup | Stateless or stateful rules, with reserved capacity | Stateful groups can be Suricata-compatible rule strings, domain lists or standard five-tuple rules |
Stateless engine first. Each packet is checked individually against stateless rules, with actions Pass, Drop, Forward to stateful rules, or a custom action that publishes a CloudWatch metric dimension. Separate default actions apply to full packets and to UDP fragments; AWS notes fragments of other protocols are silently dropped. In almost every design the stateless default should be forward to stateful (aws:forward_to_sfe in the API), so that the stateful engine makes the decision and logs it.
Stateful engine second. Flows are tracked in a state table identified by source, destination, ports, protocol and direction. Stateful rule actions are pass, drop, reject (TCP only, sends a reset) and alert. A drop or alert match does not end evaluation, and an alert match does not imply pass.
Deployment. Network Firewall creates firewall endpoints in firewall subnets that must hold nothing else, and an endpoint cannot filter traffic entering or leaving its own subnet. VPC route tables steer traffic through it. The default source-preservation mode keeps original IP addresses and handles TCP, UDP and ICMP. A firewall can also be attached directly to a transit gateway, owned locally or shared through AWS RAM, which avoids building inspection VPC plumbing by hand. AWS lists VPC peering traffic, Global Accelerator traffic with client IP preservation and AmazonProvidedDNS traffic from EC2 as unsupported for inspection, so DNS-layer filtering needs a separate control such as Route 53 Resolver DNS Firewall. See the DNS Security Guide.
Choosing rule order, default actions and deployment model
| Decision | Options | Guidance |
|---|---|---|
| Rule evaluation order | Action order (default): pass, then drop, then reject, then alert, with priority 1 to 65535 inside each action. Strict order: rule groups by priority, rules in the order written | Choose strict order for new policies; it cannot be changed after the policy is created, and rule groups must match the policy setting |
| Strict order default drop | Drop all; Drop established; Application drop established (bidirectional); Application drop established (server-directed only) | Drop established is required for your own domain list rule groups. Application drop established lets you write application-layer pass rules without separate handshake rules; use server-directed only where protocols send server banners (SSH, SMTP, FTP) |
| Strict order default alert | Alert all; Alert established; application variants | Alert established alongside a drop gives log evidence of every denied flow; Drop established and Alert established cannot be mixed with the application variants |
| Stream exception policy | Drop (default, fail closed); Continue; Reject (fail closed and send reset so clients reconnect) | Reject suits most production egress; Continue can let mid-stream traffic avoid protocol-aware drop rules |
| Deployment model | Distributed (endpoints in each VPC); centralised inspection (transit gateway-attached firewall) | Small estates with a handful of VPCs often run distributed firewalls with a shared policy; multi-account estates usually centralise egress and east-west inspection on a transit gateway and manage policy through AWS Firewall Manager |
AWS also warns against relying on a default drop for application-layer matching such as HTTP headers: the default can act on a single packet before data spanning several packets is evaluated, so write explicit application drop rules instead. Under Application drop established (bidirectional), TCP control packets after the handshake may need explicit pass rules. Test both in alert-only mode before enforcing.
How identity and access work in AWS Network Firewall
Network Firewall is controlled entirely through IAM, and its own service identities are few but important.
- Human and pipeline access: callers authenticate as IAM roles (preferably federated through IAM Identity Center) and requests are signed with Signature Version 4. Identities have no permissions by default, and identity-based policies, permissions boundaries, SCPs, RCPs and session policies all apply. See the AWS IAM Policies and Roles Guide.
- Service-linked role:
AWSServiceRoleForNetworkFirewall, trusted only bynetwork-firewall.amazonaws.comand using the managed policyAWSNetworkFirewallServiceRolePolicy. It creates, describes and deletes the VPC endpoints for the firewall, reads VPC CIDRs and describes ACM certificates for TLS inspection. Do not try to replace it, but do monitor who can delete it. - Log delivery role: enabling logging may create
AWSServiceRoleForLogDelivery. The destination (S3 bucket, CloudWatch Logs group or Data Firehose stream) needs a policy that allows delivery and nothing broader. - Cross-account sharing: transit gateways for firewall attachment are shared through AWS RAM; rule groups and policies can be shared too, so a central security account can publish policy for workload accounts. Treat a RAM share as a trust relationship that needs review.
- Encryption: firewall data at rest uses AWS owned keys by default, with customer managed KMS keys as an option. If you choose a customer managed key, the key policy becomes part of the firewall's access model. See the AWS KMS Security Guide.
Admin roles and privileged access
Whoever can edit the firewall policy can turn off egress control for every VPC that shares it, so firewall administration is privileged network access.
| Role | Needs | Should not have |
|---|---|---|
| Network security engineers | Create and update rule groups and policies in a central security account, ideally only through a pipeline | Console write in production workload accounts |
| Platform or network owners | Create firewalls, firewall subnets and route table entries | Rule group edit rights (separation from rule authors) |
| Security operations | Read access to firewalls, policies, logs and metrics | Any write action, except a documented emergency block rule process |
| Application teams | Request changes to egress allow lists through a ticket or pull request | Direct write to shared rule groups |
Use SCPs to deny network-firewall:Delete*, logging configuration changes and policy association changes outside the network administration role, and to stop workload accounts from editing route tables that point at firewall endpoints. Delete protection is enabled when a firewall is created through the API, and must be explicitly disabled before deletion; the console's delete flow disables it for you, so console access to production is itself a risk. See the AWS Organizations and SCPs Guide.
Integrations, API tokens and service accounts
- Infrastructure as code: the service supports CloudFormation, the CLI (
aws network-firewall), SDKs and the REST API. Rule changes should flow through a pipeline whose deploy role is scoped to Network Firewall in the security account and assumed through OIDC federation rather than stored access keys. See the GitHub Actions to AWS federation guide. - AWS Firewall Manager: centrally configures firewalls across accounts in AWS Organizations. The Firewall Manager administrator account effectively controls inspection for the organisation and deserves the same protection as the management account.
- Managed rule groups: AWS managed groups (active threat defence, domain and IP, threat signature) are maintained by AWS and mostly free of extra charge; each set counts as one stateful rule group towards the policy limit. AWS Marketplace groups are partner-maintained: review the vendor's update and false-positive process before attaching.
- TLS inspection certificates: inbound inspection uses server certificates in ACM; outbound inspection uses a CA certificate that clients must trust. That CA can mint certificates for any domain your clients visit, so its private key and issuance must be governed like any other high-value CA. Self-signed certificates are not supported for inbound inspection and cross-signed roots are not supported. See the AWS Certificate Manager and Private CA Guide and the TLS Inspection Guide.
- Egress allow lists as identity control: workloads holding API keys and cloud credentials are the main exfiltration risk. Domain allow lists limit where a stolen credential can be used from inside your VPCs. See the Cloud Egress Filtering guide.
TLS inspection: what changes
| Behaviour | As documented by AWS | What to do |
|---|---|---|
| Non-TLS traffic inside the scope | Dropped | Scope only ports that carry TLS |
| Client hello with no SNI, or SNI not matching the server certificate | Dropped; ECH and encrypted SNI not supported (connection reset) | Exclude TLS 1.3 workloads that use ECH from scope |
| Protocols | TLS 1.1 to 1.3; HTTP/2 payload inspection supported; StartTLS, QUIC and other UDP transports not decrypted; WebSockets over HTTP/2 dropped | Add a stateful rule blocking QUIC so clients fall back to TCP |
| Enabling on a live firewall | Existing matching TLS flows are dropped | Enable in a change window, per scope, with rollback ready |
| Rules | Decrypted HTTP keywords apply; TLS keywords other than tls.sni generally do not match in scope | Rewrite TLS-keyword rules before enabling |
| Metrics | Separate TLS metrics; standard stateful metrics do not reflect decrypted traffic | Build dashboards on TLSDroppedPackets, TLSErrors and revocation status metrics |
| Behind an Application Load Balancer | Cannot inspect inbound TLS terminated at the ALB | Place inspection between ALB and targets, or rely on AWS WAF at the ALB. See the AWS WAF and Shield Guide |
TLS inspection is billed as advanced inspection by volume. Decide it per traffic class: outbound inspection of server workloads to the internet is usually worthwhile; inspecting regulated or privacy-sensitive flows may need legal review.
Logging and detection
Three log types are available for the stateful engine, and each can go to its own destination: Amazon S3, CloudWatch Logs or Amazon Data Firehose.
| Log or metric | Contains | Detection use |
|---|---|---|
| Alert log | Traffic matching stateful rules with drop, alert or reject actions | Blocked egress to unapproved domains, threat signature hits, repeated denials from one workload |
| Flow log | Standard flow records for traffic through the stateful engine | Volume anomalies, new destinations, long-lived sessions suggestive of tunnelling |
| TLS log | TLS inspection events, including certificate and revocation problems | Clients connecting to servers with revoked certificates, decryption errors |
CloudWatch metrics (AWS/NetworkFirewall) | ReceivedPackets, PassedPackets, DroppedPackets, RejectedPackets, InvalidDroppedPackets, StreamExceptionPolicyPackets, TLS metrics; dimensions include Engine, FirewallName, AvailabilityZone | Sudden drop in ReceivedPackets (routing bypass), spikes in drops after a rule change, stateless engine activity |
| AWS CloudTrail | Management API calls on firewalls, policies, rule groups and logging | Policy disassociation, logging removal, rule group edits outside the pipeline. See the AWS CloudTrail Guide |
Tune detections against T1071.001 Web Protocols, T1572 Protocol Tunneling, T1048 Exfiltration Over Alternative Protocol, T1567 Exfiltration Over Web Service and, for attacks on the control itself, T1685 Disable or Modify Tools. Logging costs scale with volume, so send alert logs everywhere and sample or summarise flow logs where budget forces a choice.
Metrics that show it is working:
- Percentage of VPCs with internet or transit egress routed through a firewall endpoint (target: all in-scope VPCs).
- Percentage of production firewalls with alert logging enabled and delivered to the SIEM.
- Number of policies using strict order with a default drop, against total policies.
- Mean time from approved egress request to deployed rule, which shows whether teams will route around the firewall.
- Count of rule group changes made outside the pipeline (target: zero).
Hardening baseline
- Design routing first. Dedicated firewall subnet per Availability Zone, routes from workload subnets to the endpoint in the same zone, and return routes from the internet or NAT gateway back through the same endpoint to avoid asymmetric paths and cross-zone charges.
- Create the policy in strict order. Stateless default forward to stateful for full packets; decide fragment handling explicitly; set
HOME_NETwhere the inspection VPC CIDR is not the right scope, including on every endpoint association. - Start in alert mode. Use Alert established (or Alert all) with no default drop, attach AWS managed threat signature and domain groups, enable alert and flow logs, and run for at least two business cycles to learn real egress.
- Build allow lists. Turn observed destinations into domain list or Suricata rule groups per application, owned by named teams, stored in version control.
- Enforce in rings. Switch to Drop established (or an application drop variant) for a non-production VPC, then a low-risk production VPC, then the rest. Watch
DroppedPacketsand alert logs at each step. - Set stream exception policy. Reject for most egress so clients recover quickly; keep Drop where fail-closed matters more than availability.
- Lock down change. SCPs and pipeline-only roles for policy, rule group and logging changes; CloudTrail alerts on
DisassociateSubnets,UpdateLoggingConfiguration,DeleteFirewalland rule group updates. - Add TLS inspection deliberately. Only after the allow list is stable, per scope, in a change window, with the client trust store change rolled out first.
- Rollback. Keep the previous rule group versions in version control; the fastest safe rollback is re-deploying the prior rule group or switching the default back to alert, not removing routes, which silently removes inspection.
Common misconfigurations
- Action order with allow lists: a broad pass rule beats every drop rule regardless of priority, so the "deny" rules never fire.
- Asymmetric or missing routes: one Availability Zone or one subnet left on the old route table sends traffic around the firewall. The
ReceivedPacketsmetric for that zone stays at zero and nobody notices. - Stateless rules doing the real work: packets passed by stateless rules are never logged, so investigations find no record.
- Firewall subnet shared with workloads: an endpoint cannot inspect traffic in its own subnet, so anything placed there is uninspected.
- Endpoint associations without policy variables:
HOME_NETis not inherited, so rules scoped to it behave differently on the associated endpoint. - Assuming DNS is covered: AmazonProvidedDNS queries from EC2 are not inspected, so DNS tunnelling and lookups of malicious domains need DNS Firewall or equivalent.
Framework mapping
| Network Firewall capability | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 |
|---|---|---|
| Perimeter and egress filtering, default deny | SC-7 Boundary Protection; CM-7 Least Functionality | PR.IR-01 |
| Intrusion prevention and threat signatures | SI-4 System Monitoring | DE.CM-01 |
| Alert, flow and TLS logging | AU-6 Audit Record Review, Analysis, and Reporting | PR.PS-04 |
| TLS inspection with re-encryption | SC-8 Transmission Confidentiality and Integrity | PR.IR-01 |
In ISO/IEC 27001:2022 terms this supports Annex A 8.20 (networks security), 8.22 (segregation of networks), 8.16 (monitoring activities) and 8.23 (web filtering).
Practitioner checklist
- Every in-scope VPC routes internet and transit egress through a firewall endpoint in the same Availability Zone, with symmetric return paths.
- Firewall subnets contain only firewall endpoints.
- Policies use strict order, stateless default forward to stateful, and a deliberate default drop plus alert.
- AWS managed threat signature and domain groups attached and reviewed for false positives.
- Application egress allow lists in version control with named owners and a pipeline-only deploy role.
- Alert logs (and flow logs where affordable) delivered to the SIEM, with CloudWatch alarms on zero
ReceivedPacketsper zone and on drop spikes. - SCPs deny firewall, policy and logging changes outside the network administration role; delete protection left on.
- DNS-layer filtering deployed separately for AmazonProvidedDNS traffic.
- TLS inspection, if used, scoped narrowly, with the CA governed and TLS metrics monitored.
- Documented rollback that reverts rules or defaults rather than removing routes.
Standards and references
- AWS Network Firewall Developer Guide: What is AWS Network Firewall?
- AWS Network Firewall Developer Guide: Evaluation order for Suricata compatible rules
- AWS Network Firewall Developer Guide: Stream exception policy options
- AWS Network Firewall Developer Guide: Considerations for TLS inspection configurations
- AWS Network Firewall Developer Guide: Firewall logging
- AWS Network Firewall Developer Guide: CloudWatch metrics
- AWS Network Firewall Developer Guide: Using service-linked roles
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Amazon VPC Security Guide · Cloud Egress Filtering · Suricata IDS Guide · AWS Security Guide · Firewall Rule Review Checklist