SaveMyCert
Log in
2 of 2 free questions left today·for 5 a day
Design Secure Architectures

Securing Workloads: VPC Design, Security Groups vs NACLs, WAF and Shield

30 min readSAA-C03 · Design Secure ArchitecturesUpdated

Designing secure workloads on AWS means controlling who and what can reach each part of an application: which subnets can talk to the internet, which traffic each filter admits, how services are reached privately, which managed service answers each threat, and where credentials live. Task 1.2 covers exactly that — VPCs with public, private, and isolated subnet tiers; security groups, network ACLs, route tables, and NAT gateways; VPC endpoints and PrivateLink; keeping origins private behind CloudFront and filtering egress with AWS Network Firewall; the application security services (Cognito, IAM Identity Center, GuardDuty, Macie, Shield, WAF); Secrets Manager and Parameter Store; and encrypted external connections over VPN and Direct Connect. It sits in Design Secure Architectures, the heaviest SAA-C03 domain, and its scenarios name a threat or an exposure — a database reachable from the internet, a DDoS attack, SQL injection, a load balancer attackers reach around CloudFront, access keys hard-coded in an application — and ask for the design that closes it under a stated constraint. By the end of this lesson you will be able to lay out a three-tier secure VPC from scratch, trace any packet through its route tables and filters, and map any named threat to the service that mitigates it.

What you’ll learn

  • Design a three-tier VPC with public, private, and isolated subnets, choosing zonal or regional NAT gateways and an egress-only internet gateway for IPv6
  • Choose between security groups and network ACLs, write NACL rules that account for statelessness and ephemeral ports, and reference security groups by ID between tiers
  • Distinguish gateway endpoints, interface endpoints, and PrivateLink endpoint services, and lock them down with endpoint policies, private DNS, and aws:SourceVpce
  • Keep origins private behind CloudFront (VPC origins, origin access control) and filter egress by domain with AWS Network Firewall
  • Match threats — DDoS, SQL injection, credential stuffing, compromised instances, exposed sensitive data — to Shield, WAF, GuardDuty, or Macie and configure the right feature
  • Choose between Cognito user pools, identity pools, and IAM Identity Center, and between Secrets Manager, Parameter Store, and AppConfig
  • Design encrypted external connectivity with Site-to-Site VPN, VPN over Direct Connect, and MACsec

The 12 parts · about 28 min of reading

  1. Segment the VPCStart hereRoutes make a subnet public, private or isolated; only load balancers and NAT gateways go in public subnets, data stores in isolated ones.4 min
  2. Security groups vs network ACLsUse security groups referenced by ID between tiers, a NACL deny for a few IP ranges, and a WAF IP set when the deny list runs long.3 min
  3. VPC endpointsUse free gateway endpoints for S3 and DynamoDB, interface endpoints for everything else, and endpoint policies to block exfiltration.3 min
  4. The three-tier secure VPCALB in public subnets, app tier in private, RDS in isolated subnets, chained by security groups, with Session Manager for admin access.2 min
  5. Protecting origins and filtering egressLock origins to CloudFront with VPC origins or OAC, and route egress through AWS Network Firewall to allow only approved domains.2 min
  6. Application identityA user pool handles sign-up, sign-in and JWTs; an identity pool trades tokens for temporary AWS credentials, including for guests.2 min
  7. Threat vectors and the mitigation mapShield handles layer 3/4 DDoS, WAF filters malicious web requests, GuardDuty detects active threats, and Macie finds sensitive data in S3.2 min
  8. WAF and Shield in practiceScope rate-based rules to the attacked path, combine WAF statements for exceptions, and enforce rules across accounts with Firewall Manager.2 min
  9. Detection at scaleA delegated administrator auto-enables GuardDuty in every account, EventBridge drives the response, and Macie samples or runs full jobs.1 min
  10. Credential securityRotation or cross-account sharing selects Secrets Manager, cheap config or static secrets Parameter Store, and safe rollouts AppConfig.3 min
  11. Securing external connectionsVPN is quick, cheap and encrypted; Direct Connect is private but not encrypted by default, so add VPN over it or MACsec.2 min
  12. Worked scenariosEach scenario splits the problem by layer or constraint and maps each one, such as no internet, cost or audited access, to one mechanism.2 min

Mind map

Routes make a subnet public, privateor isolatedPublic subnets: internet-facing LBs,NAT onlyZonal NAT per AZ; regional needs nopublic subnetOutbound-only IPv6: egress-onlyinternet gateway1✓Subnet tiersSGs stateful, allow-only; NACLsstateless, orderedNACL replies need ephemeral ports1024-65535Long IP deny list for HTTP: WAF IP setReference SGs by ID; inter-Regionpeering uses CIDR2✓Security groups vs NACLsGateway endpoints: S3, DynamoDB, free,route entryInterface endpoints need private DNS +VPC DNS attrsEndpoint policy + aws:SourceVpce stopexfiltrationPeering has no edge-to-edge routing3✓VPC endpointsALB public, app private, RDS isolatedChain SGs: ALB to app to DB by IDSession Manager: no inbound ports, noSSH keysIsolated SSM needs ssm, ssmmessages,ec2messages4✓Three-tier secure VPCCloudFront VPC origins for internalALBs/EC2S3 origin: OAC on the REST endpoint,not websiteNetwork Firewall allows egress bydomain nameFirewall routing must be symmetric5✓Origins and egressfilteringUser pool: sign-up, sign-in, JWTs, noguestsIdentity pool: temporary AWS creds,guest accessALB authenticate-cognito adds sign-in,no codeEmployees use Identity Center, notCognito6✓Cognito pool typesShield: layer 3/4 DDoS; WAF: layer 7requestsWAF never attaches to a Network LoadBalancerGuardDuty detects threats; Macie findsS3 PIIInspector scans vulnerabilities, notthreats7✓Threat mitigation mapScope rate-based rules to the attackedpathGeo block with exception: geo AND NOTIP setShield Advanced L7 mitigation needs aweb ACLFirewall Manager enforces rulesorg-wide8✓WAF and Shield inpracticeGuardDuty delegated admin +auto-enable membersEventBridge rule drives automatedresponseMacie automated discovery samplesdailyCustom data identifiers fororg-specific formats9✓Detection at scaleRotation or cross-account sharing:Secrets ManagerAlternating users: zero-downtimerotationCheap config or static secrets:Parameter StoreGradual config rollout with rollback:AppConfig10✓Secrets and configurationVPN: quick, cheap, IPsec-encrypted,internet pathDirect Connect is private, notencrypted by defaultEncrypt DX with VPN over it or MACsecVPN as cheaper failover for DirectConnect11✓VPN and Direct ConnectDB on EC2: private subnet + NAT forpatchesFloods + SQL injection: ShieldAdvanced + WAFPrivate S3, lower cost: gatewayendpoint12✓Worked scenariosSecuring VPCworkloads
Mind map

Securing Workloads: VPC Design, Security Groups vs NACLs, WAF and Shield

Routes make a subnet public, privateor isolatedPublic subnets: internet-facing LBs,NAT onlyZonal NAT per AZ; regional needs nopublic subnetOutbound-only IPv6: egress-onlyinternet gateway1✓Subnet tiersSGs stateful, allow-only; NACLsstateless, orderedNACL replies need ephemeral ports1024-65535Long IP deny list for HTTP: WAF IP setReference SGs by ID; inter-Regionpeering uses CIDR2✓Security groups vs NACLsGateway endpoints: S3, DynamoDB, free,route entryInterface endpoints need private DNS +VPC DNS attrsEndpoint policy + aws:SourceVpce stopexfiltrationPeering has no edge-to-edge routing3✓VPC endpointsALB public, app private, RDS isolatedChain SGs: ALB to app to DB by IDSession Manager: no inbound ports, noSSH keysIsolated SSM needs ssm, ssmmessages,ec2messages4✓Three-tier secure VPCCloudFront VPC origins for internalALBs/EC2S3 origin: OAC on the REST endpoint,not websiteNetwork Firewall allows egress bydomain nameFirewall routing must be symmetric5✓Origins and egressfilteringUser pool: sign-up, sign-in, JWTs, noguestsIdentity pool: temporary AWS creds,guest accessALB authenticate-cognito adds sign-in,no codeEmployees use Identity Center, notCognito6✓Cognito pool typesShield: layer 3/4 DDoS; WAF: layer 7requestsWAF never attaches to a Network LoadBalancerGuardDuty detects threats; Macie findsS3 PIIInspector scans vulnerabilities, notthreats7✓Threat mitigation mapScope rate-based rules to the attackedpathGeo block with exception: geo AND NOTIP setShield Advanced L7 mitigation needs aweb ACLFirewall Manager enforces rulesorg-wide8✓WAF and Shield inpracticeGuardDuty delegated admin +auto-enable membersEventBridge rule drives automatedresponseMacie automated discovery samplesdailyCustom data identifiers fororg-specific formats9✓Detection at scaleRotation or cross-account sharing:Secrets ManagerAlternating users: zero-downtimerotationCheap config or static secrets:Parameter StoreGradual config rollout with rollback:AppConfig10✓Secrets and configurationVPN: quick, cheap, IPsec-encrypted,internet pathDirect Connect is private, notencrypted by defaultEncrypt DX with VPN over it or MACsecVPN as cheaper failover for DirectConnect11✓VPN and Direct ConnectDB on EC2: private subnet + NAT forpatchesFloods + SQL injection: ShieldAdvanced + WAFPrivate S3, lower cost: gatewayendpoint12✓Worked scenariosSecuring VPCworkloads

How the exam tests this

SAA-C03 probes this task by naming an exposure or a threat and demanding the design that closes it under a stated constraint: a database in a public subnet or in the app tier's NAT-routed subnets (move it to an isolated subnet, reference security groups by ID), a policy forbidding public subnets (regional NAT gateway) or outbound-only IPv6 (egress-only internet gateway), S3 traffic that must avoid the internet and cost (gateway endpoint with endpoint and bucket policies), an endpoint that changes nothing (private DNS), attackers reaching an ALB or bucket around CloudFront (VPC origin, origin access control), SQL injection, credential stuffing, or DDoS (WAF managed and scoped rate-based rules vs Shield Advanced), and hard-coded credentials (roles plus Secrets Manager or Parameter Store, split by rotation and cost). Classic shapes include the NACL connectivity mystery (missing ephemeral-port rule, often on the return path through NAT), the hybrid link requiring encryption (VPN over Direct Connect, or MACsec on a dedicated link), and admin access with no inbound ports (Session Manager with its endpoints). Traps are near-twins: WAF on an NLB, a security group deny, an outbound-only NACL deny, an internal ALB as a custom origin, an identity pool for password sign-up, GuardDuty for finding PII. Match the layer, the watched surface, and the constraint, and one option remains.

Key takeaways

  1. A route table defines the subnet: internet gateway route = public, NAT route = private, neither = isolated; only internet-facing load balancers and zonal NAT gateways belong in public subnets.
  2. Zonal NAT gateways sit in a public subnet, one per AZ; a regional NAT gateway needs no public subnet and spans AZs; outbound-only IPv6 uses an egress-only internet gateway.
  3. Security groups are stateful and allow-only (NLB groups too); NACLs are stateless, ordered allow/deny, and need ephemeral-port return rules — and long deny lists in front of HTTP belong in a WAF IP set.
  4. Reference security groups by ID between tiers; across inter-Region peering, use the peer CIDR instead.
  5. Gateway endpoints (S3, DynamoDB) are free route-table entries; interface endpoints need private DNS (plus VPC DNS attributes) to be transparent; endpoint policies plus aws:SourceVpce stop exfiltration.
  6. Keep origins private: CloudFront VPC origins for internal ALBs/instances, OAC with the S3 REST endpoint; AWS Network Firewall filters egress by domain name with symmetric routing.
  7. Shield = layer 3/4 DDoS (Advanced adds response team, cost protection, L7 auto-mitigation with a web ACL); WAF = layer 7 on CloudFront/ALB/API Gateway, never an NLB — use scoped rate-based rules and AND/NOT logic.
  8. GuardDuty detects (delegated admin + auto-enable, EventBridge for response); Macie finds sensitive S3 data (automated discovery, custom data identifiers).
  9. Cognito user pool = app sign-up/sign-in and JWTs (no guests); identity pool = temporary AWS credentials and guest access; IAM Identity Center = workforce accounts and SaaS apps.
  10. Secrets Manager for rotation (alternating users for zero-downtime) and cross-account access (customer managed KMS key); Parameter Store for cheap config with path-scoped IAM; Direct Connect is private but not customer-encrypted — add VPN over it or MACsec.
0/12
Ready to start

Part 1: Segment the VPC

Routes make a subnet public, private or isolated; only load balancers and NAT gateways go in public subnets, data stores in isolated ones.

4 min read · 12 parts, about 28 min in allStart lesson

Frequently asked questions

What is the difference between a security group and a network ACL?

A security group attaches to a resource (an instance, database, or load balancer network interface) and is stateful: allowed inbound traffic gets its response out automatically, and it supports allow rules only. A network ACL attaches to a subnet and is stateless: each direction needs its own rule, so replies to clients need an outbound allow for ephemeral ports 1024-65535, and it supports both allow and deny rules evaluated in numbered order. Use security groups as the primary per-resource control and for tier-to-tier references by group ID; use a NACL when you must explicitly deny a few IP ranges at the subnet boundary. For hundreds of ranges in front of a web application, use an AWS WAF IP set instead.

When should I use a gateway VPC endpoint vs an interface endpoint?

Use a gateway endpoint for Amazon S3 and DynamoDB access from inside the VPC: those are the only two services it supports, it works as a route-table entry, and it is free. Use an interface endpoint (AWS PrivateLink) for private access to most other AWS services, such as SQS, KMS, Secrets Manager, and Systems Manager, or to reach S3 privately from on premises over Direct Connect or VPN, which a gateway endpoint cannot serve. Interface endpoints bill hourly plus per GB, and with private DNS enabled (and the VPC DNS attributes on) applications use them without code changes.

What is the difference between AWS Shield and AWS WAF?

They defend different layers. AWS Shield mitigates DDoS attacks at the network and transport layers, such as SYN floods and UDP reflection. Shield Standard is automatic and free; Shield Advanced adds tuned protection for specific resources, 24/7 access to the Shield Response Team, cost protection, and automatic layer 7 DDoS mitigation when the resource has a WAF web ACL. AWS WAF is a web application firewall that inspects HTTP(S) requests on CloudFront, an Application Load Balancer, API Gateway, AppSync, and similar HTTP-facing resources, blocking SQL injection, cross-site scripting, bad IPs, and abusive request rates. WAF cannot be attached to a Network Load Balancer. A public web app typically uses both.

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?