AWS Edge, Network & Compute Security
How AWS protects the three layers an attacker crosses on the way in: the edge (CloudFront, WAF, Shield), the network (VPC controls, hybrid links, zero-trust access) and the compute itself (hardened images, patching, admin access, vulnerability scanning). Security groups, NACLs and Network Firewall basics are in AWS fundamentals; this file goes further.
Last verified2026-10 — AWS WAF limits, Shield pricing and feature names change; check current service documentation before relying on exact numbers.
Edge Protection — CloudFront, WAF and Shield
What is this?
The edge is where internet traffic first touches your application. CloudFront is AWS's content delivery network: hundreds of locations that cache content and terminate TLS close to users. AWS WAF (web application firewall) inspects HTTP requests and blocks bad ones. AWS Shield absorbs DDoS (distributed denial-of-service) floods. Together they let you stop attacks before they reach your servers.
Why it matters
Most internet-facing attacks are either application-layer (SQL injection, credential stuffing, scraping) or volumetric (floods). Stopping them at the edge is cheaper and safer than stopping them at the origin, and the origin must be locked so attackers cannot simply go around the edge.
How it works
Client ──► CloudFront edge ──► AWS WAF web ACL ──► (Shield absorbs floods) ──► Origin
│ │ │
│ TLS, geo-restrict │ rules evaluated in priority order: │ ALB / S3 / API GW
│ signed URLs │ allow / block / count / CAPTCHA / challenge │ accepts traffic
│ │ │ ONLY from CloudFrontAWS WAF building blocks
the rule set attached to a resource: CloudFront, ALB, API Gateway REST API, AppSync, Cognito user pool, App Runner or Verified Access.
AWS and marketplace rule sets: core rule set (OWASP-style injection and XSS patterns), known bad inputs, SQL database, Linux/Windows/PHP exploits, IP reputation and anonymous IP lists (VPNs, Tor, hosting providers).
block a client that sends more than N requests in a time window. The aggregation key can be the IP, a header, a cookie, a query argument or a combination, so you can rate-limit per API key or per session, not only per IP.
allow or block by country; combine with labels for "block login attempts from countries we don't operate in."
classifies common bots (search engines, scrapers) and, in targeted mode, detects sophisticated bots with browser interrogation.
account takeover prevention (checks login attempts against stolen-credential lists) and account creation fraud prevention.
match on the JA3 or JA4 TLS fingerprint, which identifies the client software even when the IP rotates.
make suspicious clients prove they are a browser instead of blocking outright.
one rule can label a request and a later rule can act on the label; this is how complex logic is built.
to CloudWatch Logs, S3 or Firehose (the destination name must start with aws-waf-logs-); logs can be fed to Security Lake.
AWS Shield
free, automatic protection against common layer 3 and 4 floods (SYN floods, UDP reflection) for every customer.
paid subscription per organisation. Adds detection tuned to your traffic baseline, automatic application-layer mitigation (it writes WAF rules for you during an attack), access to the Shield Response Team, proactive engagement (the team contacts you when health checks fail during an event), cost protection (credits for scaling charges caused by a DDoS), and WAF at no extra cost for protected resources. Associate Route 53 health checks so detection uses your application's real health.
Locking the origin
use Origin Access Control (OAC), which signs CloudFront's requests to S3; the bucket policy then allows only that distribution (aws:SourceArn). OAC replaced the older origin access identity.
restrict the security group to the CloudFront managed prefix list, and have CloudFront add a secret custom header that the ALB requires.
restrict private content to authorised viewers.
add security headers (HSTS, Content-Security-Policy, X-Content-Type-Options) at the edge. See security headers.
cross-origin resource sharing rules on a bucket decide which websites' JavaScript may read it; AllowedOrigins: ["*"] with credentials is a misconfiguration.
In practiceA WAF rate-based rule that limits login attempts per session cookie rather than per IP, starting in count mode:
{ "Name": "login-rate-limit", "Priority": 10,
"Statement": { "RateBasedStatement": {
"Limit": 20, "EvaluationWindowSec": 300,
"AggregateKeyType": "CUSTOM_KEYS",
"CustomKeys": [ { "Cookie": { "Name": "session", "TextTransformations": [ { "Priority": 0, "Type": "NONE" } ] } } ],
"ScopeDownStatement": { "ByteMatchStatement": { "FieldToMatch": { "UriPath": {} }, "SearchString": "/login",
"PositionalConstraint": "STARTS_WITH", "TextTransformations": [ { "Priority": 0, "Type": "NONE" } ] } } } },
"Action": { "Count": {} }, ← switch to Block after reviewing the logs
"VisibilityConfig": { "SampledRequestsEnabled": true, "CloudWatchMetricsEnabled": true, "MetricName": "login-rate" } }📰Real incident — HTTP/2 Rapid Reset (2023, CVE-2023-44487). Attackers abused a feature of HTTP/2 — opening and immediately cancelling streams — to generate record-breaking floods; Google reported a peak of 398 million requests per second. Providers mitigated at their edges within days. Application-layer DDoS now outsizes most origins, which is why mitigation has to happen at the edge.
📰Real incident — Capital One (2019). A misconfigured web application firewall running on EC2 could be tricked into making requests on the attacker's behalf (SSRF). It fetched its own instance-metadata credentials, which had broad S3 access, and over 100 million records were copied. A security control at the edge became the way in, because of what it was allowed to reach.
🎯On the job. Review WAF logs weekly for the top blocked and top counted rules; counted rules that would have blocked legitimate traffic tell you what to tune before switching to block.
Security angle
- An edge with an open origin is decoration: always check whether the ALB or bucket is reachable directly.
- Start new WAF rules in count mode, review the logs, then switch to block; blocking blind causes outages.
- Rate limits per IP are weak against botnets and residential proxies; combine rate limits keyed on session or API key with fingerprinting and Bot Control.
- AWS Firewall Manager deploys WAF and Shield Advanced across every account in an organisation; see governance.
Network Security Controls — Hybrid Links, Segmentation and Zero Trust
What is this?
How traffic is allowed or blocked inside AWS and between AWS and your other networks: on-prem data centres, other clouds and remote users.
Why it matters
Flat networks turn one compromised host into a compromised estate. Hybrid links are often the forgotten path: a VPN that trusts the whole on-prem range bypasses every cloud control.
How it works
Hybrid connectivity
an IPsec tunnel pair over the internet between your router and AWS. Encrypted, quick to set up, throughput limited per tunnel.
a private physical link from your data centre to AWS. Consistent bandwidth and latency, but not encrypted by default.
either MACsec (IEEE 802.1AE, layer 2 encryption between your router and the AWS device at the Direct Connect location, available on dedicated 10 and 100 Gbps connections) or run an IPsec VPN over Direct Connect.
managed remote-access VPN for people, authenticated with certificates, Active Directory or SAML.
Zero-trust access — AWS Verified Access
Verified Access gives users access to internal applications without a VPN. Every request is evaluated against policy written in Cedar, using signals from an identity trust provider (IAM Identity Center or any OIDC provider) and optionally a device trust provider (device posture from an endpoint management or EDR tool). Access is per application, not per network, so a compromised laptop does not get a route to the whole VPC. Requests are logged for every decision.
Segmentation
traffic (in and out of the internet) is filtered at the edge, by internet-facing load balancers in public subnets, and by egress controls: NAT gateways plus AWS Network Firewall domain allow-lists, or Route 53 Resolver DNS Firewall.
traffic (between workloads) is filtered by security groups that reference other security groups ("the app tier may reach the DB tier on 5432") rather than IP ranges, by separate VPCs or accounts per workload, and by Network Firewall in an inspection VPC behind a transit gateway.
have no route to an internet gateway or NAT; services are reached through VPC endpoints (see endpoint policies).
Finding unintended access
you define an access scope ("nothing in the data subnets may be reachable from an internet gateway") and it reports every path that violates it.
reports which ports on an EC2 instance are reachable from the internet and through which path.
covers the identity side of the same question.
In practiceThe security-group finding every cloud review turns up, and the fix:
$ aws ec2 describe-security-groups --filters Name=ip-permission.cidr,Values=0.0.0.0/0 \
--query "SecurityGroups[].{id:GroupId,name:GroupName,ports:IpPermissions[].FromPort}"
[ { "id": "sg-0a1b", "name": "legacy-admin", "ports": [22, 3389] } ] ← SSH and RDP open to the internet📰Real incident — Ivanti Connect Secure (2024). Two chained vulnerabilities (CVE-2023-46805 and CVE-2024-21887) in a widely used VPN appliance were exploited by a state-linked group before patches existed, and then by many others. US agencies ordered federal networks to disconnect the devices. The VPN that protects the network was the way into it — the core argument for per-application zero-trust access.
🎯On the job. Inventory internet-facing appliances (VPN, firewall, file-transfer) and treat their vulnerabilities as emergency patches; they are among the most exploited initial-access points year after year.
Security angle
- Security groups are stateful and allow-only; NACLs are stateless and support deny. Use NACLs for coarse subnet-level blocks, not as the main control.
- Watch for
0.0.0.0/0on admin ports, VPC peering that makes two environments one network, and transit gateway route tables that connect everything to everything. - Direct Connect is private, not secret: anyone on the path at the colocation facility sees cleartext unless you use MACsec or IPsec.
Compute Security — Images, Patching, Access and Scanning
What is this?
Keeping EC2 instances, containers and Lambda functions secure from build to run: start from a hardened image, patch continuously, give admins access without open SSH, and scan for known vulnerabilities.
Why it matters
Unpatched, internet-reachable compute is still the most common initial access path. Long-lived SSH keys and bastion hosts are a credential-theft magnet.
How it works
Hardened images — EC2 Image Builder
Image Builder runs a pipeline: start from a base AMI or container image, apply components (install the CloudWatch and SSM agents, apply CIS or STIG hardening), run tests, scan with Inspector, then distribute the image to accounts and regions on a schedule. Teams launch only from approved, recently rebuilt images ("golden AMIs"); an SCP or Config rule can deny instances launched from anything else. See Linux hardening for what the hardening itself contains.
Patching — Systems Manager Patch Manager
- Patch baselines define which patches are approved, for example "critical security updates auto-approved after 3 days."
- Patch policies (through Quick Setup) apply scanning and installation across an organisation on a schedule.
- Maintenance windows control when patching may reboot instances.
- Compliance results flow to Systems Manager and Security Hub; Inspector re-scans after patching for continuous validation.
- For immutable infrastructure, "patching" means rebuilding the image and replacing instances rather than patching in place.
Admin access without SSH
shell or port forwarding through the SSM agent's outbound connection. No inbound port, no SSH keys, no bastion; access is controlled by IAM and every session can be logged to S3 or CloudWatch and encrypted with KMS.
pushes a one-time SSH public key (valid for 60 seconds) through an IAM-authorised API call. Still SSH, so port 22 must be reachable, or use an EC2 Instance Connect Endpoint to reach private subnets without a bastion.
Session Manager is the usual "most secure, least overhead" exam answer.
Workload identity
Instance profiles, ECS task roles, Lambda execution roles and EKS IRSA or Pod Identity give each workload its own temporary credentials; see how compute gets credentials.
Vulnerability scanning
scans EC2 instances (with the SSM agent, or agentless from EBS snapshots), container images in ECR (on push and continuously as new CVEs appear), and Lambda functions and their code. Findings carry an Inspector risk score that adjusts CVSS for network reachability.
watches running EC2, ECS and EKS workloads for malicious behaviour (crypto-mining processes, reverse shells); GuardDuty Malware Protection scans EBS volumes and new S3 objects.
Amazon Inspector code security scans GitHub and GitLab repositories (SAST, dependencies and IaC), and Amazon Q Developer reviews code for vulnerabilities, secrets and vulnerable dependencies. CodeGuru Security, still named in the SCS-C03 exam guide, reached end of support on 20 November 2025; its role moved to these two. See SAST, DAST and SCA.
Generative-AI workloads
Treat a model endpoint like any other app plus the OWASP LLM Top 10: Amazon Bedrock Guardrails filter harmful content, block denied topics, redact PII (personally identifiable information) and detect prompt-injection attempts; IAM scopes which models and agents can be invoked; model invocation logging records prompts and responses; and agents get least-privilege tool permissions so a prompt injection cannot become a data breach.
In practiceWhat replacing SSH with Session Manager looks like for an admin, and what it leaves behind:
$ aws ssm start-session --target i-0abc123def
Starting session with SessionId: alice-0f1e2d3c4b
sh-5.2$ sudo systemctl restart nginx
# Later, in the session log bucket (s3://acme-ssm-logs/alice-0f1e2d3c4b.log):
sh-5.2$ sudo systemctl restart nginx ← every command, tied to an IAM identity📰Real incident — MOVEit Transfer (2023, CVE-2023-34362). The Cl0p group exploited a zero-day SQL injection in an internet-facing file-transfer product and stole data from over two thousand organisations, including governments, airlines and payroll providers, before most could patch. One unpatched internet-facing server per victim was enough. Scanning and fast patching of exposed compute is not optional.
🎯On the job. Report patch compliance for internet-facing instances separately from everything else, and alert on any instance launched from an AMI older than your maximum image age.
Security angle
- SSM access is powerful:
ssm:StartSessionon*is effectively root on every managed instance. Scope it by tag and log sessions. - Golden images go stale; enforce a maximum image age.
- Scanning without ownership produces backlog, not security; route findings to the owning team with SLAs (service-level agreements) by severity.
Interview Questions
For S3, use Origin Access Control so CloudFront signs its requests and the bucket policy allows only that distribution. For an ALB, restrict its security group to CloudFront's managed prefix list and have CloudFront add a secret header the ALB requires, so a direct request fails both checks. Without that, WAF and Shield on CloudFront are decoration, because an attacker who finds the origin hostname simply goes around them.
Per-IP rate limits won't help much against rotating residential proxies, so I'd layer controls: the account takeover prevention managed rules to check credentials against known-breached lists, rate-based rules keyed on the username or session rather than the IP, JA3 or JA4 fingerprint matching to spot the attacking client software, and a CAPTCHA or challenge action instead of a hard block for borderline traffic. I'd start in count mode to tune, and pair it with MFA on the application side.
When an internet-facing application's downtime costs more than the subscription and you want help during an attack. It adds tuned detection, automatic application-layer mitigation that writes WAF rules for you, the Shield Response Team with proactive engagement, cost protection against DDoS-driven scaling bills, and WAF included for protected resources. For a small internal app, free Shield Standard plus sensible WAF rules is usually enough.
No, Direct Connect is private but not encrypted by default. If the data needs encryption in transit, use MACsec on a dedicated 10 or 100 gigabit connection for layer 2 encryption to the AWS device, or run an IPsec Site-to-Site VPN over the Direct Connect link. Private doesn't mean confidential: anyone on the path at the colocation facility could otherwise read it.
Through Systems Manager Session Manager: the agent makes an outbound connection, so there's no inbound port, no SSH keys and no bastion, access is decided by IAM, and every session can be logged to S3 or CloudWatch. If SSH is genuinely required, EC2 Instance Connect pushes a 60-second key through an IAM-authorised call, and an Instance Connect Endpoint reaches private subnets. I'd also scope start-session permissions by tag, because SSM access to everything is effectively root everywhere.
Verified Access gives users access to specific internal applications without a VPN, evaluating every request against Cedar policy using identity from an identity provider and optionally device posture from an endpoint tool. A VPN puts the device on the network and then trusts it; Verified Access grants one application at a time and re-checks continuously. So a compromised laptop gets that app, not a route to the whole VPC — the zero-trust model in practice.
Define a Network Access Analyzer access scope saying nothing in the database subnets may be reachable from an internet gateway, and it reports every violating path through route tables, security groups, NACLs, load balancers and peering. Inspector's network reachability findings show the same from the instance side, port by port. I'd run both continuously, because reachability changes with every route-table and security-group edit.
Build golden images with EC2 Image Builder so new instances start patched and hardened, then use Systems Manager Patch Manager with baselines and patch policies to scan and install on a schedule within maintenance windows. Compliance results go to Systems Manager and Security Hub, and Inspector re-scans continuously as new CVEs are published. For immutable workloads I'd skip in-place patching and replace instances from a freshly built image.