TTechclick ⚡ XP 0% All lessons
AWS · Network · VPC Network SecurityInteractive · L1 / L2 / L3

AWS Network Firewall & Secure VPC Design: — Drawing the Line Around Your Cloud

Security groups guard one server and NACLs guard a subnet — but who watches everything that LEAVES your VPC for the open internet? AWS Network Firewall is the managed, stateful, VPC-level gate that does egress control, IPS and domain filtering. This lesson builds the mental model so you stop confusing the three layers and can design a VPC that doesn't leak.

📅 2026-06-11 · ⏱ 13 min · 3 live demos · 4 infographics · 🏷 10-Q assessment + AI Tutor inline

⚡ Quick Answer

AWS Network Firewall & secure VPC design for L1/L2 engineers and SCS-C02: SG vs NACL vs Network Firewall, inspection VPC + Transit Gateway, Suricata stateful rules, domain egress filtering.

🎯 By the end you will be able to

Read as:

Pick where you want to start

1

The 3 layers

SG vs NACL vs Network Firewall — who does what.

2

Inspection VPC

TGW, appliance mode and the route-table dance.

3

Rules + egress

Stateless, stateful, Suricata and domain allow-lists.

4

Put it together

A leak-proof multi-tier VPC + cheat-sheet.

🧠 Warm-up — 3 questions, no score

Just notice which ones make you pause. We answer all three inside the lesson.

1. A security group blocks inbound, but an attacker who already has a shell on your EC2 instance wants to send stolen data OUT to evil-domain.example. Which control is built to stop that egress by domain name?

Answered in The 3 layers.

2. You want one firewall to inspect traffic for 30 VPCs across 4 accounts, in one place. What's the usual hub you route everything through?

Answered in Rules + egress.

3. Network Firewall says it's deployed but the metric ReceivedPackets is stuck at zero. Most likely cause?

Answered in Inspection VPC.

Most engineers think…

Most engineers think a security group is the VPC firewall — "I locked down the SG, so my VPC is firewalled." So they picture one control doing every job: blocking inbound, blocking outbound, and catching attacks.

Wrong — and this gap is exactly what gets exploited. A security group is a stateful allow-list on ONE elastic network interface; a NACL is a stateless allow/deny list on a subnet boundary. Neither does deep inspection, IPS signatures, or domain-based egress filtering. When an attacker is already inside and quietly beaconing out to a random domain, only a real IPS-grade, stateful, VPC-level control catches it. That control is AWS Network Firewall — a managed Suricata engine that sits in its own subnet and inspects traffic the SG and NACL never see in detail.

① The VPC security layers — SG, NACL & Network Firewall

Meet Sneha, an L1 cloud engineer at Flipkart. Her VPC 10.20.0.0/16 hosts a payments app. On day one she's told "the VPC is secured — the security groups are tight." Then an incident lands: a compromised container is quietly sending data out to data-collector.unknown-site.example over port 443. The security group allowed all outbound (the default), so nothing stopped it. This is the lesson in one story: the three VPC layers do different jobs, and most leaks happen in the gap between them.

Layer one is the security group (SG). It's attached to an ENI (an instance, a load balancer, an RDS endpoint). It is stateful — if you allow an inbound request, the reply is allowed automatically — and it only has allow rules. Think of it as the guard standing at your individual flat's door. The classic default mistake: outbound is left wide open (0.0.0.0/0 allow all), so a host can talk to anything on the internet.

Layer two is the network ACL (NACL). It sits on the subnet boundary, is stateless (you must write both the inbound AND the matching outbound/ephemeral-port rule yourself), and supports explicit deny. Think of it as the society's main gate register — it sees everyone entering or leaving the whole building block, but it only checks IP, port and protocol numbers. It still can't tell that one HTTPS flow is a legitimate API call and another is exfiltration to a strange domain.

👉 So far: SG = stateful, per-ENI, allow-only; NACL = stateless, per-subnet, allow+deny. Both judge only by IP/port/protocol. Next: the layer that actually inspects.

Layer three is AWS Network Firewall. It is a managed service — AWS runs the engine, scales it, and patches it — that you deploy as firewall endpoints inside dedicated subnets of your VPC. Under the hood it runs a Suricata-compatible engine, so it can match attack signatures (true IPS), filter by domain name (the SNI in a TLS handshake or the HTTP Host header), and — if you enable it — do TLS inspection to look inside encrypted traffic. This is the layer that catches Sneha's exfiltration.

Figure 1 — Three layers, three different jobs — and the gap an attacker uses
Security groups guard one server and NACLs guard a subnet, but only AWS Network Firewall inspects what leaves the VPC Three nested security zones. Innermost is an EC2 instance with a security group, a stateful allow-only control on the elastic network interface. Around it is a subnet with a network ACL, a stateless allow and deny control. Around the whole VPC sits the AWS Network Firewall endpoint, the only layer doing deep packet inspection, intrusion prevention signatures and domain-based egress filtering. A red exfiltration arrow leaves the instance, passes the wide-open security group and NACL, and is finally stopped at the Network Firewall. Red marks the attacker path, blue the inspected boundary, amber the policy decision, green the allowed flow. Three layers around your workload — each judges a different thing VPC 10.20.0.0/16 — AWS Network Firewall inspects the edge (IPS + domain + TLS) Subnet 10.20.10.0/24 — NACL: stateless, allow + deny, IP/port only Security group — stateful, per-ENI, allow-only EC2 — payments app 10.20.10.5 · compromised exfil 443 → unknown domain SG (allow-all out) + NACL wave it through… Network Firewall DROP unknown domain Only the firewall reads the domain and stops the leak — SG and NACL can't see it untrusted / attackertrusted / inspectedpolicy / decisionkey insightallowed
Read inside-out: the SG hugs one ENI, the NACL wraps the subnet, the Network Firewall sits at the VPC edge and is the only layer that inspects content + domain. Outbound exfiltration (red) walks straight past SG and NACL.

The three layers, one tap each

Tap each card. If you can rattle these off, half the SCS-C02 Infrastructure Security domain stops being scary.

🚪
Security group
tap to flip

Stateful, attached to an ENI, allow-only. Reply traffic auto-allowed. So: per-server guard, IP/port only — blind to content.

🛂
Network ACL
tap to flip

Stateless, on the subnet, allow + deny, both directions written by hand. So: cheap broad deny — still IP/port only.

🔬
Network Firewall
tap to flip

Managed, stateful, VPC-level Suricata IPS. Domain filtering + optional TLS inspection. So: the only layer that reads what's inside.

🧱
Defense in depth
tap to flip

Use all three — SG for the host, NACL for blunt subnet deny, firewall for inspection + egress. So: a leak must beat every layer.

Daily-life analogy — the society gate-pass register

Picture a Bengaluru apartment society. The security group is the lock on your individual flat — it decides who gets into your door. The NACL is the society's main-gate register that notes everyone entering or leaving the whole block, but only checks the vehicle number (IP/port). The Network Firewall is the trained guard who actually opens the delivery box, checks WHAT is being carried out, and recognises the courier's company name (the domain). A thief can have a valid vehicle number and still get caught at the third check — which is exactly why you need all three.

Quick check · Q1 of 10

Rahul at Infosys says: "My EC2 has a tight security group and the subnet has a NACL. Am I protected against an infected host beaconing out to a malicious domain on 443?" Best answer?

Correct: b. SG and NACL match on IP, port and protocol — neither reads the SNI/Host to block by domain. AWS Network Firewall's stateful domain rule group is the control built for that. The SG default is allow-all OUTBOUND (not block), NACLs don't inspect domains, and an ALB's TLS termination doesn't filter arbitrary egress from instances.

Pause & Predict

Predict: a security group is stateful but a NACL is stateless. If you ALLOW inbound HTTPS (443) on a NACL, will the reply traffic flow back automatically? Type your guess.

Answer: No. Because the NACL is stateless, it evaluates each direction independently — you must ALSO add an outbound rule allowing the ephemeral return ports (typically TCP 1024–65535) or the response is dropped. The security group, being stateful, would have allowed the reply automatically. This 'forgot the ephemeral-port outbound rule' is one of the most common NACL mistakes new engineers hit.

② Architecture patterns — inspection VPC, TGW & the route-table dance

One firewall per VPC works for a single app, but real estates have dozens of VPCs across many accounts. You don't deploy a firewall in each — you build a central inspection VPC and route everyone's traffic through it. The hub that makes this possible is the Transit Gateway (TGW): every spoke VPC attaches once, and the TGW route tables steer traffic into the inspection VPC before it goes anywhere else.

Inside the inspection VPC, AWS requires a specific subnet layout. In each Availability Zone you put two subnets: one for the TGW attachment and a separate one that holds only the firewall endpoint. That firewall subnet must contain no other resources — Network Firewall cannot inspect traffic that originates in the same subnet as its own endpoint. You also deploy an endpoint per AZ for resilience: if you only put one in AZ-a, an AZ-a outage takes your inspection offline.

Now the part that trips everyone up: appliance mode. A stateful firewall must see both directions of a flow on the same endpoint. Without appliance mode, the TGW can hash the return traffic to a firewall endpoint in a different AZ — the firewall sees half a conversation, decides it's asymmetric, and drops it. You enable appliance mode on the inspection-VPC's TGW attachment so the TGW pins each flow to one endpoint for its whole life.

👉 So far: spokes → TGW → inspection VPC; two subnets per AZ; appliance mode keeps a flow on one endpoint. Next: how the route tables actually force traffic through the firewall.

The "route-table dance" is just making the next hop be the firewall. In the inspection VPC, the TGW-attachment subnet's route table sends 0.0.0.0/0 to the firewall endpoint; the firewall subnet's route table then sends the inspected traffic onward (to a NAT gateway for egress, or back to the TGW for east-west). If ReceivedPackets on the firewall stays at zero, it's almost always a route table that doesn't actually point at the endpoint — not a rule problem. Compare this to a third-party NGFW appliance: with a vendor NGFW you run EC2 instances behind a Gateway Load Balancer and own the patching/scaling; with Network Firewall, AWS owns all of that — you only own the rules and routes.

Figure 2 — Central inspection: every spoke's traffic detours through one firewall
A central inspection VPC behind a Transit Gateway forces every spoke VPC's egress through one managed firewall A hub-and-spoke diagram. Two spoke VPCs, an app VPC and a data VPC, each attach to a central Transit Gateway. The Transit Gateway route table sends their traffic into a dedicated inspection VPC. The inspection VPC has, per Availability Zone, a Transit Gateway attachment subnet and a separate firewall endpoint subnet. Appliance mode on the inspection attachment keeps each flow pinned to one endpoint. After inspection the traffic exits through a NAT gateway to the internet. Amber marks the route-table decisions, blue the inspected path, green the allowed egress, red an attempted bad flow that the firewall drops. Centralized egress — spokes detour through one inspection VPC App VPC (spoke)10.20.0.0/16 Data VPC (spoke)10.30.0.0/16 Transit Gatewayroute → inspection VPC Inspection VPC (appliance mode ON) TGW-attach subnetrt: 0/0 → fw endpoint Firewall endpointper AZ · own subnet NAT gateway → internetonly inspected traffic exits ✗ bad domain dropped here Key insight: route tables (amber) are what force the detour — no route, no inspection ReceivedPackets = 0 → a route doesn't point at the firewall endpoint, not a rule bug untrusted / droppedinspected pathroute / decisionkey insightallowed egress
Follow a packet from a spoke VPC: it goes up to the TGW, the TGW routes it into the inspection VPC (appliance mode pins the AZ), the firewall endpoint inspects it, then it exits via NAT. Controllers of the path are the route tables, shown in amber.
Common mistake — "firewall is deployed but ReceivedPackets is 0 / traffic is being dropped randomly"

Symptom one: the firewall shows healthy but the ReceivedPackets CloudWatch metric sits at zero — the route table never actually sends traffic to the firewall endpoint, so nothing reaches it. Fix: point the source subnet's route (and the IGW ingress route, for inbound designs) at the firewall VPC endpoint ID. Symptom two: traffic flows but a chunk gets dropped for no obvious reason across AZs — that's asymmetric routing because appliance mode is off on the inspection TGW attachment, so return packets land on a different-AZ endpoint. Fix: enable appliance mode on that attachment.

Quick check · Q2 of 10

Priya at HCL builds a central inspection VPC with firewall endpoints in three AZs. East-west traffic works most of the time but randomly drops on long-lived connections. Single most likely root cause?

Correct: b. Random drops on cross-AZ flows are the textbook signature of asymmetric routing: without appliance mode the TGW can send the return path to a firewall endpoint in another AZ, which sees only one direction and drops the stateful flow. Rule order affects which rule matches, not AZ symmetry; TLS-inspection CPU is AWS-managed; and a shared subnet would break inspection entirely, not randomly.

Pause & Predict

Predict: why does AWS insist the firewall endpoint live in its OWN subnet with nothing else in it? Type your guess.

Answer: Because Network Firewall cannot inspect traffic that originates from the same subnet as its own endpoint — the endpoint is the next-hop you route TO, so a workload sitting beside it would be able to send traffic that never passes through the inspection path. Isolating the endpoint in a dedicated, workload-free subnet guarantees that every packet from the protected subnets is forced through the endpoint as a routed hop, with no way to sidestep it.

③ Rule groups + egress control — stateless, stateful, Suricata & domains

A firewall does nothing until you give it a firewall policy, which bundles two kinds of rule groups. Stateless rule groups run first and look at each packet alone using the 5-tuple (source/destination IP, source/destination port, protocol). Their job is a quick triage: pass obviously-fine traffic, drop obvious junk, and — crucially — forward everything else to the stateful engine. If you forget to forward, the stateful rules never see the traffic.

Stateful rule groups are where the real inspection happens. They run on the Suricata engine and come in three flavours: a 5-tuple standard group, a domain list group (allow or deny by domain), and raw Suricata rule strings for full control. You also choose an evaluation order: strict order (recommended — rules run in the priority you set, and you declare default actions for non-matching packets) versus the older default action-order.

Here's the egress-control move that stops data exfiltration. A stateful domain list rule group lets you write an allow-list: only let traffic out to .amazonaws.com, your partner APIs, and your package mirrors — everything else is dropped. For HTTPS the firewall reads the SNI in the TLS handshake; for HTTP it reads the Host header. By default the domain rule group only inspects traffic from the VPC's own CIDR — to inspect other CIDRs (a centralized design) you must widen the HOME_NET variable. A freshly-shipped 2025 feature even lets domain rules use Reject and Alert actions, not just drop.

👉 So far: stateless triages on the 5-tuple, stateful inspects the flow, domain lists do egress allow-listing, HOME_NET sets your 'inside'. Next: managed signatures + where the logs go.

You don't have to write every attack signature yourself. AWS publishes managed threat-signature rule groups (botnet command-and-control domains, known malware signatures) that AWS keeps updated — you just add them to the policy. And every decision can be logged: Network Firewall writes FLOW logs (a record of every flow) and ALERT logs (only traffic that matched a drop/alert rule) to one of three destinations — an S3 bucket, a CloudWatch Logs group, or a Kinesis Data Firehose. Logging is what turns the firewall from a silent gate into evidence you can hunt through.

Suricata-compatible stateful rule — block egress to a known-bad domain (drop + alert)
# A raw Suricata rule string in a stateful rule group (strict order).
# Drops any HTTPS to the bad SNI and writes an alert log line.
drop tls $HOME_NET any -> $EXTERNAL_NET any (tls.sni; \
  content:"data-collector.unknown-site.example"; \
  msg:"Blocked exfil to unknown domain"; sid:1000001; rev:1;)

# Same idea as a domain-list ALLOW (egress allow-list — deny everything else):
#   Type: Domain list  |  Action: Allow
#   Domains: .amazonaws.com, .flipkart-internal.example, .ubuntu.com
Expected output
# CloudWatch ALERT log (JSON, trimmed) when the EC2 host tries the bad domain:
{"event_timestamp":"1749600000","event":{
  "src_ip":"10.20.10.5","dest_ip":"203.0.113.45","app_proto":"tls",
  "tls":{"sni":"data-collector.unknown-site.example"},
  "alert":{"action":"blocked","signature":"Blocked exfil to unknown domain","signature_id":1000001}}}
🖥️ This is the screen you'll use — Amazon VPC Console → Network Firewall → Network Firewall rule groups → Create rule group (Stateful → Domain list). (Recreated for clarity — your console matches this.)
console.aws.amazon.com/vpc · Network Firewall · Create rule group
1
Rule group type
Stateful rule group
2
Rule group format
Domain list
3
Rule group name
egress-allowlist-prod
Domain list
.amazonaws.com .ubuntu.com .flipkart-internal.example
Protocols
HTTP (Host) · HTTPS (SNI)
4
Action
Allow (deny all others)
Create stateful rule group

▶ Watch one egress packet run the firewall policy

An EC2 host at 10.20.10.5 opens HTTPS to an unknown domain. Follow it through the stateless triage, the stateful engine and the domain check. Press Play for the healthy path, then Break it to see the failure.

① Stateless triage10.20.10.5:51000 → 203.0.113.45:443 TCP — 5-tuple OK, action forward to stateful
② Stateful flowSuricata reassembles the flow; reads the TLS SNI = data-collector.unknown-site.example
③ Domain checkSNI is NOT on the allow-list (.amazonaws.com, .ubuntu.com…) → policy says drop
④ Log + droppacket dropped; an ALERT log line written to CloudWatch/S3 — your SOC sees the exfil attempt
Press Play to step through the healthy path. Then press Break it.
Prove the firewall is actually inspecting, not just 'created'

Three quick proofs. (1) In CloudWatch, the firewall's ReceivedPackets metric should be climbing — if it's zero, your routes don't point at the endpoint. (2) Generate a test hit to a domain that's NOT allow-listed and confirm an ALERT log line appears in your S3/CloudWatch destination. (3) Check the firewall's status is READY and the policy shows your stateful rule group attached. If all three hold, traffic is genuinely being inspected — not just routed past a firewall that's doing nothing.

Karthik at Zomato faces this

Karthik, an L2 analyst, gets an alert that an EC2 worker is talking to a suspicious domain. He adds a stateful domain DENY rule for it, but the next day the same host reaches the domain again — the rule didn't bite.

Likely cause

The traffic came from a different VPC CIDR than the firewall's own VPC. By default the stateful domain rule group's HOME_NET is set to the firewall VPC's CIDR, so traffic sourced from other CIDRs (the spoke VPCs in his centralized design) was never matched by the domain inspection at all.

Diagnosis

He checks the FLOW logs and sees the worker's source IP is in a spoke CIDR (10.30.x) that isn't inside the firewall VPC's CIDR (10.100.x). The domain rule simply skipped it.

Amazon VPC Console → Network Firewall → Firewall policies → (policy) → Rule variables → HOME_NET
Fix

He widens the HOME_NET rule variable to include every spoke CIDR being inspected (10.20.0.0/16, 10.30.0.0/16, …) alongside the firewall VPC CIDR, so the domain list inspects traffic from all of them.

Verify

He re-tests from the spoke worker → the domain is now DROPPED and an ALERT log line appears; FLOW logs confirm the spoke CIDR's egress is being evaluated.

Quick check · Q3 of 10

Neha at Airtel writes a stateless rule that says 'pass' for all traffic and a great set of stateful domain rules. Users report the malicious domains are NOT being blocked. Why?

Correct: b. A stateless 'pass' delivers the packet to its destination without ever handing it to the stateful engine, so the domain rules never run. The fix is to set the stateless action to 'forward to stateful'. Stateful doesn't override a stateless pass; domain filtering works on both HTTP (Host) and HTTPS (SNI); and SNI is read in clear text during the handshake, so plain domain filtering does NOT require TLS inspection.

Pause & Predict

Predict: domain filtering reads the SNI from the TLS handshake without decrypting. So when would you actually need to turn on full TLS inspection? Type your guess.

Answer: When you need to see INSIDE the encrypted payload — not just the hostname. SNI filtering only sees the domain in the clear-text handshake, so it can allow/deny by domain. But to catch malware in an HTTPS download, match a Suricata content signature on the response body, or stop exfiltration to an ALLOWED domain (e.g. someone abusing a permitted file-share host), you must decrypt with TLS inspection (using an ACM certificate), inspect the plaintext, then re-encrypt. It costs CPU and needs cert trust, so you enable it selectively.

④ Putting it together — a leak-proof multi-tier VPC & cheat-sheet

Now we assemble everything into a secure multi-tier VPC. Three tiers, three subnet types: a public subnet (only the load balancer and NAT gateway live here), a private app subnet (your EC2/containers, no direct route to the internet gateway), and a data subnet (RDS/databases, the most locked-down, no internet path at all). App and data tiers reach the internet only outbound, via the NAT gateway — and that egress is forced through the Network Firewall first. There is no inbound path from the internet gateway to the app or data tiers.

Wrap it with telemetry: enable VPC Flow Logs on the VPC (to CloudWatch or S3) so you have a record of every accepted/rejected flow, and turn on the Network Firewall's own FLOW + ALERT logging. Now you have two complementary trails: Flow Logs say who talked to whom, and the firewall ALERT logs say what we blocked and why. Together they're what an incident responder actually needs at 2 a.m.

👉 So far: public/private/data tiers, NAT-only egress through the firewall, no direct IGW to app/data, flow logs on. Next: the worked exfil-block rule and your one-card cheat-sheet.

The worked example that ties it off: a "block exfil to unknown domain" egress policy. You create a stateful domain list ALLOW group naming only the handful of domains your app legitimately needs (your AWS service endpoints, your package mirror, your partner API), set the firewall policy's stateful default action to drop, and widen HOME_NET to cover every CIDR you inspect. Result: a compromised host can try to beacon out all it wants — anything not on the short allow-list is dropped and logged. That single pattern defeats the most common cloud-breach step: quiet data exfiltration to attacker infrastructure.

🖥️ Associating the policy to a firewall — Amazon VPC Console → Network Firewall → Firewalls → Create firewall, then pick the VPC, an endpoint subnet per AZ, and the policy. (Recreated for clarity — your console matches this.)
console.aws.amazon.com/vpc · Network Firewall · Firewalls · Create firewall
1
Firewall name
prod-inspection-fw
2
VPC
inspection-vpc (10.100.0.0/16)
3
Firewall subnets
fw-subnet-az-a, fw-subnet-az-b (1 per AZ)
4
Associated firewall policy
egress-control-policy (default: drop)
Logging — ALERT
S3: s3://flipkart-nfw-logs/alert/
Logging — FLOW
CloudWatch: /nfw/prod/flow
Create firewall
AWS CLI — create the egress allow-list domain rule group, then confirm the firewall is READY
aws network-firewall create-rule-group \
  --rule-group-name egress-allowlist-prod --type STATEFUL --capacity 100 \
  --rule-group '{"RulesSource":{"RulesSourceList":{
      "Targets":[".amazonaws.com",".ubuntu.com",".flipkart-internal.example"],
      "TargetTypes":["TLS_SNI","HTTP_HOST"],"GeneratedRulesType":"ALLOWLIST"}}}'

aws network-firewall describe-firewall --firewall-name prod-inspection-fw \
  --query 'FirewallStatus.Status'
Expected output
{
    "RuleGroupResponse": {
        "RuleGroupArn": "arn:aws:network-firewall:ap-south-1:123456789012:stateful-rulegroup/egress-allowlist-prod",
        "RuleGroupName": "egress-allowlist-prod",
        "Type": "STATEFUL",
        "Capacity": 100
    }
}
"READY"
Figure 3 — Secure multi-tier VPC vs the flat, leaky one — pick the right side
A flat VPC with public databases and unfiltered egress leaks; a tiered VPC with firewalled NAT egress does not A two-column comparison of VPC designs. Left, the leaky design: app servers and a database sit in public subnets with a direct internet gateway path inbound and unfiltered outbound, no flow logs. Right, the secure design: a public subnet holds only the load balancer and NAT gateway, a private app subnet has no direct internet gateway route, a data subnet has no internet path at all, all egress is forced outbound through AWS Network Firewall to the NAT gateway, and VPC flow logs are enabled. Red marks the exposed leaky design, green the secure tiered design. Flat & leaky vs tiered & firewalled — same app, two risk profiles Flat VPC (leaky) Public subnet — app + DB exposeddirect IGW inbound to everything ✗ database has a public route ✗ egress unfiltered — any domain reachable ✗ no Network Firewall in the path ✗ no VPC flow logs — blind forensics compromised host exfils freely → one breach = full data loss Tiered VPC (firewalled) Public: ALB + NAT gateway only Private app: EC2 — no IGW route Data: RDS — no internet path at all Network Firewall (egress allow-list)drop unknown domains + ALERT log NAT → internet (inspected only) + VPC flow logs on → breach is contained & seen exposed / leakyinspected boundarypolicy / decisionkey insightallowed / secure
Left (red) = flat VPC, app+DB in public subnets, direct IGW, egress unfiltered. Right (green) = public/private/data tiers, NAT-only egress through the firewall, no IGW to app/data, flow logs on.

For your certification path, this lesson maps onto the AWS Certified Security – Specialty (SCS-C02) blueprint — specifically Domain 3: Infrastructure Security (20%), the single largest scored domain, which is all about network segmentation, edge protection and secure VPC design. Knowing SG vs NACL vs Network Firewall, the inspection-VPC pattern, and egress domain filtering covers a real slice of it, and the FLOW/ALERT logging ties into Domain 2: Security Logging & Monitoring (18%). This is high-yield exam material, not trivia.

Figure 4 — AWS Network Firewall & secure VPC — the cheat-sheet
AWS Network Firewall and secure VPC design on one card — controls, rule groups, egress, logging and first checks A nine-tile cheat sheet. Tiles cover which control for which job, security group versus NACL, the three stateful rule-group types, the egress domain allow-list pattern, stateless versus stateful order, the inspection VPC plus appliance mode, log destinations, the HOME_NET gotcha, and the first three things to check when traffic is not inspected. AWS Network Firewall & secure VPC — your one-glance card Which control, which jobSG = host/ENI · NACL = subnetNetwork Firewall = VPC inspectionuse all three — defense in depth SG vs NACLSG: stateful, allow-onlyNACL: stateless, allow + denyboth IP/port only — no domain 3 stateful rule types5-tuple · domain list · Suricata+ AWS managed signaturesstrict order = predictable Egress allow-listdomain list = Allow only knowndefault action = drop the reststops exfil to random domains Stateless → statefulstateless triages on 5-tuplemust FORWARD to stateful'pass' skips inspection — gotcha Inspection VPC + TGWendpoint per AZ, own subnetappliance mode = no asym droproute tables force the detour LoggingFLOW = every flowALERT = matched drop/alert→ S3 / CloudWatch / Kinesis HOME_NET gotchadefaults to firewall VPC CIDRwiden it for spoke CIDRselse other CIDRs skip domain rules First checks if 'not working'ReceivedPackets = 0? → routesrandom AZ drops? → appliance modeno match? → HOME_NET / forward
Your one-card map: which control for which job, the three rule-group types, the egress allow-list move, the ports/log destinations, and the first things to check when it 'isn't working'.
Daily-life analogy — Aadhaar-verified courier pickup

Picture a building that only lets out parcels going to verified addresses. The domain allow-list is that approved address book — a courier (your app) can hand over a parcel only if the destination is on the list, exactly like an Aadhaar-style verification at the gate. Anything addressed to an unknown place is held and a note is logged (the ALERT log). Even if an insider tries to smuggle data out, the gate checks the destination name, not just the vehicle — which is precisely how the firewall's domain egress control beats a thief who has a 'valid' (open) port.

Next: detect what the firewall logs — GuardDuty + Security Hub
Prove you own this lesson

Cold, in 30 seconds: name the three layers and their scope (SG = ENI, NACL = subnet, Network Firewall = VPC inspection); say why an inspection VPC needs appliance mode (return path symmetry); explain the egress allow-list move (domain list Allow + default drop) and why it stops exfiltration; and list the two log types (FLOW and ALERT) and three destinations (S3/CloudWatch/Kinesis). If you can do that without notes, you've got the Infrastructure Security core of SCS-C02.

Quick check · Q4 of 10

An interviewer asks Arjun: "In one sentence, what's the single most valuable thing AWS Network Firewall does that a security group and NACL can't?" Best answer?

Correct: c. The defining capability is deep, stateful, VPC-level inspection: Suricata IPS signatures plus domain-based egress filtering catch threats SG and NACL — which match only on IP/port/protocol — cannot. Cost and console are not security capabilities; and the firewall complements, not replaces, VPC flow logs (which record who-talked-to-whom).

🤖 Ask the AI Tutor

Tap any question — instant, scoped to this lesson. No login, no waiting.

Pre-curated from AWS docs + community Q&A, scoped to this lesson. For a live prod issue, paste your export into chat.techclick.in.

📝 Wrap-up assessment — six more

You've answered 4 inline. Six left. 70% (7 of 10) marks the lesson complete on your profile. Tap Submit all answers at the end.

Q5 · Remember

Which AWS control is a managed, stateful, VPC-level firewall that runs a Suricata-compatible IPS engine and can filter egress by domain name?

Correct: c. AWS Network Firewall is the managed, stateful, VPC-level service with a Suricata IPS engine and domain filtering. A security group is a stateful per-ENI allow-list; a NACL is a stateless subnet allow/deny list; and VPC Flow Logs are a logging feature, not a firewall.
Q6 · Apply

You need to stop EC2 hosts in a Wipro VPC from sending data out to any domain except a short approved list. Which configuration does this?

Correct: a. An egress allow-list is a domain list rule group with Allow for the approved domains plus a default drop for everything else. SG/NACL match IP/port only (domains rotate IPs), and Flow Logs only record traffic — they don't block it.
Q7 · Apply

In an inspection VPC, where must the AWS Network Firewall endpoint live, and why?

Correct: b. The firewall endpoint needs a dedicated, workload-free subnet per AZ — Network Firewall cannot inspect traffic that originates in the same subnet as its own endpoint, so any co-located workload could bypass inspection. Sharing with app servers, the NAT gateway, or disabling appliance mode would all break correct inspection.
Q8 · Analyze

A centralized firewall blocks bad domains for traffic from the firewall's own VPC, but identical traffic from a spoke VPC sails straight through unblocked. Routes and rules look correct. Most likely root cause?

Correct: c. By default the domain list rule group's HOME_NET is the firewall VPC's CIDR, so traffic from other (spoke) CIDRs is not evaluated by domain inspection — widen HOME_NET to include the spoke CIDRs. TLS inspection isn't needed for SNI domain filtering; a stateless drop would block, not pass; and a centralized design specifically avoids a firewall per spoke.
Q9 · Analyze

Long-lived east-west connections through a centralized inspection VPC drop randomly, only across Availability Zones. Control connections and rules are fine. What's happening?

Correct: a. Random cross-AZ drops on stateful flows are the signature of asymmetric routing: without appliance mode on the inspection TGW attachment, return packets can hit a different-AZ endpoint that only sees half the conversation. Rule order affects matching, not AZ symmetry; Flow Logs and the NAT gateway don't cause AZ-specific stateful drops.
Q10 · Evaluate

Two ways to describe AWS Network Firewall's value to a hiring manager: (A) "it's an AWS-managed firewall that's easier than running EC2 appliances"; (B) "it adds stateful, VPC-level inspection — IPS signatures plus domain-based egress filtering and optional TLS inspection — that security groups and NACLs structurally cannot do, so it catches in-progress exfiltration." Which is the stronger answer and why?

Correct: d. B explains the security capability (stateful inspection, IPS, domain egress filtering, TLS inspection) that SG and NACL — IP/port-only controls — cannot provide, which is the reason it exists and what the exam tests. A lists operational convenience without the 'why', and being managed isn't a security capability on its own.
Lesson complete — saved to your profile.
Almost! You need 70% (7 of 10) — re-read the path that tripped you up and tap "Try again".

🧠 In your own words

Type one line: In one line, why does an egress domain allow-list with a default 'drop' action stop data exfiltration that a tight security group never would? Then compare to the expert version.

Expert version: Because the allow-list filters on the destination DOMAIN (SNI/Host) and drops everything not explicitly permitted, so a compromised host can't beacon out to attacker infrastructure — whereas a security group only matches IP/port/protocol and, with its default allow-all outbound, lets that traffic leave.

🗣 Teach a friend

Best way to lock it in — explain it in one line to a teammate. Tap to generate a paste-ready summary.

📖 Glossary

AWS Network Firewall
Managed, stateful, VPC-level firewall running a Suricata-compatible IPS engine, with domain filtering and optional TLS inspection. Deployed as endpoints in dedicated subnets.
Security group (SG)
Stateful virtual firewall on an ENI. Allow rules only; return traffic is auto-permitted. Judges by IP/port/protocol.
Network ACL (NACL)
Stateless allow/deny list on a subnet boundary. You must write both directions by hand. IP/port/protocol only.
Inspection VPC
A dedicated VPC that hosts firewall endpoints and inspects traffic for many spoke VPCs in a centralized design.
Transit Gateway (TGW)
A cloud router connecting many VPCs and on-prem networks hub-and-spoke; the hub that routes traffic into the inspection VPC.
Appliance mode
A TGW attachment setting that pins a flow to one firewall endpoint/AZ for its life, keeping request and reply symmetric. Required for stateful cross-AZ inspection.
Firewall endpoint
The VPC endpoint Network Firewall creates per AZ. Traffic must be routed to it; its subnet must hold nothing else.
Stateless rule group
First-pass rules evaluating each packet alone on the 5-tuple. Actions: pass, drop, or forward-to-stateful.
Stateful rule group
Suricata-engine rules evaluating a packet in its flow context. Home of IPS signatures, 5-tuple, domain lists and raw Suricata strings.
Domain list rule group
A stateful group that allows or denies traffic by domain (TLS SNI / HTTP Host). The egress allow-list tool.
HOME_NET
Suricata variable defining your 'internal' network. Defaults to the firewall's VPC CIDR; widen it to inspect other (spoke) CIDRs.
FLOW vs ALERT logs
FLOW logs record every flow; ALERT logs record only traffic matching a drop/alert rule. Sent to S3, CloudWatch Logs, or Kinesis Data Firehose.

📚 Sources

  1. AWS Network Firewall Developer Guide — "Network Firewall stateless and stateful rules engines" + "Working with stateful rule groups" (Suricata-compatible engine; stateless 5-tuple triage forwards to stateful; strict order; pass/drop/reject/alert actions). docs.aws.amazon.com/network-firewall/latest/developerguide/firewall-rules-engines.html · docs.aws.amazon.com/network-firewall/latest/developerguide/stateful-rule-groups-ips.html
  2. AWS Network Firewall Developer Guide — "Stateful domain list rule groups" + "URL and Domain Category Filtering" (domain allow/deny via TLS SNI and HTTP Host; HOME_NET defaults to the deployment VPC CIDR and must be widened to inspect other CIDRs). docs.aws.amazon.com/network-firewall/latest/developerguide/stateful-rule-groups-domain-names.html · docs.aws.amazon.com/network-firewall/latest/developerguide/rule-groups-url-filtering.html
  3. AWS Whitepaper — "Building a Scalable and Secure Multi-VPC AWS Network Infrastructure": centralized network security with Transit Gateway, the inspection VPC two-subnets-per-AZ layout, appliance mode for symmetric routing, and NAT-gateway centralized egress. docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/centralized-network-security-for-vpc-to-vpc-and-on-premises-to-vpc-traffic.html
  4. AWS re:Post + AWS Network Firewall Developer Guide troubleshooting — "Troubleshoot issues with Network Firewall rules" / "Configure Network Firewall rules for specific domains" (ReceivedPackets=0 means routes don't point at the endpoint; firewall subnet must contain only the endpoint; no asymmetric routing; stateless must forward to stateful). repost.aws/knowledge-center/network-firewall-troubleshoot-rule-issue · docs.aws.amazon.com/network-firewall/latest/developerguide/troubleshooting-rules.html
  5. AWS What's New (Sept 2025) — "AWS Network Firewall adds Reject and Alert actions for stateful domain list rule groups" (recent feature giving domain rules more granular actions than drop alone). aws.amazon.com/about-aws/whats-new/2025/09/aws-network-firewall-reject-alert-domain-list-rule-groups/
  6. AWS Certified Security – Specialty (SCS-C02) Exam Guide — Domain 3 Infrastructure Security (20%, the largest scored domain: network segmentation, edge protection, secure VPC design) and Domain 2 Security Logging & Monitoring (18%). d1.awsstatic.com/training-and-certification/docs-security-spec/AWS-Certified-Security-Specialty_Exam-Guide_C02.pdf
  7. AWS Networking & Content Delivery Blog — "Deployment models for AWS Network Firewall" (distributed vs centralized inspection, route-table design, comparison with third-party NGFW behind a Gateway Load Balancer). aws.amazon.com/blogs/networking-and-content-delivery/deployment-models-for-aws-network-firewall/

What's next?

Your firewall now blocks and LOGS the bad egress — but who reads those alerts and connects them to a real attack? Next we wire detection and posture management: GuardDuty for threat findings and Security Hub to aggregate, score and act on them.