SCS-C03 · Domain 3 · Infrastructure Security (18%) · Day 2 of 5
Network controls and segmentation
Day 1 stopped attacks at the edge with CloudFront, WAF and Shield. Today we move inside the VPC: security groups and network ACLs, how to find out why traffic is blocked, AWS Network Firewall, Route 53 Resolver DNS Firewall, Gateway Load Balancer for third-party appliances, and how to split a network into public, private and isolated parts with north/south and east/west protection.
Skill 3.3.1 SGs, NACLs, Network FirewallSkill 3.3.4 segmentation~90 min read + 30 min lab
01
Security groups vs network ACLs
Skill 3.3.1 starts with the two built-in VPC firewalls. A security group (SG) is attached to a network interface (ENI), so it protects one resource. A network ACL (NACL) is attached to a subnet, so it protects everything in that subnet. Traffic from outside the subnet passes the NACL first, then the SG.
The exam loves three differences: SGs are stateful and NACLs are stateless; SGs have allow rules only while NACLs can also deny; and SGs can use another security group as the source, which NACLs can’t.
Concept profile
Security group
often confused with Network ACL
?What is it?
A stateful virtual firewall on an ENI. It has separate inbound and outbound allow rules. Anything not allowed is dropped.
⚙How does it work?
Stateful: if a request is allowed in, its reply is allowed out, with no outbound rule needed (and the other way round).
A new SG has no inbound rules (all inbound blocked) and one outbound rule that allows all.
All rules of all SGs on the ENI are combined; there is no order and no deny.
Sources can be a CIDR, a prefix list (pl-…) or a security group ID (sg-…). An SG reference means “any ENI that has that SG”, using private IPs.
Changes apply right away to all attached resources.
{ }Structure
NACL at the subnet edge, SG on the interface. Only the NACL needs rules for the reply.
⇄Security group vs Network ACL
Security group
Network ACL
Attached to
ENI (instance, ALB, RDS, Lambda in VPC…)
Subnet (one NACL per subnet)
State
Stateful
Stateless: reply needs its own rule
Rule types
Allow only
Allow and deny
Evaluation
All rules, most permissive wins
By number, lowest first, first match wins
Default (new)
In: none. Out: all
Custom NACL: deny all. Default NACL: allow all
Default quota
60 rules each way; 5 SGs per ENI
20 rules each way (up to 40)
Best for
Allow lists between tiers
Blocking an IP range quickly
!Common mistakes the exam tests
Trying to block one attacker IP with an SG: SGs have no deny. Use a NACL deny rule with a lower number than the allow rules (or WAF for HTTP).
Forgetting outbound ephemeral ports on a NACL: requests arrive but replies are dropped. Allow 1024-65535 (ELB, NAT gateway and Lambda use 1024-65535; Amazon Linux uses 32768-61000).
Expecting NACLs to filter traffic between instances in the same subnet: rules run only when traffic enters or leaves the subnet. Use SGs.
Trying to block DNS queries to the VPC Resolver (VPC+2) or IMDS with SGs or NACLs: they can’t. Use DNS Firewall and IMDS settings.
Forgetting IPv4 and IPv6 rules are separate: an IPv4 allow doesn’t cover IPv6.
✓Benefits and use cases
SG chains: ALB SG → app SG → DB SG, no IPs to maintain.
NACLs as a coarse second layer and for quick deny lists.
Prefix lists to share one list of CIDRs across many SGs.
Limits and SG references
Default quotas: 60 inbound and 60 outbound rules per SG, 5 SGs per ENI (adjustable up to 16), and SGs per ENI × rules per SG can’t exceed 1,000. A NACL has 20 rules each way by default, adjustable to 40. An SG reference counts as one rule no matter how many instances it covers; a customer-managed prefix list counts as its maximum size. You can reference an SG in the same VPC, in a peered VPC, or (inbound rules only) in a VPC on the same transit gateway when SG referencing is turned on. A reference doesn’t work if traffic passes through a middlebox such as a firewall appliance: then use CIDRs.
Think of it like · an office building
Two kinds of guards protect the same office.
AWS concept
Familiar thing
Network ACL
≈
The guard at the floor’s entrance, checking a numbered list of who can and can’t enter
Stateless
≈
That guard checks you again when you leave and doesn’t remember you came in
Security group
≈
The receptionist at one office door who only has a guest list
Stateful
≈
The receptionist remembers you, so you can walk out without being checked
SG reference
≈
“Anyone wearing a blue staff badge may enter”, instead of a list of names
Ephemeral ports
≈
The visitor’s car park space: the reply must find its way back there
Real AWS example · chain tiers with SG references, block an IP with a NACL
Allow the DB only from the app SG, then deny one bad range at the subnet.
Rule 50 is evaluated before the broader allow rules (for example 100), so the bad range is denied first. Rule 140 lets replies go back to clients.
Exam-style scenario
A web server in a public subnet is reachable on port 443 according to its security group. After a team adds a custom network ACL that allows inbound TCP 443 from 0.0.0.0/0 and outbound TCP 443 to 0.0.0.0/0, users can no longer load the site. What is the most likely cause?
A. The security group needs an outbound rule for port 443.
B. The NACL has no outbound rule for the clients’ ephemeral ports, so replies are dropped.
C. NACLs can’t be used on public subnets.
D. The internet gateway must be re-attached.
Show the worked answer
Answer: B
NACLs are stateless. The reply goes from port 443 to the client’s ephemeral port (for example 49152), which needs an outbound allow such as 1024-65535.
Why not the others
A: SGs are stateful; the reply is allowed automatically.
C: NACLs work on any subnet.
D: Routing didn’t change.
How the exam tests this
“Deny a specific IP range”→ NACL deny rule (SGs can’t deny).
Troubleshooting traffic: flow logs and Reachability Analyzer
Many exam questions describe traffic that doesn’t arrive and ask how to find out why. There are two kinds of evidence. VPC Flow Logs record real traffic that happened. Reachability Analyzer reads your configuration and tells you whether a path could work, and if not, which component blocks it.
Concept profile
VPC Reachability Analyzer
often confused with VPC Flow Logs
?What is it?
A configuration analysis tool. You give a source and a destination (for example an internet gateway and an instance, port 443) and it tells you whether the destination is reachable.
⚙How does it work?
It analyzes route tables, SGs, NACLs, gateways, load balancers, peering and transit gateways. No packets are sent.
Reachable: you get the hop-by-hop path. Not reachable: it names the blocking component, such as an SG, NACL, route table or load balancer.
Saved as a network insights path; each run is an analysis. You pay per analysis.
Use it after changes, or automate it (CloudFormation, CLI) as a connectivity test.
{ }Structure
Configuration evidence, traffic evidence, and (Day 3) unwanted paths.
⇄Reachability Analyzer vs VPC Flow Logs
Reachability Analyzer
VPC Flow Logs
Evidence
Configuration (could it work?)
Real traffic (what happened?)
Names the blocker
Yes
No, only ACCEPT / REJECT
Needs traffic
No
Yes
History
No
Yes, stored in Logs, S3 or Firehose
Exam hint
“identify the misconfigured component”
“which IPs were rejected”, “audit traffic”
!Common mistakes the exam tests
Expecting flow logs to say which control rejected traffic: they only say ACCEPT or REJECT.
Expecting flow logs to show packet contents: they record metadata only. Use Traffic Mirroring for packet capture.
Forgetting that flow logs skip some traffic, such as Amazon DNS (VPC Resolver), DHCP and instance metadata.
Using Reachability Analyzer to find all unintended paths: that is Network Access Analyzer (Day 3).
Reading “inbound ACCEPT, outbound REJECT” as an SG problem: SGs are stateful, so it points to the NACL.
✓Benefits and use cases
“Why can’t my instance reach the database?” answered in minutes.
Proving a change didn’t break a path.
Flow logs for incident investigation and for spotting scans.
Flow log records and recent fields
The default format (version 2) has 14 fields: version account-id interface-id srcaddr dstaddr srcport dstport protocol packets bytes start end action log-status. Custom formats can add vpc-id, subnet-id, tcp-flags, pkt-srcaddr/pkt-dstaddr (the original IPs behind a NAT gateway), flow-direction and traffic-path. A newer reject-reason field shows BPA when traffic was dropped by VPC Block Public Access, an account-level setting that can block internet gateway traffic in a whole Region (bidirectional or ingress-only), with exclusions for chosen VPCs or subnets. Delivery is best effort, roughly 5 minutes to CloudWatch Logs and 10 minutes to S3.
Think of it like · a delivery problem
Finding out why a parcel never arrived.
AWS concept
Familiar thing
Reachability Analyzer
≈
Checking the map and the address book: is there even a road, and is a gate closed?
Blocking component
≈
“The bridge on Main Street is closed”
Flow logs
≈
The doorman’s logbook of every visitor let in or turned away
REJECT without reason
≈
The logbook says “turned away” but not which guard did it
Traffic Mirroring
≈
A camera that records what was inside each parcel
Block Public Access
≈
The city closing every road to the outside at once
Real AWS example · read two flow log records for one ENI
A client connects to a web server on 443. The request is accepted, the reply is rejected.
Inbound accepted and outbound reply rejected means a stateless control: the NACL lacks an outbound rule for port 49152. The analysis would show NetworkPathFound: false with the NACL as the explanation.
Exam-style scenario
After a network change, an application server can’t connect to an RDS database in another subnet. The team wants to identify the exact misconfigured resource quickly, without waiting for traffic or reading logs. What should it use?
A. VPC Flow Logs with Athena queries.
B. VPC Reachability Analyzer with the instance as source and the database ENI as destination on port 5432.
C. Traffic Mirroring to a packet analyzer.
D. AWS Config rules.
Show the worked answer
Answer: B
Reachability Analyzer reads the configuration and names the blocking component, such as an SG, NACL or route.
Why not the others
A: Shows ACCEPT/REJECT but not which component, and needs traffic first.
C: Packet capture is slow to set up and doesn’t name the cause.
Security groups and NACLs only look at IPs, ports and protocols. AWS Network Firewall is a managed, stateful firewall with intrusion prevention (IPS) for whole VPCs. It can filter by domain name, match Suricata rules on traffic patterns, and even decrypt TLS to look inside. It is the exam’s answer for “filter egress to approved domains” and “IPS for VPC traffic”.
Concept profile
AWS Network Firewall
often confused with Security groups and NACLs
?What is it?
A managed firewall service. You create a firewall with firewall endpoints in dedicated subnets, a firewall policy, and rule groups, then route traffic through the endpoints.
⚙How does it work?
Stateless engine first: looks at each packet alone, by priority, and can pass, drop or forward to the stateful engine. The policy sets default actions for packets and fragments (aws:pass, aws:drop, aws:forward_to_sfe).
Stateful engine: inspects flows with Suricata-compatible IPS rules, 5-tuple rules or domain lists. By default it allows traffic that matches no rule.
Rule order: action order (default: pass, then drop/reject, then alert) or strict order with default actions such as aws:drop_established.
AWS managed rule groups (threat signatures, domain lists) and Marketplace rule groups.
Logs: alert, flow and TLS logs to S3, CloudWatch Logs or Firehose.
{ }Structure
Two engines in order; the firewall only sees traffic your route tables send to it.
⇄Network Firewall vs Security groups and NACLs
Network Firewall
SGs and NACLs
Inspects
Layers 3 to 7: domains, IPS signatures, TLS
IPs, ports, protocols
Domain filtering
Yes (SNI, Host header)
No
Deployed
Endpoints in firewall subnets + routing
Built in, no routing changes
Scope
Whole VPC or many VPCs
One ENI / one subnet
Cost
Per endpoint-hour + data processed
Free
Exam hint
“IPS”, “allowed domains”, “central inspection”
“port”, “block IP”
!Common mistakes the exam tests
Creating the firewall but not changing route tables: traffic never reaches the endpoints.
Asymmetric routing: in and out traffic of a flow must use the same endpoint in the same AZ, or stateful rules break.
Putting workloads in the firewall subnet: keep it only for endpoints, one per AZ.
Expecting it to inspect VPC peering traffic or Resolver DNS queries: not supported. Use TGW for central routing and DNS Firewall for DNS.
Forgetting HOME_NET: domain rules only filter traffic from the firewall VPC’s CIDR by default. With central inspection, add the spoke CIDRs.
✓Benefits and use cases
Egress filtering: allow only approved domains (package repos, partner APIs).
IPS with AWS managed threat signatures.
Central inspection of north/south and east/west traffic for many VPCs.
New in 2025–2026.Active threat defense is an AWS managed rule group for Network Firewall (AttackInfrastructure, in strict-order or action-order versions). It uses Amazon threat intelligence (MadPot) to block traffic to and from malware staging URLs, botnet command-and-control servers and crypto-mining pools, and AWS updates it for you. Since November 2025 you can also subscribe to partner managed rule groups from AWS Marketplace. A Network Firewall proxy (explicit proxy behind a NAT gateway) is in preview, so it is unlikely to be an exam answer yet.
Domain lists, TLS inspection and deployment models
A domain list rule group checks the TLS SNI (HTTPS) and the HTTP Host header. .example.com matches the domain and all subdomains. An allowlist drops other traffic of that protocol; a denylist drops only matches. It doesn’t look up DNS, so a client could fake the SNI; add IP rules if that matters. TLS inspection decrypts, inspects and re-encrypts traffic. Inbound inspection uses your server certificate in ACM; outbound inspection uses a CA certificate imported into ACM, which issues certificates on the fly, so clients must trust that CA. Deployment models: distributed (a firewall in each VPC), centralized (an inspection VPC behind a Transit Gateway with appliance mode on), or combined. Newer: a transit gateway-attached firewall attaches Network Firewall directly to a Transit Gateway, with appliance mode always on and routing done in TGW route tables. Firewall Manager can deploy Network Firewall policies across accounts.
Think of it like · a building’s mail room
All post goes through one mail room before reaching offices.
AWS concept
Familiar thing
Stateless engine
≈
A clerk who sorts envelopes by size and stamp only
Stateful engine
≈
A senior clerk who follows whole conversations between senders
Suricata rules
≈
A book of known scam letter patterns
Domain allowlist
≈
Only letters addressed to approved companies may leave
TLS inspection
≈
Opening sealed envelopes, checking them, and sealing them again
Route tables
≈
If post doesn’t go via the mail room, nobody checks it
Real AWS example · domain allowlist and a Suricata rule
Allow only two domains for HTTPS and HTTP, and drop a known bad pattern.
aws:drop_established drops established flows that match no rule, while still letting TCP handshakes complete so application-layer rules can see the SNI.
Exam-style scenario
A company must make sure instances in private subnets can reach only its package repository and two partner APIs over HTTPS. All other internet destinations must be blocked and logged. The traffic leaves through a NAT gateway. What should a security engineer do?
A. Add outbound SG rules with the partners’ current IP addresses.
B. Deploy AWS Network Firewall with a stateful domain list allowlist (TLS SNI) and alert logging, and route the private subnets’ outbound traffic through the firewall endpoints.
C. Use a NACL to deny 0.0.0.0/0 on port 443.
D. Configure AWS WAF on the NAT gateway.
Show the worked answer
Answer: B
Domain allowlists filter HTTPS by SNI; routing through the endpoints makes sure all egress is inspected and logged.
Why not the others
A: IPs behind domains change often and SGs can’t log.
C: Blocks everything, including the allowed domains.
D: WAF doesn’t attach to NAT gateways and is for inbound HTTP.
How the exam tests this
“Allow egress only to listed domains”→ Network Firewall domain list allowlist.
Every VPC has a built-in DNS server, the Route 53 Resolver (called VPC Resolver in newer AWS docs), at the VPC base address plus two. Malware often uses DNS to find its command server or to exfiltrate data inside DNS queries. SGs, NACLs and Network Firewall can’t see or block queries to the Resolver, so AWS gives you DNS Firewall for this path.
Concept profile
Route 53 Resolver DNS Firewall
often confused with AWS Network Firewall domain lists
?What is it?
A feature of the VPC Resolver that filters outbound DNS queries from your VPCs against domain lists, and allows, blocks or alerts on them.
Choosing Network Firewall to stop DNS exfiltration through the Resolver: it can’t see those queries.
Forgetting priority order: put an ALLOW rule for a false positive at a lower priority number than the BLOCK rule.
Turning on a managed list straight in BLOCK: test with ALERT first and check logs and metrics.
Thinking fail-open is the default: the default is fail closed (security over availability).
Relying only on DNS Firewall: clients could use an outside DNS server. Block outbound port 53 to the internet with SGs, NACLs or Network Firewall.
✓Benefits and use cases
Block lookups of known malware and botnet domains.
Allowlist mode: deny all domains except trusted ones in very locked-down VPCs.
Detect DNS tunneling and DGA domains with DNS Firewall Advanced.
DNS Firewall Advanced and logging
DNS Firewall Advanced adds protections that don’t need a list: it detects DNS tunneling and domain generation algorithm (DGA) domains from query patterns, and offers threat and content categories (for example phishing or gambling). Log queries with Resolver query logging to CloudWatch Logs, S3 or Firehose to see which rule matched. Remember the split: DNS Firewall covers the Resolver path, Network Firewall covers the network path; together they give domain filtering on both.
Think of it like · a school phone operator
Pupils must call through the school switchboard.
AWS concept
Familiar thing
VPC Resolver
≈
The switchboard that looks up phone numbers
DNS Firewall
≈
The operator refusing to connect calls to banned numbers
AWS managed list
≈
A police list of scam numbers, kept up to date for you
NXDOMAIN
≈
“That number doesn’t exist”
OVERRIDE
≈
Connecting the caller to the headteacher instead
Fail closed
≈
If the operator is away, no calls go out at all
Real AWS example · block AWS managed malware domains
Create a rule group, add a BLOCK rule with NXDOMAIN, associate it with a VPC.
AWS provides test domains for each managed list; they resolve to 1.2.3.4 when they are not blocked.
Exam-style scenario
GuardDuty reports that an EC2 instance is sending data out through unusually long DNS queries to an attacker’s domain. The instance uses the default VPC DNS. The security team wants to block lookups of known malicious domains in all VPCs of the organization and detect tunneling. What should it do?
A. Add a NACL rule that denies UDP 53.
B. Use Route 53 Resolver DNS Firewall with AWS managed domain lists and DNS Firewall Advanced tunneling protection, deployed to all VPCs with Firewall Manager.
C. Add a Network Firewall domain denylist.
D. Remove the VPC’s DNS support.
Show the worked answer
Answer: B
DNS Firewall filters queries on the Resolver path; managed lists and Advanced protections cover known and pattern-based threats; Firewall Manager rolls it out.
Why not the others
A: NACLs can’t filter traffic to the VPC Resolver.
C: Network Firewall can’t see Resolver queries.
D: Breaks all name resolution.
How the exam tests this
“DNS exfiltration / malicious domain lookups”→ DNS Firewall.
“Return a fake ‘doesn’t exist’ answer”→ BLOCK with NXDOMAIN.
“Send users to a warning page”→ BLOCK with OVERRIDE.
“DNS must keep working if the firewall fails”→ Set fail open.
“DNS tunneling and DGA without lists”→ DNS Firewall Advanced.
Some companies already use a firewall vendor and want the same appliances in AWS. Gateway Load Balancer (GWLB) makes that easy: it sends traffic transparently through a fleet of virtual appliances, scales them, and removes unhealthy ones. On the exam, “use our existing third-party firewall / IDS / IPS” almost always means GWLB.
Concept profile
Gateway Load Balancer
often confused with Network Load Balancer
?What is it?
A layer 3 load balancer that acts as a transparent “bump in the wire”. It receives all IP packets on all ports and forwards them to appliances in a target group.
⚙How does it work?
Appliances and GWLB talk using GENEVE on UDP port 6081; the original packet is kept inside, so source and destination IPs don’t change.
A GWLB endpoint (a PrivateLink VPC endpoint) in your VPC is the next hop in route tables. The appliances can live in a separate security VPC or account.
Flow stickiness: a flow stays on one appliance (5-tuple by default, or 3-tuple / 2-tuple).
Health checks stop sending flows to failed appliances.
With a central inspection VPC on a Transit Gateway, turn on appliance mode on the attachment for symmetric routing.
{ }Structure
Route tables point at the GWLB endpoint; GWLB spreads flows over the appliances.
⇄GWLB vs Network Load Balancer
Gateway Load Balancer
Network Load Balancer
Layer
3 (all IP packets)
4 (TCP, UDP, TLS)
Role
Transparent inspection in the path
Destination for client connections
Listener
No ports: all traffic
Specific ports
Reached by
Route table next hop (GWLB endpoint)
DNS name / IP
Exam hint
“third-party firewall appliances”
“static IP, millions of TCP connections”
!Common mistakes the exam tests
Choosing an NLB to insert inspection appliances: an NLB is a destination, not a transparent hop.
Putting the GWLB endpoint in the same subnet as the application: it needs its own subnet so it can be the next hop.
Forgetting the return route: the IGW ingress route table must send traffic for the app subnet to the GWLB endpoint.
Forgetting appliance mode on the TGW attachment: flows may hit different AZs and stateful appliances drop them.
Referencing security groups through an inspection path: SG references across TGW don’t work through GWLB or Network Firewall.
✓Benefits and use cases
Run Palo Alto, Fortinet, Check Point or other Marketplace firewalls in AWS.
IDS/IPS and deep packet inspection with auto scaling.
One security VPC serving many application VPCs and accounts.
Think of it like · an airport security check
Every passenger goes through a scanner lane without changing their ticket.
AWS concept
Familiar thing
GWLB
≈
The queue manager sending each passenger to a free scanner lane
Appliances
≈
The scanner lanes, run by a contractor you chose
GENEVE
≈
A clear plastic tray: the bag goes through unchanged and can be seen
Flow stickiness
≈
A family stays in the same lane together
GWLB endpoint
≈
The signposted entrance to security that every route must pass
Appliance mode
≈
You must come back through the same terminal you left from
Real AWS example · route tables for an internet ingress inspection
IGW edge route table and app subnet route table both use the GWLB endpoint.
# IGW ingress (edge) route table, associated with the internet gateway
Destination Target
10.0.0.0/16 local
10.0.2.0/24 vpce-0gwlbe1a # app subnet in AZ a -> GWLB endpoint in AZ a
# App subnet route table (AZ a)
Destination Target
10.0.0.0/16 local
0.0.0.0/0 vpce-0gwlbe1a # replies go back through the same endpoint
# GWLB endpoint subnet route table
0.0.0.0/0 igw-0abc
Same AZ in both directions keeps the flow on one appliance. Repeat per AZ.
Exam-style scenario
A bank must keep using its existing third-party next-generation firewall for all internet traffic to its VPCs, with automatic scaling and no single point of failure. Traffic must not be changed by NAT. What should a security engineer deploy?
A. Network Load Balancer in front of the firewall instances.
B. Gateway Load Balancer with the vendor’s appliances in a target group, and GWLB endpoints as the next hop in the VPC route tables.
C. AWS WAF with Marketplace rules.
D. A single large EC2 firewall instance with source/destination check disabled.
Show the worked answer
Answer: B
GWLB inserts third-party appliances transparently (GENEVE keeps IPs), scales them and handles health checks.
Why not the others
A: NLB isn’t transparent in the routing path.
C: WAF is HTTP only and not the vendor’s firewall.
Skill 3.3.4 is about segmentation: splitting the network so one compromised part can’t reach everything. North/south traffic crosses the boundary between your network and the internet (or on-premises). East/west traffic moves between workloads inside your network: subnet to subnet, VPC to VPC, account to account. Good designs protect both.
Concept profile
Isolated subnet
often confused with Private subnet
?What is it?
A subnet whose route table has no route to the internet at all: no internet gateway and no NAT gateway. Resources reach AWS services only through VPC endpoints.
⚙How does it work?
Public subnet: 0.0.0.0/0 → igw. Put only load balancers, NAT gateways and bastions here.
Private subnet: 0.0.0.0/0 → nat. Servers can start outbound connections; nobody on the internet can start one to them.
Isolated subnet: only the local route (plus endpoint routes). Databases and sensitive data processing go here.
Use gateway endpoints (S3, DynamoDB) and interface endpoints (other services) so isolated workloads still call AWS APIs privately.
Layer SG references between tiers: ALB SG → app SG → DB SG.
{ }Structure
Left: tiers inside one VPC. Right: north/south and east/west through a central inspection VPC.
⇄Isolated subnet vs Private subnet
Isolated subnet
Private subnet
Default route
None
NAT gateway
Outbound internet
No
Yes (outbound-initiated)
AWS APIs
VPC endpoints only
NAT or endpoints
Data exfiltration risk
Lowest
Possible through NAT
Typical use
Databases, regulated data
App servers, patching
!Common mistakes the exam tests
Calling a subnet “private” because instances have no public IP, while its route table points to an IGW: routes decide, not IPs.
Leaving the DB in a private subnet with NAT when the question says “no internet access”: use an isolated subnet with endpoints.
Relying only on segmentation by VPC while allowing full mesh TGW routing: east/west traffic is still open. Use separate TGW route tables or inspection.
Using VPC peering for central inspection: peering isn’t transitive and Network Firewall doesn’t inspect peering traffic.
Forgetting east/west: a firewall only at the internet edge doesn’t stop lateral movement between VPCs.
✓Benefits and use cases
Three-tier apps with the database unreachable from the internet.
Separating prod and dev so a dev compromise can’t reach prod.
Inspecting all traffic between business units.
Inspection VPC, TGW route tables, SG referencing and VPC Lattice
For many VPCs, a Transit Gateway hub lets you control east/west traffic with separate route tables (for example prod can’t route to dev) and send traffic to an inspection VPC running Network Firewall or GWLB appliances, with appliance mode on that attachment. North/south egress can go through a central egress VPC with NAT gateways. SG referencing over a transit gateway works for inbound rules only, must be turned on for the TGW and the attachment, doesn’t work across TGW peering, and doesn’t work through an inspection VPC. Over VPC peering, you can reference the peer’s SGs in the same Region. Amazon VPC Lattice is another east/west option: it connects services across VPCs and accounts at the application layer, with auth policies (IAM, requests signed with SigV4) on the service network or service, plus SGs on the VPC association, so you control which service may call which.
Think of it like · a hospital
Different areas, different doors.
AWS concept
Familiar thing
Public subnet
≈
The reception hall: anyone can walk in
Private subnet
≈
Staff offices: staff can phone out, the public can’t walk in
Isolated subnet
≈
The drug store room: no outside door at all, deliveries through an internal hatch (endpoint)
North/south
≈
People coming in from the street
East/west
≈
People moving between wards
Inspection VPC
≈
A security desk every corridor between wards passes through
Real AWS example · an isolated subnet route table and a gateway endpoint
No internet route; S3 reached through a gateway endpoint with a restrictive policy.
The endpoint policy limits which buckets the subnet can reach, so the endpoint can’t be used to copy data to an attacker’s bucket.
Exam-style scenario
A company has 30 VPCs connected to a Transit Gateway with one shared route table. A compromised dev instance was able to scan prod databases. The company wants to block dev-to-prod traffic, inspect all allowed VPC-to-VPC and internet traffic in one place, and keep management simple. What should it do?
A. Replace the Transit Gateway with VPC peering between each pair of VPCs.
B. Use separate TGW route tables for prod and dev, and route allowed traffic through a central inspection VPC running AWS Network Firewall with appliance mode on its attachment.
C. Add NACL deny rules in every prod subnet for every dev CIDR.
D. Move all workloads into one VPC.
Show the worked answer
Answer: B
Separate route tables segment east/west traffic; the inspection VPC inspects north/south and east/west centrally.
Why not the others
A: Hundreds of peerings, not transitive, and no central inspection.
C: Hard to maintain and no inspection.
D: Removes segmentation.
How the exam tests this
“Database must have no internet access”→ Isolated subnet + VPC endpoints.
“Stop lateral movement between VPCs”→ TGW route tables + inspection VPC.
“Inspect traffic between VPCs and to the internet centrally”→ Inspection VPC (Network Firewall / GWLB).
“Service-to-service authorization across accounts”→ VPC Lattice auth policies.
“Reference SG of another VPC on same TGW”→ SG referencing, inbound only.
Cheatsheet extras: NAT gateway vs NAT instance, bastions, IPv6 egress and custom DNS
Your cheat sheet says “make sure you can build a custom VPC from memory”. Sections 01–06 covered the firewalls. This section adds the VPC plumbing the cheat sheet tests: how private subnets reach the internet (NAT gateway, NAT instance, egress-only internet gateway), bastion hosts, the VPC’s DNS settings and DHCP option sets, reserved IPs, and a troubleshooting order.
Concept profile
NAT gateway
often confused with NAT instance
?What is it?
A managed AWS service that lets instances in private subnets start connections to the internet (or other networks) while the internet can’t start connections back to them. It replaces the source IP with its own.
⚙How does it work?
Public NAT gateway: create it in a public subnet with an Elastic IP, then add 0.0.0.0/0 → nat-… to the private subnets’ route table.
Zonal: create one per AZ and point each AZ’s private route table to its own gateway, so one AZ failure doesn’t cut the others.
Scales automatically (5 Gbps up to 100 Gbps); AWS patches and runs it.
No security group on a NAT gateway; the subnet’s NACL still applies. Control egress with the instances’ SGs, NACLs or Network Firewall.
Private NAT gateway: no EIP, for private-IP translation to other VPCs or on-premises.
IPv4 only. For IPv6 egress use an egress-only internet gateway.
{ }Structure
Private route table → NAT gateway (IPv4) or egress-only internet gateway (IPv6); public route table → internet gateway.
⇄NAT gateway vs NAT instance
NAT gateway
NAT instance (legacy)
Who runs it
AWS (no patching)
You: an EC2 instance from a NAT AMI
Availability
Redundant inside its AZ; one per AZ for HA
Single instance; you script failover
Bandwidth
Scales automatically up to 100 Gbps
Depends on instance size
Security group
None (use NACL)
Yes, you manage it
Source/destination check
Not applicable
Must be disabled
Extra uses
None
Could double as a bastion or port forwarder
!Common mistakes the exam tests
Placing the NAT gateway in a private subnet: it must sit in a subnet whose route table goes to the IGW.
Adding the NAT route to the public subnet’s table instead of the private one.
Trying to attach an SG to a NAT gateway or deny it by “SG ID” in a NACL: neither exists.
Using a NAT gateway for IPv6: use an egress-only internet gateway.
One NAT gateway for all AZs: an AZ outage breaks egress for every subnet.
Removing internet access for one tier: just remove its 0.0.0.0/0 → nat route; don’t delete the shared gateway.
✓Benefits and use cases
Patching and package downloads from private subnets.
Calling third-party APIs from a fixed Elastic IP that partners can allow-list.
Pair with Network Firewall to filter which domains private instances reach.
The cheat sheet says NAT gateways scale to 10 Gbps. That number is old: today a NAT gateway scales from 5 Gbps up to 100 Gbps. It also says “NAT instance = old method”, which is still the exam’s view: pick the NAT gateway unless the question needs port forwarding or a bastion on the same box.
Bastion hosts (jump boxes)
A bastion is a hardened instance in a public subnet that admins SSH/RDP into first, then hop to private instances. For a highly available bastion: at least two in public subnets in two AZs, an Auto Scaling group (minimum 1), and SGs that allow 22/3389 only from the company’s IP range; private instances allow SSH only from the bastion’s security group. Never copy private keys onto the bastion; use SSH agent forwarding or, better, skip the bastion: Session Manager and EC2 Instance Connect Endpoint (Day 4) need no open inbound ports.
VPC DNS, DHCP option sets and reserved IPs
Item
What to remember
Amazon DNS server (Route 53 Resolver)
At the VPC base + 2 (for example 10.0.0.2) and 169.254.169.253. Turned on by enableDnsSupport; enableDnsHostnames gives public DNS names to instances with public IPs. Private hosted zones need both.
Use your own DNS servers
Create a new DHCP option set with up to 4 domain-name-servers and associate it with the VPC. You can’t edit an existing option set. Instances pick it up when the DHCP lease renews.
Stop using Amazon DNS
You can’t block it with an SG, NACL or route. Set enableDnsSupport=false (this also breaks private hosted zones and interface endpoint private DNS), or use Route 53 Resolver DNS Firewall to filter queries.
Reserved IPs
5 per subnet: network address, +1 VPC router, +2 DNS, +3 future use, last = broadcast. Subnet size /28 (16 IPs, 11 usable) to /16.
Flow log extras
A flow log’s settings (role, destination, format) can’t be changed after creation: delete and recreate. Flow logs for a peered VPC can only be created if that VPC is in your account. Flow logs never show payloads.
Troubleshooting order: “it can’t connect”
Walk the packet. 1. Route table: does the subnet have a route to the IGW, NAT gateway, VGW/TGW or peering connection, in both VPCs for peering? 2. NACL: allow in and out, including ephemeral ports. 3. Security group: inbound rule on the target; for peering, reference the peer SG or CIDR. 4. Host firewall (iptables, Windows Firewall). 5. Public IP or Elastic IP on the instance if it must be reached from the internet. Confirm with flow logs (REJECT records) and Reachability Analyzer. VPN traffic: the route table must send on-premises CIDRs to the VGW (or enable route propagation).
Think of it like · an office building
Private offices, one reception desk, and a phone directory.
AWS concept
Familiar thing
NAT gateway
≈
A mailroom that sends staff letters out with the company’s return address; outsiders can’t mail a person directly
NAT instance
≈
One clerk doing the mailroom job: if they’re sick, no mail goes out
Source/destination check off
≈
Letting the clerk handle letters that aren’t addressed to them
Egress-only IGW
≈
A one-way exit door for the new (IPv6) wing
Bastion host
≈
A guarded lobby every visitor must pass through first
DHCP option set
≈
The printed phone directory handed to every new desk; to change it you print a new one
Real AWS example · NAT gateway, egress-only IGW and custom DNS
The commands an engineer runs to give a private subnet IPv4 and IPv6 egress, then point the VPC to company DNS servers.
Only the private route table changes. The DHCP options are a new set, associated with the whole VPC.
Exam-style scenario
Four private subnets share one NAT gateway: two for applications (route table rtb-app) and two for databases (route table rtb-db). Security now says databases must have no internet access, while applications keep it. What is the simplest change?
A. Add a deny rule for the NAT gateway’s security group to the database NACL.
B. Remove the 0.0.0.0/0 → nat route from rtb-db.
C. Delete the NAT gateway and create a new one for the application subnets.
D. Add a deny route to the NAT gateway’s route table.
Show the worked answer
Answer: B
Internet access exists only because the database route table points to the NAT gateway. Remove that route and nothing else changes.
Why not the others
A: NAT gateways have no security group, and NACLs can’t reference SGs.
C: Unneeded work and downtime for apps.
D: Route tables have no deny routes.
How the exam tests this
“Private instances need outbound internet, no inbound”→ NAT gateway in a public subnet + route in the private table.
“Same, but IPv6”→ Egress-only internet gateway, route ::/0.
Check the basics first. Pick an answer, then press Check.
11
Hard quiz
Harder than most real exam questions on purpose, with one “choose two” and one matching question. Aim for 9 out of 12 before Day 3.
12
Practice test questions (from your mock exams)
These 9 questions come from your own SCS-003 mock exams (the last 1 are new questions added in the October 2026 review for features AWS changed in 2025–2026), matched to today’s topics. Each one was checked against current AWS behaviour: where a mock answer used old features (OAI, Classic Load Balancer, Inspector Classic) the wording was updated, and the explanation says so. The source is shown at the end of each explanation, for example “(Mock 5 · Q12)”.
13
Hands-on lab (30 minutes, low cost)
In a test VPC, launch one small Amazon Linux instance in a public subnet running a web server on port 80. Give its security group inbound TCP 80 from your IP only, and check the page loads.
Turn on VPC Flow Logs for the VPC to CloudWatch Logs with a 1-minute aggregation interval.
Create a custom network ACL with inbound TCP 80 from your IP and outbound TCP 80 only, and associate it with the subnet. The page stops loading. After a few minutes, find the inbound ACCEPT and outbound REJECT records for your IP in the flow logs.
Create a Reachability Analyzer path from the internet gateway to the instance on port 80 and run it. Read the explanation that names the NACL. Then add outbound TCP 1024-65535, run the analysis again and reload the page.
Create a DNS Firewall rule group with the AWS managed malware domain list, action BLOCK with NXDOMAIN, and associate it with the VPC. From the instance, run dig controldomain1.malwarelist.firewall.route53resolver.us-east-1.amazonaws.com (use your Region in the name) and see NXDOMAIN.
Clean up: disassociate and delete the DNS Firewall rule group, delete the flow log and its log group, re-associate the default NACL and delete the custom one, terminate the instance. Reachability Analyzer charges per analysis and DNS Firewall charges per query. Don’t create a Network Firewall or Gateway Load Balancer for practice unless you delete it the same day: both charge every hour they exist, even with no traffic.