keepcalculator

06 Numbers and Powers

AWS Network Firewall Alternatives for VPC Traffic

Card No. 06·30052 · Updated · Standard formula, shown below

AWS Network Firewall is a managed firewall that filters traffic at the VPC level, but it is not the only option. Depending on your needs for cost, control, or advanced features, you can use security groups, network ACLs, AWS WAF, Gateway Load Balancer with third-party appliances, or AWS Route 53 Resolver DNS Firewall.

Why Look Beyond AWS Network Firewall?

AWS Network Firewall provides stateful inspection, intrusion prevention, and domain filtering, but it can be overkill for simple workloads or underpowered for complex ones. It charges per hour and per gigabyte processed, so high-traffic VPCs can see significant costs. Also, some teams find its rule syntax and deployment model (requiring a dedicated subnet and route table changes) more complex than needed. Understanding the alternatives helps you match the tool to the actual threat model and budget.

Security Groups: The First Layer

Security groups act as a virtual firewall at the instance or ENI level. They are stateful, meaning return traffic is automatically allowed. You specify allow rules only; there is no explicit deny rule. This makes them ideal for basic east-west traffic control between instances in the same VPC.

  • Use when: You need simple allow/deny by IP, port, or another security group.
  • Limits: No layer-7 inspection, no intrusion prevention, and no logging of blocked traffic (only allow events are logged via VPC Flow Logs).
  • Cost: Free to use; you only pay for the instances themselves.

For example, a web server security group might allow inbound HTTPS from 0.0.0.0/0, while a database security group allows inbound MySQL only from the web server security group. This is the most common and cheapest way to protect VPC traffic.

Network ACLs: Stateless Subnet Filtering

Network ACLs (NACLs) operate at the subnet level and are stateless. You must define both inbound and outbound rules, and they support explicit deny rules. Each rule has a number; lower numbers are evaluated first.

  • Use when: You need subnet-wide filtering, such as blocking a specific IP range from reaching any resource in a subnet.
  • Limits: No state tracking, so you must open return ports manually. No layer-7 inspection.
  • Cost: Free to use.

NACLs are often used as a backup to security groups, providing a second layer of defense. For instance, you might block all traffic from a known malicious IP range at the NACL level, even if a security group accidentally allows it.

AWS WAF: Web Application Firewall

AWS WAF protects web applications from common exploits like SQL injection and cross-site scripting. It integrates with Application Load Balancer (ALB), API Gateway, and CloudFront. WAF rules are managed via web ACLs and can include rate-based rules to block IPs that send too many requests.

  • Use when: You need to filter HTTP/HTTPS traffic based on URI, query string, headers, or body.
  • Limits: Only works at the application layer (layer 7). It does not inspect non-web protocols like SSH or database traffic.
  • Cost: Per web ACL and per rule, plus a small per-request fee.

If your VPC hosts a public-facing web application, WAF is often a better fit than Network Firewall because it understands HTTP semantics. For example, you can block requests that contain a SQL injection pattern in the query string, which Network Firewall cannot do natively.

Gateway Load Balancer with Third-Party Appliances

Gateway Load Balancer (GWLB) allows you to insert third-party virtual appliances, such as firewalls from Fortinet, Palo Alto, or Check Point, into your network path. You deploy appliances in a separate VPC and route traffic through them via a GWLB endpoint in your VPC.

  • Use when: You need advanced features like TLS inspection, application identification, or centralized management across multiple VPCs.
  • Limits: Requires you to manage and scale the appliances yourself; licensing costs apply.
  • Cost: GWLB charges per hour and per GB processed, plus the appliance instances and licenses.

This option is for organizations that already use a specific vendor’s firewall and want to keep the same features in AWS. For example, if your on-premises security team uses Palo Alto, you can run the same firewall in AWS and manage it with the same Panorama console.

Route 53 Resolver DNS Firewall

DNS Firewall is a managed service that filters DNS queries at the VPC level. It blocks or allows domain names based on domain lists you create. It is useful for preventing outbound communication with known malicious domains or enforcing corporate internet policies.

  • Use when: You want to block DNS resolution for certain domains, such as ad trackers or known malware sites.
  • Limits: Only inspects DNS traffic; does not filter IP traffic.
  • Cost: Per domain list and per query.

For example, you can create a domain list that includes “bad-site.com” and associate it with the VPC. Any instance trying to resolve that domain will get a blocked response. This is a lightweight complement to other firewalls.

How to Choose the Right Alternative

Start by identifying your traffic types and threat model. If you only need basic port filtering, security groups are sufficient. If you need subnet-level blocking, add NACLs. For web traffic, use WAF. For full packet inspection with third-party features, use GWLB. For DNS-level control, use DNS Firewall.

Consider the following factors:

  • Traffic volume: High throughput may push you toward native services that scale automatically.
  • Inspection depth: Do you need layer 7? Then WAF or an appliance is necessary.
  • Management overhead: Security groups and NACLs are simple; appliances require patching and scaling.
  • Cost: Native services are often cheaper than appliance licenses.
  • Compliance: Some regulations require specific firewall features, which may dictate a third-party appliance.

Many environments use a combination: security groups for instance-level control, NACLs for subnet-level, and WAF for web-facing ALBs. This layered approach is cost-effective and covers most needs.

Common Misconceptions

A common misconception is that AWS Network Firewall is required for any VPC with internet access. In reality, security groups and NACLs are sufficient for many workloads, and they are free. Another misconception is that Network Firewall can inspect encrypted traffic; it cannot decrypt HTTPS, so it only sees the destination IP and port, not the payload. For TLS inspection, you need a third-party appliance via GWLB.

Also, some believe that WAF can replace security groups. WAF only works on HTTP/HTTPS traffic that goes through an ALB, CloudFront, or API Gateway. It does not protect SSH or database traffic. So you still need security groups for those.

Frequently Asked Questions

Can I use security groups and Network Firewall together?

Yes, they are complementary. Security groups filter at the instance level, while Network Firewall filters at the VPC level. You can use both to create a defense-in-depth strategy.

Is AWS WAF cheaper than Network Firewall?

For low traffic, WAF can be cheaper because it charges per request, whereas Network Firewall charges per hour and per GB. For high traffic, Network Firewall may be more cost-effective if you need stateful inspection. Compare your expected traffic volume to estimate costs.

Can I use a third-party firewall without Gateway Load Balancer?

Yes, you can deploy a firewall instance directly in your VPC and route traffic through it using route tables. However, this requires manual failover and scaling. GWLB simplifies this by providing automatic load balancing and health checks.

Does DNS Firewall replace Network Firewall?

No. DNS Firewall only filters DNS queries. It does not inspect IP traffic. You would typically use it alongside security groups or Network Firewall for complete protection.

What about using AWS Firewall Manager?

Firewall Manager is a management service that lets you centrally configure and apply security policies across multiple accounts and VPCs. It can manage security groups, Network Firewall, WAF, and DNS Firewall. It is not an alternative to those services but a way to manage them at scale.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →