Choosing the Right Control Layer for a Threat
This lesson maps threats to the layers where they are best stopped and to the services that implement controls there, since choosing the wrong layer is the most common way to pick an answer that sounds secure but does not meet the requirement.
Learning outcomes
After completing this lesson, you will be able to:
- Identify what each control layer can prevent.
- Match threats to the most suitable layer.
- Explain how preventive, detective and responsive controls work together.
Layers and their controls
Security controls can be applied at several layers. The following table describes what each layer is able to prevent and the services that operate at it.
| Layer | Stops | Services |
|---|---|---|
| Organisation | Whole classes of action in every account | SCPs, RCPs, declarative policies, Control Tower controls |
| Identity | Who can do what | IAM, Identity Center, permissions boundaries, session policies, Cognito, Verified Permissions |
| Edge | Web attacks and DDoS before they reach your VPC | CloudFront, WAF, Shield, Route 53, API Gateway |
| Network | Which hosts and ports can communicate | Security groups, NACLs, Network Firewall, DNS Firewall, endpoints, Verified Access |
| Compute | Exploitation of hosts and containers | Hardened images, IMDSv2, Inspector, patching, Session Manager, GuardDuty Runtime Monitoring |
| Data | Exposure even if other layers fail | KMS, encryption, Object Lock, Macie, backups, masking |
| Detection and response | Attacks that get through | GuardDuty, Security Hub, CloudTrail, Config, Detective, EventBridge automation |
Matching threats to layers
Each threat is best addressed at a particular layer. The following table identifies the most suitable layer for several common threats and the reason for the choice.
| Threat | Best layer | Why |
|---|---|---|
| SQL injection in a web form | Edge (WAF) plus application code | Inspects the HTTP request itself |
| Volumetric DDoS | Edge (Shield, CloudFront) | Absorbs traffic before it reaches your resources |
| A single abusive IP address | Edge (WAF IP set) or network (NACL) | Security groups cannot deny |
| Exfiltration to an attacker's bucket | Identity/organisation (SCP or endpoint policy with aws:ResourceOrgID) | Network controls cannot see bucket ownership |
| Stolen instance credentials | Compute (IMDSv2) and detection (GuardDuty) | Removes the SSRF path and flags use elsewhere |
| Insider deleting backups | Data (Vault Lock, Object Lock) and organisation (separate account) | Survives administrator compromise |
Threats and their best layer
Preventive, detective and responsive together
Strong designs pair a preventive control with a detective one and an automated response, because prevention can be misconfigured or bypassed. For encryption of EBS volumes: enable encryption by default and a proactive CloudFormation hook (prevent), an AWS Config rule (detect), and Config remediation or a notification to the owner (respond). When a question asks for "defence in depth" or "additional assurance", it is usually looking for the missing member of this trio.
Prevent, detect or respond?
One requirement, three layers
Workloads in private subnets must not be able to send data to any destination outside the company's AWS organisation.
The requirement touches three layers, and a complete answer uses all of them:
- Network: no NAT gateway or internet gateway for the subnets; AWS services reached through VPC endpoints.
- Identity: endpoint policies (and an SCP) allowing S3 and other actions only on resources where
aws:ResourceOrgIDis the company's organisation. - Detection: VPC Flow Logs, GuardDuty and Network Access Analyzer to confirm no unexpected egress paths appear.
A network control alone would still allow writes to an attacker's S3 bucket through the S3 endpoint, because the endpoint reaches every bucket by default. That is why the identity layer is essential here.
Which controls can block one IP address?
Show answer
AWS WAF or a network ACL. Security groups cannot deny traffic.
Exam Tips
Remember for the exam
- Stop web exploits at the edge with WAF; stop exfiltration to foreign buckets with aws:ResourceOrgID policies.
- To block one IP address, use WAF or a network ACL, not a security group.
- Pair preventive controls with detective controls and automated responses.
- VPC endpoints do not restrict which buckets can be reached unless their policies do.
- Data-layer controls protect data even when every other layer fails.