Lesson 2 of 2 Approaching Security Specialty Scenarios

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.

LayerStopsServices
OrganisationWhole classes of action in every accountSCPs, RCPs, declarative policies, Control Tower controls
IdentityWho can do whatIAM, Identity Center, permissions boundaries, session policies, Cognito, Verified Permissions
EdgeWeb attacks and DDoS before they reach your VPCCloudFront, WAF, Shield, Route 53, API Gateway
NetworkWhich hosts and ports can communicateSecurity groups, NACLs, Network Firewall, DNS Firewall, endpoints, Verified Access
ComputeExploitation of hosts and containersHardened images, IMDSv2, Inspector, patching, Session Manager, GuardDuty Runtime Monitoring
DataExposure even if other layers failKMS, encryption, Object Lock, Macie, backups, masking
Detection and responseAttacks that get throughGuardDuty, 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.

ThreatBest layerWhy
SQL injection in a web formEdge (WAF) plus application codeInspects the HTTP request itself
Volumetric DDoSEdge (Shield, CloudFront)Absorbs traffic before it reaches your resources
A single abusive IP addressEdge (WAF IP set) or network (NACL)Security groups cannot deny
Exfiltration to an attacker's bucketIdentity/organisation (SCP or endpoint policy with aws:ResourceOrgID)Network controls cannot see bucket ownership
Stolen instance credentialsCompute (IMDSv2) and detection (GuardDuty)Removes the SSRF path and flags use elsewhere
Insider deleting backupsData (Vault Lock, Object Lock) and organisation (separate account)Survives administrator compromise
Match the pairs

Threats and their best layer

Exam skills 3.1.1 · 3.3.1 · 6.1.3

Match each threat with the layer where it is best stopped.

Log in to try this activity Interactive activities are free with an account.

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.

Sort into groups

Prevent, detect or respond?

Exam skills 6.3.1 · 5.2.1

For unencrypted EBS volumes, place each control in the trio.

Log in to try this activity Interactive activities are free with an account.
Worked example

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:

  1. Network: no NAT gateway or internet gateway for the subnets; AWS services reached through VPC endpoints.
  2. Identity: endpoint policies (and an SCP) allowing S3 and other actions only on resources where aws:ResourceOrgID is the company's organisation.
  3. 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.

Check yourself

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.