Network Security Controls: SGs, NACLs, Network Firewall, and Egress
Network security in a VPC is a layered system, not a single control: security groups give you stateful, identity-like micro-segmentation at the ENI; network ACLs give you stateless, subnet-level guardrails and the only explicit deny at that layer; AWS Network Firewall adds deep packet inspection and domain-based egress filtering; and Route 53 Resolver DNS Firewall polices what your workloads can even resolve. Task 3.3 tests whether you can pick the right layer for a requirement, compose them into a defense-in-depth design — segmented subnets, VPC endpoints with restrictive endpoint policies, centralized inspection through Transit Gateway — and then troubleshoot the result when legitimate traffic breaks or traffic silently bypasses inspection. This lesson works through each control layer, the egress-control and data-perimeter patterns the exam loves, and the diagnostic method — Flow Logs REJECT analysis, route-table tracing, Reachability Analyzer — that separates a Specialty candidate from an Associate one.
On this page8 sections
- Security groups and NACLs: the security reading
- Segmentation: subnet tiers, route tables, and traffic direction
- VPC endpoints and endpoint policies: private access with a perimeter
- AWS Network Firewall: deployment models and rule groups
- Egress control: stopping exfiltration to arbitrary hosts
- Choosing the control layer
- Transit Gateway security and the centralized inspection walkthrough
- Troubleshooting: blocked traffic and bypassed inspection
- Design layered VPC controls using security groups for micro-segmentation and NACLs for subnet-level guardrails and explicit denies.
- Keep service traffic private with gateway and interface VPC endpoints, and constrain it with endpoint policies using org-level condition keys.
- Deploy AWS Network Firewall in distributed and centralized inspection models, and choose between stateless rules, Suricata-compatible stateful rules, and domain lists.
- Build egress control that blocks data exfiltration to arbitrary internet hosts using Network Firewall domain filtering and Route 53 Resolver DNS Firewall.
- Segment inter-VPC traffic with Transit Gateway route tables and steer east-west flows through an inspection VPC.
- Troubleshoot blocked legitimate traffic and bypassed inspection using VPC Flow Logs, route-table analysis, and Reachability Analyzer.
Security groups and NACLs: the security reading
You already know the mechanics; the exam tests the security design reading. A security group is stateful: return traffic for an allowed connection is permitted automatically, rules are allow-only, and every rule is evaluated. Its killer security feature is referencing other security groups as sources. A rule on the database tier allowing port 3306 from the app tier's security group is effectively identity-based micro-segmentation: membership in the source group is the credential, and the rule survives Auto Scaling, IP churn, and subnet redesigns that would break any CIDR-based rule. Least privilege here means one rule per required flow, SG references instead of CIDRs wherever the source is inside AWS, and no default-open outbound where egress matters.
A network ACL is stateless and evaluated at the subnet boundary as an ordered, numbered rule list — first match wins. Statelessness means you must explicitly allow return traffic, which in practice means allowing the ephemeral port range (for Linux clients typically 32768–60999; NACL rules commonly open 1024–65535) in the reverse direction. That cost buys you two things security groups cannot do: an explicit deny and a subnet-wide blast radius. NACLs are the coarse guardrail layer: deny a known-malicious CIDR across an entire subnet, enforce that an isolated subnet never talks to the internet regardless of what any instance's SG says, or act as an incident-response kill switch — a low-numbered deny rule cuts an attacker off mid-session, whereas removing an SG rule only prevents new connections because existing tracked flows can persist.
Defense in depth uses both: SGs express intended flows tightly; NACLs enforce what must never happen at the subnet tier.
Segmentation: subnet tiers, route tables, and traffic direction
Segmentation in a VPC is built from subnets and route tables, because a subnet's route table decides what its workloads can even attempt to reach. The three-tier reference design the exam assumes: a public tier (route to an internet gateway) holding only load balancers and NAT gateways; a private tier (default route to a NAT gateway, no inbound path from the internet) holding application compute; and an isolated tier (no route to an IGW or NAT at all) holding databases and other crown-jewel data stores, which reach AWS services only through VPC endpoints. Each tier gets its own route table — sharing one route table across tiers is how a database subnet quietly inherits a NAT route it should never have.
The guide's language of north/south versus east/west maps directly onto this: north/south is traffic crossing the perimeter (internet or hybrid), controlled by edge services, NAT placement, and egress firewalls; east/west is lateral traffic between tiers, VPCs, or accounts, controlled by SG references, NACLs, and Transit Gateway route-table segmentation. Attackers who land on an app instance pivot east-west, so a design answer that only hardens the perimeter is wrong at Specialty level.
Finally, verify the segmentation you think you have: Network Access Analyzer evaluates configuration to find network paths that violate your intent (for example, any path from the internet to the isolated tier), and Amazon Inspector's network reachability findings flag instances exposed on unintended ports — both are the guide's named tools for identifying unnecessary network access.
VPC endpoints and endpoint policies: private access with a perimeter
VPC endpoints are a security control, not just a networking convenience: they keep service traffic on the AWS network so an isolated subnet can use S3 or KMS with no internet path at all. Know both flavors. A gateway endpoint (S3 and DynamoDB only) is a route-table entry targeting a managed prefix list — free, highly available, but usable only from within that VPC. An interface endpoint (most other services, powered by AWS PrivateLink) is an ENI with a private IP in your subnet; you attach security groups to it, enable private DNS so the service's normal hostname resolves to the private IP, and it is reachable over peering, VPN, or Direct Connect — which is why a centralized shared-endpoints VPC is a common cost/design pattern.
The Specialty differentiator is the endpoint policy: a policy document attached to the endpoint that constrains what the endpoint can be used for. This is the data-perimeter angle. An S3 gateway endpoint policy can allow access only to your approved buckets, so a compromised instance cannot push data to an attacker-owned bucket through your own endpoint. At the organization level, the conditions to recognize are aws:PrincipalOrgID — only identities from your AWS Organization may use this endpoint — and aws:ResourceOrgID — the endpoint may only reach resources owned by your organization. Together they turn every endpoint into a checkpoint that keeps trusted identities talking to trusted resources over trusted networks.
PrivateLink also solves private service exposure: publish your service behind a Network Load Balancer as an endpoint service, and consumer VPCs connect via interface endpoints with no peering, no route coupling, and no CIDR overlap concerns — consumers see one ENI, not your network.
AWS Network Firewall: deployment models and rule groups
AWS Network Firewall is the managed layer 3–7 inspection engine for traffic SGs and NACLs cannot understand. It deploys as firewall endpoints in dedicated firewall subnets (one per AZ), and it inspects only what routing sends through it — route steering is the deployment. In the distributed model, each VPC gets its own firewall: workload subnets route 0.0.0.0/0 to the firewall endpoint, the firewall subnet routes onward to the NAT or internet gateway, and an ingress route table on the IGW steers return and inbound traffic back through the firewall so both directions are inspected. In the centralized model, a dedicated inspection VPC attached to a Transit Gateway inspects traffic for the whole organization — covered in the Transit Gateway section below.
Rules come in two engines. Stateless rule groups match 5-tuples with actions pass, drop, or forward to stateful — fast, no context, analogous to NACLs. Stateful rule groups are Suricata-compatible: they track connections and can match on protocol semantics, including the TLS SNI and HTTP Host header, which is what enables domain list rules — an allow list ("walled garden": permit .amazonaws.com and your approved SaaS domains, deny everything else) or a deny list of known-bad domains, applied to HTTP/HTTPS egress without decrypting traffic. You can also write raw Suricata rules for IPS-style signatures and use AWS managed rule groups for threat intelligence. Understand rule order: in the default action order, evaluation follows pass → drop → alert priorities; strict order evaluates rules exactly in the order you define, and a misordered broad pass rule sitting above a targeted drop is a classic "why is blocked traffic getting through" exam scenario.
Managing firewall policies across many accounts is AWS Firewall Manager's job — know it as the central deployment answer.
Egress control: stopping exfiltration to arbitrary hosts
"Prevent workloads from sending data to arbitrary internet hosts" is one of the most repeatable scenario families in Domain 3, and NAT alone is not an answer — a NAT gateway grants outbound reach, it does not filter it. The layered egress design: private subnets route through NAT, with an AWS Network Firewall domain allow list in the path so only approved destinations (patch mirrors, package repos, your SaaS vendors) succeed and everything else is dropped and alerted on.
One layer up the stack sits Route 53 Resolver DNS Firewall, which filters at the resolution step: rule groups of allowed or blocked domain lists (including AWS managed threat lists) are associated with a VPC, and a query for a disallowed domain returns NXDOMAIN, an override, or is blocked before any packet ever leaves. It supports the same walled-garden pattern — allow your known-good domains, block * — and it is cheap and simple. Its limit is the flip side of its layer: it controls DNS resolution, not packets. Malware that connects to a raw IP, or that uses its own external DNS resolver, never asks the Resolver anything. That is why the strong design pairs them: DNS Firewall for broad, cheap domain policy plus visibility into query logs, and Network Firewall to block direct-to-IP egress and traffic to non-approved SNI values — and to block outbound port 53 to anything except the VPC resolver, closing the rogue-resolver hole.
A forward proxy fleet (explicit proxy with allow-listed URLs) is the third pattern to recognize at concept level: more control (full URL path filtering, authentication) at the cost of managing infrastructure and client configuration.
Choosing the control layer
Most Task 3.3 questions reduce to "which control, at which layer, for this requirement." Anchor on what each control can see and what its unique capability is:
| Control | Scope | State | Unique strength | Reach for it when… |
|---|---|---|---|---|
| Security group | ENI / instance | Stateful, allow-only | SG references = micro-segmentation that survives IP churn | Least-privilege tier-to-tier flows |
| Network ACL | Subnet | Stateless, allow + deny | Explicit deny; ordered rules; subnet-wide kill switch | Coarse guardrails, blocking known-bad CIDRs, containment |
| Network Firewall | Routed traffic (L3–L7) | Stateless + Suricata-compatible stateful | Domain/SNI egress filtering, IPS signatures, central inspection | Egress allow lists, deep inspection, org-wide east-west control |
| DNS Firewall | VPC DNS resolution | Query-level | Blocks domains before any connection exists; query logging | Cheap domain walled garden, DNS exfiltration defense |
| AWS WAF | L7 HTTP on CloudFront/ALB/API Gateway (Task 3.1) | Request-level | Inspects HTTP request content, rate limiting | Inbound web-app threats — not general VPC traffic |
Two adjacent controls round out the picture at concept level. For hybrid connectivity, Site-to-Site VPN gives you IPsec encryption in transit over the internet; Direct Connect is a private circuit but is not encrypted by default — the exam answers are MACsec (layer 2 encryption on supported high-speed connections) or running a Site-to-Site VPN over the Direct Connect path. AWS Verified Access is the guide's named answer for VPN-less, identity- and posture-evaluated access from hybrid users to internal applications — per-request policy evaluation instead of network-level trust.
Transit Gateway security and the centralized inspection walkthrough
Transit Gateway is a security boundary because its route tables decide which attachments can reach which. Instead of the default single route table (full mesh), you create multiple TGW route tables and control two knobs per attachment: association (which table routes that attachment's outbound traffic) and propagation (which tables learn that attachment's CIDR). Segmentation pattern: production spokes associate with a route table that propagates only shared services and the inspection VPC — never each other — so two prod VPCs cannot talk laterally even though both hang off the same TGW.
Now walk the exam's favorite design: centralized egress and east-west inspection for an organization. Spoke VPCs in member accounts attach to the TGW (shared via AWS RAM). The spoke route table's only meaningful route is 0.0.0.0/0 → inspection VPC attachment. The inspection VPC contains firewall subnets holding Network Firewall endpoints and TGW attachment subnets; its VPC route tables steer arriving traffic into the firewall endpoints and, post-inspection, onward — back to the TGW for east-west flows, or out through a NAT/IGW in an egress VPC (or the inspection VPC itself) for north/south. A second TGW route table associated with the inspection VPC attachment propagates all spoke CIDRs so inspected traffic can return.
The detail the exam probes: enable appliance mode on the inspection VPC attachment. Without it, the TGW picks an AZ for each direction of a flow independently, so return traffic can arrive at a different firewall endpoint than the outbound path used — a stateful engine that never saw the SYN drops the reply. Appliance mode keeps both directions of a flow symmetric to the same AZ.
Troubleshooting: blocked traffic and bypassed inspection
Troubleshooting questions give you a symptom and four plausible layers; win them with a method, not recall. Symptom: legitimate traffic broke after a segmentation change. Check in order: (1) Security group source type — a rule referencing an SG stops matching if traffic now arrives through a NAT or load balancer (source IP changes) or if instances moved to a group the rule does not reference; a CIDR rule breaks when subnets were renumbered. (2) NACL return traffic — a newly tightened NACL that forgot the ephemeral port range in the reverse direction produces the classic Flow Logs signature: inbound ACCEPT followed by outbound REJECT for the same flow. An SG block, being stateful, shows a single inbound REJECT and no accepted half. (3) Endpoint policy too strict — S3 calls failing with AccessDenied only from inside the VPC, while the same role works elsewhere, points at the endpoint policy (or an aws:ResourceOrgID condition and a legitimate third-party bucket). (4) Firewall rule order — in strict order, a drop placed above the intended pass wins.
Symptom: traffic is not being inspected. This is almost always routing, not rules: a workload subnet route table still pointing 0.0.0.0/0 at the NAT instead of the firewall endpoint, a missing IGW ingress route table so inbound replies skip the firewall, a spoke TGW attachment associated with the wrong TGW route table, or appliance mode disabled causing asymmetric drops that look like random timeouts.
Your visibility toolkit: VPC Flow Logs with custom fields (flow-direction, traffic-path, tcp-flags, pkt-dstaddr) to see where flows actually go; Reachability Analyzer to statically prove a path between two endpoints and name the blocking component without sending packets; and Traffic Mirroring when you genuinely need packet payloads for out-of-band analysis.
Tip. Task 3.3 questions map requirements to layers: "S3 access must never traverse the internet and only reach the organization's buckets" → gateway endpoint plus an endpoint policy (aws:ResourceOrgID); "block all egress except approved domains" → Network Firewall domain allow list, with DNS Firewall as the resolution-layer complement; "inspect all inter-VPC traffic centrally" → Transit Gateway with an inspection VPC and appliance mode enabled. Troubleshooting stems hinge on one telling detail — inbound ACCEPT plus outbound REJECT in Flow Logs means a stateless NACL return-port block, while a subnet route pointing at the NAT instead of the firewall endpoint means inspection is bypassed. Explicit-deny and mid-session containment requirements point at NACLs, never security groups.
- Security groups are stateful and allow-only; referencing SGs as rule sources gives micro-segmentation that survives IP churn. NACLs are stateless, ordered, subnet-wide, and the only layer with an explicit deny — remember ephemeral return ports.
- Removing an SG rule does not cut existing tracked connections; a NACL deny does — NACLs are the subnet-level kill switch during containment.
- Gateway endpoints (S3/DynamoDB, route-table based, free) and interface endpoints (PrivateLink ENIs with security groups) keep traffic off the internet; endpoint policies with aws:PrincipalOrgID / aws:ResourceOrgID make them data-perimeter checkpoints.
- Network Firewall inspects only what routing steers through its endpoints: stateless 5-tuple rules plus Suricata-compatible stateful rules, including SNI/Host-based domain allow and deny lists for egress filtering.
- For "block egress except approved destinations": Network Firewall domain allow list in the routed path, DNS Firewall for the resolution layer — DNS Firewall controls lookups, not packets, so direct-to-IP traffic needs Network Firewall.
- Centralized inspection = spoke TGW route tables defaulting to an inspection VPC running Network Firewall, with appliance mode enabled to keep flows symmetric; TGW route-table association and propagation are the segmentation controls.
- Direct Connect is not encrypted by default — MACsec or a VPN over the connection are the encryption-in-transit answers; Verified Access is the VPN-less identity-based access answer.
- Troubleshoot with Flow Logs signatures (inbound ACCEPT + outbound REJECT = stateless NACL return block; single REJECT = SG), route-table tracing for bypassed inspection, and Reachability Analyzer to name the blocking component.
Frequently asked questions
How do I block outbound traffic to unknown domains in AWS?
Use an AWS Network Firewall stateful domain allow list in the egress path: route private subnets through firewall endpoints before the NAT gateway, allow only your approved domains (matched on TLS SNI or HTTP Host), and drop everything else. Pair it with Route 53 Resolver DNS Firewall so disallowed domains fail at the DNS lookup, and block outbound DNS to anything except the VPC resolver so workloads cannot sidestep the policy with an external resolver.
What is the difference between a security group and a network ACL on the SCS-C03 exam?
Security groups are stateful, instance/ENI-level, allow-only, evaluate all rules, and can reference other security groups as sources — the least-privilege micro-segmentation tool. Network ACLs are stateless, subnet-level, evaluated in numbered order, and support explicit deny — the coarse guardrail and kill-switch tool, which must explicitly allow ephemeral-port return traffic. Specialty questions test the design reading: SGs for intended flows, NACLs for what must never happen.
Can a VPC endpoint policy restrict S3 access to only my organization's buckets?
Yes. Attach an endpoint policy to the S3 gateway endpoint that allows actions only on approved bucket ARNs, or use the aws:ResourceOrgID condition key so the endpoint only reaches resources owned by your AWS Organization. Adding aws:PrincipalOrgID restricts the endpoint to identities from your organization. This is the standard data-perimeter defense against exfiltration to an attacker-owned bucket through your own private connectivity.
What is the difference between Route 53 Resolver DNS Firewall and AWS Network Firewall?
DNS Firewall filters DNS queries at the VPC resolver — a blocked domain never resolves, but it inspects no packets, so connections to raw IPs or via an external resolver bypass it. Network Firewall inspects the actual traffic in the routed path and can drop flows by domain (SNI/Host), signature, or 5-tuple regardless of how the destination was resolved. Use DNS Firewall as the cheap broad domain layer and Network Firewall as the enforcement layer; strong egress designs use both.
How do I inspect all traffic between VPCs centrally in AWS?
Attach every spoke VPC to a Transit Gateway and use TGW route tables to force inter-VPC (east-west) traffic through a dedicated inspection VPC running AWS Network Firewall endpoints. Spoke route tables default-route to the inspection VPC attachment and do not propagate to each other, and appliance mode must be enabled on the inspection VPC attachment so both directions of each flow hit the same firewall availability zone.
Why is my traffic bypassing AWS Network Firewall?
Almost always routing: the firewall only sees traffic that route tables steer through its endpoints. Check for a workload subnet still routing 0.0.0.0/0 to the NAT or internet gateway directly, a missing ingress route table on the IGW for the return path, or a Transit Gateway attachment associated with a route table that sends traffic straight between spokes. Asymmetric flows from a disabled appliance mode also drop at the stateful engine and mimic bypass or random timeouts.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.