AWS in 1 Min · Episode 150

AWS Network Firewall explained

Control what leaves your VPC. Watch the one-minute video, then read the details.

David Gomez1:08 video · 3 min read

"Security groups are all the firewall you need." For many workloads they are a great first layer, but they filter traffic by protocol, port and address. They cannot tell whether an outbound HTTPS connection is going to your package mirror or to a site that's collecting stolen data. AWS Network Firewall adds that missing layer at the edge of your VPC.

What it is

AWS Network Firewall is a managed, stateful network firewall and intrusion detection and prevention service for Amazon VPC. It can filter traffic entering or leaving a VPC through an internet gateway, NAT gateway, transit gateway, VPN or Direct Connect, and traffic between subnets. AWS runs and scales the firewall; you write the policy.

It only sees what you route to it

The firewall works through firewall endpoints placed in a dedicated firewall subnet in each Availability Zone. You then change your VPC route tables so traffic goes through those endpoints. This is the most common mistake: if a route skips the firewall, that traffic is simply not inspected. Keep the firewall subnet for the firewall only, and use one endpoint per AZ so a zone failure doesn't drop your egress. (Newer options, such as a NAT/proxy firewall and an automated internet firewall at the internet gateway, change how traffic reaches it, so check the current setup guide for your design.)

Allow lists and intrusion prevention

The rules do the real work:

  • Domain allow lists: allow outbound traffic only to domains you name (for example your package repository and the AWS endpoints you use), and drop everything else. For HTTPS it matches the server name the client asks for.
  • Stateful rules compatible with Suricata, the open-source IPS engine, to inspect full packets and protocols, not just headers.
  • AWS managed rule groups with lists of known malicious domains and threat signatures that AWS keeps up to date.

AWS now recommends Next Generation firewall policies for new firewalls, which drop traffic by default and then apply intrusion prevention. Classic policies with stateless and stateful rule groups remain supported.

Many accounts, one policy

With AWS Firewall Manager you define a Network Firewall policy once and roll it out to the VPCs in every account in your AWS Organization, so new accounts don't start unprotected. Also plan for cost: the firewall is charged per endpoint hour plus data processed, and logging adds its own charges.

Where AI fits

AI agents are software that decides on its own which tools and websites to call. That is useful until a prompt injection convinces an agent to send data to an attacker's server. IAM limits which AWS actions an agent can take; Network Firewall limits where its traffic can go. Run agents in subnets whose egress passes through the firewall, with a domain allow list of the model endpoint and the APIs the agent genuinely needs. A tricked agent then can't reach a site you never approved, and the firewall logs show what it tried.

Quick recap

  • Security groups filter by port and address; Network Firewall adds domain filtering and intrusion prevention.
  • Route traffic through the firewall endpoints, or nothing is inspected.
  • Use domain allow lists, Suricata-compatible rules and AWS managed threat lists.
  • Give AI agents an egress allow list so they can only reach approved destinations.
AWS in 1 Min #150 · 1:08

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS