Lesson 3 of 3 Network Protection Services

Filtering Traffic and DNS with Network Firewall and DNS Firewall

This lesson explains how AWS Network Firewall inspects traffic inside and between VPCs and how Route 53 Resolver DNS Firewall filters DNS queries, and why both must be routed or associated correctly to work.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe Network Firewall deployment and rule groups.
  • Configure DNS Firewall rule groups and domain lists.
  • Audit both services in a single account.

AWS Network Firewall

AWS Network Firewall is a managed, stateful network firewall and intrusion prevention service. A firewall is deployed into dedicated firewall subnets, one per AZ, creating firewall endpoints. A firewall policy contains stateless rule groups (5-tuple rules evaluated first, with pass, drop or forward to stateful actions) and stateful rule groups (domain list rules to allow or deny by HTTP host or TLS SNI, standard 5-tuple rules, and Suricata-compatible IPS rules), plus AWS managed threat signature groups. TLS inspection can decrypt traffic with certificates from ACM.

Traffic is inspected only if routing sends it through the firewall endpoints. For internet egress, the private subnets route 0.0.0.0/0 to the firewall endpoint in their AZ, the firewall subnet routes to the NAT gateway or internet gateway, and for inbound inspection an IGW ingress route table sends traffic for the public subnets back through the firewall. Asymmetric routing, where return traffic bypasses the firewall or uses another AZ's endpoint, breaks stateful inspection. Alert, flow and TLS logs go to CloudWatch Logs, S3 or Firehose, and CloudWatch metrics show packets passed and dropped.

The following diagram compares routing that bypasses the firewall with routing through it.

How routing puts Network Firewall in the traffic path. If private route tables send 0.0.0.0/0 straight to the NAT gateways, traffic bypasses the firewall endpoints and nothing is inspected. Pointing each private route table at the firewall endpoint in its own AZ, and giving each firewall subnet a route to its AZ's NAT gateway, puts the firewall in the path.
Keeping each AZ's traffic on its own endpoint avoids cross-AZ charges and asymmetric routing.
Troubleshooting scenario

A firewall that sees nothing

Exam skills 5.1.3 · 5.3.1

Find why Network Firewall is not inspecting traffic.

Log in to try this activity Interactive activities are free with an account.

Route 53 Resolver DNS Firewall

DNS Firewall filters outbound DNS queries that VPC resources send to the Route 53 Resolver. Rule groups contain rules that reference domain lists, either your own or AWS managed lists of malware, botnet command-and-control and other threat domains, with actions ALLOW, BLOCK (with NODATA, NXDOMAIN or an override response) or ALERT (log only). Rule groups are associated with VPCs in priority order and can be shared with AWS RAM. The VPC's fail mode decides whether queries are allowed (fail open) or blocked (fail closed) if DNS Firewall cannot respond. Blocked and alerted queries appear in Resolver query logs. DNS Firewall only sees queries sent to the Route 53 Resolver; instances configured to use other DNS servers bypass it, which Network Firewall rules can prevent.

RequirementService
Block HTTP/SQL injection and rate-limit web requestsAWS WAF
Protect against large DDoS attacks with expert supportAWS Shield Advanced
Filter outbound traffic by domain, IPS signatures, stateful rules in the VPCAWS Network Firewall
Block DNS lookups of malicious domains from VPC resourcesRoute 53 Resolver DNS Firewall
Instance-level allow rulesSecurity groups
Subnet-level deny of IP rangesNetwork ACLs
Sort into groups

Network Firewall or DNS Firewall?

Exam skills 5.1.3

Choose the service that meets each filtering requirement.

Log in to try this activity Interactive activities are free with an account.

Auditing in a single account

The exam guide asks for auditing these services in a single account. For Network Firewall, confirm that every subnet's route table sends the intended traffic through the endpoint in the same AZ, that the policy contains the expected rule groups with drop actions (not only alerts), that logging is enabled, and that metrics show traffic being inspected. For DNS Firewall, confirm that rule groups are associated with every VPC, that block rules are not in ALERT mode, that the fail mode matches policy, and that Resolver query logging is enabled. Reachability Analyzer can confirm whether a path passes through a firewall endpoint.

Worked example

A firewall that inspects nothing

A Network Firewall deployment shows zero packets in its metrics, although applications reach the internet. The private subnets' route tables still send 0.0.0.0/0 directly to the NAT gateways; the firewall endpoints were created but never inserted into the path. The engineer changes the private route tables to point 0.0.0.0/0 to the firewall endpoint in the same AZ and gives each firewall subnet a route table that sends 0.0.0.0/0 to the NAT gateway in its AZ, keeping traffic symmetric. Flow logs from the firewall then show the expected traffic and the domain deny list starts dropping requests.

Check yourself

Which service blocks queries for malicious domains through the Route 53 Resolver?

Show answer

Route 53 Resolver DNS Firewall.

Exam Tips

Remember for the exam

  • Network Firewall inspects only traffic routed through its endpoints; keep routing symmetric per AZ.
  • Stateful rule groups filter by domain (HTTP host, TLS SNI) and Suricata IPS rules.
  • DNS Firewall blocks or alerts on domains queried through the Route 53 Resolver.
  • ALERT mode logs only; check actions when auditing.
  • Choose WAF for web layer, Shield for DDoS, Network Firewall for VPC traffic, DNS Firewall for DNS.