Govern a multi-account organization, design least-privilege identity, detect and respond to threats, and protect infrastructure and data — at production depth and exam depth.
Use ← → / Space to navigate · I contents · O overview · T theme · F fullscreen
Click any line to jump there · press I to return to this page
The mental model, the multi-account reference architecture, and how the SCS-C03 exam is built.
AWS secures the cloud itself; you secure what you put in it. The line moves with abstraction.
| Layer | EC2 (IaaS) | ECS/EKS on Fargate | Lambda, S3, DynamoDB |
|---|---|---|---|
| Physical, hypervisor, global network | AWS | AWS | AWS |
| Guest OS patching and hardening | You | AWS | AWS |
| Container image and runtime config | You | You | — |
| Network rules (SG, NACL, endpoints) | You | You | You (if in a VPC) |
| IAM: who can call what | You | You | You |
| Data classification and encryption choice | You | You | You |
| Logging, detection, response | You | You | You |
Identity, data, and detection are always yours. Exam answers that hand those to AWS are wrong. Compliance reports for the AWS side come from AWS Artifact.
Every chapter maps its services to these layers. Good designs use all four, not just one.
Exam heuristic: prefer a preventive control when the question says "ensure it can never happen", a detective one for "identify" or "audit", and an automated responsive one for "with the least operational effort".
Based on the AWS Security Reference Architecture (SRA) and the Control Tower landing zone.
Most exam questions reduce to picking the right service for a job, then the right feature of it.
| Question | Primary services |
|---|---|
| Who may do what, where? | IAM, IAM Identity Center, Organizations policies, Access Analyzer, Verified Permissions |
| What happened, and who did it? | CloudTrail (and Lake), CloudWatch Logs, VPC Flow Logs, Security Lake, Athena |
| Is something malicious going on? | GuardDuty, Detective, Security Hub |
| Is something misconfigured or vulnerable? | Config, Security Hub CSPM, Inspector, Trusted Advisor |
| Where is my sensitive data? | Macie, CloudWatch Logs data protection, SNS message data protection |
| How do I block bad traffic? | WAF, Shield, Network Firewall, DNS Firewall, security groups, NACLs |
| How is data protected? | KMS, CloudHSM, ACM, Private CA, Secrets Manager, S3 Object Lock, AWS Backup |
Replaced SCS-C02 on 2 December 2025. 3–5 years of cloud security experience recommended.
| Domain | Weight | Deck |
|---|---|---|
| 1 Detection | 16% | Chapter 4 |
| 2 Incident Response | 14% | Chapter 5 |
| 3 Infrastructure Security | 18% | Chapter 6 |
| 4 Identity and Access Management | 20% | Chapter 3 |
| 5 Data Protection | 18% | Chapter 7 |
| 6 Security Foundations and Governance | 14% | Chapter 2 |
Same six-domain shape, with logging and detection reorganized and newer topics added.
Read a part, do its lab, then answer the self-check out loud without notes.
Navigation: ← → or Space to move, I for Contents, O for overview, T for theme, F for fullscreen. Every Contents line is a link.
Accounts as the isolation boundary, organization-wide guardrails, and proof that the estate stays compliant.
Why the account is the strongest boundary in AWS, and how to structure hundreds of them.
IAM mistakes, quotas, and incidents stop at the account edge; that is why every landing zone starts here.
Exam signal: “isolate”, “limit blast radius”, “separate teams or environments” → separate accounts grouped in OUs, not more IAM policies in one account.
One management account, one root, a tree of OUs, and member accounts that inherit policy from every parent.
us-east-1.| Item | Value |
|---|---|
| Accounts per organization | 10 by default (adjustable; management account requests it) |
| OUs per organization / nesting depth | 2,000 / five levels below the root |
| SCP size / RCP size | 10,240 / 5,120 characters |
| Directly attached per root, OU, account | SCP 10 · RCP 5 (incl. RCPFullAWSAccess) · declarative 10 |
Group accounts by function and control needs, not by org chart; guardrails attach to these OUs.
| OU | Purpose | Typical accounts | Typical guardrails |
|---|---|---|---|
| Security | Security tooling and evidence | Log Archive, Security Tooling (Audit), Forensics | Deny deleting logs; only security team roles |
| Infrastructure | Shared platform services | Network (TGW, egress), Shared Services, DNS | Restrict who can change routing and endpoints |
| Workloads / Prod | Production applications | One account per app or team per environment | Strict region deny, encryption, no IAM users |
| Workloads / Non-prod | Dev, test, staging | Mirrors prod accounts | Same baseline, looser instance types |
| Sandbox | Experiments, no prod data | Per-developer accounts | Budget limits, no connectivity to corp network |
| Policy Staging | Test new guardrails | Copies of real account types | Candidate SCPs/RCPs before rollout |
| Suspended | Accounts being closed or quarantined | Compromised or retired accounts | Deny-all SCP except break-glass role |
Attach guardrails to OUs, not to individual accounts: new accounts inherit them automatically and the policy count stays manageable.
Policies don’t restrict the management account, so anything running there is outside your guardrails.
| Service | Delegate to |
|---|---|
| GuardDuty, Security Hub, Inspector, Macie, Detective | Security Tooling |
| IAM Access Analyzer, IAM root access | Security Tooling |
| Firewall Manager | Security Tooling or Network |
| AWS Config aggregator / conformance packs | Security Tooling |
| CloudFormation StackSets, AWS Backup | Infrastructure / Shared Services |
aws organizations enable-aws-service-access --service-principal guardduty.amazonaws.com
aws guardduty enable-organization-admin-account --admin-account-id 222233334444 # from management account
aws organizations list-delegated-administrators # audit who holds what
Each path leaves different access behind; know which role exists and who can reach root.
CreateAccount (or Account Factory) builds the account inside the org.OrganizationAccountAccessRole trusted by the management account.CloseAccount from the management account; 90-day post-closure period.An account can leave the org only if it has the info needed to stand alone (payment method, contact). Block organizations:LeaveOrganization with an SCP.
Most wrong options rely on the management account being governed like everyone else.
OrganizationAccountAccessRole.Guardrails that cap identities, cap resources, and lock service configuration across every account.
Authorization policies cap what IAM allows; management policies configure services and settings.
| Policy | Family | What it controls | Grants? |
|---|---|---|---|
| Service control policy (SCP) | Authorization | Max permissions of IAM users and roles (incl. member root) in member accounts | Never |
| Resource control policy (RCP) | Authorization | Max permissions on resources in member accounts, whoever calls | Never |
| Declarative policy (EC2 policy) | Management | Enforced EC2/VPC/EBS service attributes (e.g. IMDSv2, block public AMIs) | n/a |
| Tag policy | Management | Allowed tag keys, case, and values; optional enforcement | n/a |
| Backup policy | Management | AWS Backup plans deployed to accounts | n/a |
| AI services opt-out | Management | Whether AWS AI services may store/use your content | n/a |
| Chat applications, Security Hub, and newer types | Management | Service-specific settings; check the live list | n/a |
Effective permission = identity/resource policy allow ∩ every SCP ∩ every RCP ∩ permission boundary ∩ session policy. Any explicit deny wins.
An action must be allowed at every level from the root to the account, and denied at none.
FullAWSAccess is attached everywhere by default.NotAction in Allow.NotResource works in Allow and Deny.Principal element in SCPs.Test new SCPs in a Policy Staging OU; use IAM service last-accessed data and CloudTrail AccessDenied events to find impact before attaching to the root.
Most organizations keep FullAWSAccess and add targeted denies; allow lists suit tightly regulated OUs.
FullAWSAccess; add explicit Deny statements.FullAWSAccess with an allow of approved services.{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyOutsideApprovedRegions",
"Effect": "Deny",
"NotAction": ["iam:*", "organizations:*", "sts:*", "support:*", "cloudfront:*", "route53:*", "budgets:*"],
"Resource": "*",
"Condition": {
"StringNotEquals": {"aws:RequestedRegion": ["ap-southeast-1", "ap-northeast-1"]},
"ArnNotLike": {"aws:PrincipalArn": "arn:aws:iam::*:role/BreakGlassAdmin"}
}
}]
}
Each one protects a control that an account administrator could otherwise switch off.
cloudtrail:StopLogging, DeleteTrail, UpdateTrail.guardduty:DeleteDetector, DisassociateFromAdministratorAccount.config:StopConfigurationRecorder, DeleteDeliveryChannel.organizations:LeaveOrganization.OrganizationAccountAccessRole or AWSControlTower*.aws:PrincipalArn.iam:CreateUser / CreateAccessKey (no long-term keys).s3:PutAccountPublicAccessBlock changes.aws:RequestTag + Null.{"Effect": "Deny",
"Action": ["cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "guardduty:DeleteDetector", "config:StopConfigurationRecorder"],
"Resource": "*",
"Condition": {"ArnNotLike": {"aws:PrincipalArn": "arn:aws:iam::*:role/SecurityPlatformAdmin"}}}
RCPs travel with the resource, so they also restrict principals from outside your organization.
RCPFullAWSAccess is attached everywhere and cannot be detached.Deny statements only, Principal must be "*".RCPFullAWSAccess), 5,120 characters.Use an SCP to stop *your* identities doing something; use an RCP to stop *anyone* doing something to *your* resources (e.g. a bucket policy that grants a stranger access).
Pick by who is being restricted and who owns the control.
| Control | Restricts | Set by | Typical use |
|---|---|---|---|
| SCP | Principals in member accounts | Org admins | Region deny, protect security services, block IAM users |
| RCP | Access to resources in member accounts | Org admins | Org-only access to S3/KMS/Secrets, enforce TLS |
| Permission boundary | One IAM user or role | Account admins | Let developers create roles safely |
| Session policy | One assumed-role or federated session | Caller | Scope down a session at assume time |
| Resource-based policy | Access to one resource | Resource owner | Cross-account bucket or key access |
| VPC endpoint policy | Calls through one endpoint | Network owner | Only org buckets via the S3 endpoint |
None of the guardrails grant anything. A request still needs an allow in an identity-based or resource-based policy.
Instead of denying API calls, they set the desired state at the service control plane and keep it there.
| EC2 policy attribute | Values | Effect |
|---|---|---|
vpc_block_public_access | off · block_ingress · block_bidirectional | Stop IGW traffic; control whether exclusions are allowed |
serial_console_access | enabled · disabled | Allow or block EC2 serial console |
image_block_public_access | unblocked · block_new_sharing | Block new public AMI sharing |
allowed_images_settings | enabled · disabled · audit_mode | Only AMIs from approved providers, names, age |
instance_metadata_defaults | http_tokens: required, hop limit, http_tokens_enforced | IMDSv2 by default and enforced on launch |
snapshot_block_public_access | block_all_sharing · block_new_sharing · unblocked | Stop public EBS snapshots |
vpc_encryption_control | unmanaged · attempt_monitor · attempt_enforce | Audit or enforce encryption in transit in VPCs |
The setting applies even to new APIs that would change it; account admins cannot override it.
{
"ec2_attributes": {
"exception_message": {"@@assign": "Blocked by org policy"},
"instance_metadata_defaults": {
"http_tokens": {"@@assign": "required"},
"http_put_response_hop_limit": {"@@assign": "2"},
"http_tokens_enforced": {"@@assign": "enabled"}
},
"snapshot_block_public_access": {
"state": {"@@assign": "block_all_sharing"}},
"image_block_public_access": {
"state": {"@@assign": "block_new_sharing"}}
}
}audit_mode, attempt_monitor).exception_message shows users why the call failed.DisableSnapshotBlockPublicAccess fail for accounts in scope.An SCP blocks specific API calls; a declarative policy fixes the outcome.
ec2:RunInstances unless ec2:MetadataHttpTokens = required.http_tokens_enforced = enabled once.block_new_sharing leaves already-public AMIs or snapshots public.Read the requirement, pick the mechanism, and know why the alternatives fail.
| Scenario | Answer | Why |
|---|---|---|
| No one in any member account may use Regions outside two approved ones | SCP with aws:RequestedRegion deny, NotAction for global services | Caps identities; exempt global services or IAM breaks |
| Buckets must never be readable by principals outside the org, even if a bucket policy allows it | RCP deny when aws:PrincipalOrgID ≠ org (exempt AWS services) | SCPs do not apply to external principals |
| All new instances must use IMDSv2 and admins must not be able to change the default | Declarative EC2 policy: instance_metadata_defaults | Enforces state, covers future APIs |
| Security team in the management account is not blocked by a new SCP | Expected: SCPs never apply to the management account | Move work to member accounts |
| Stop all EBS snapshots being public, including those already shared | snapshot_block_public_access = block_all_sharing | block_new_sharing leaves existing public ones |
Watch for options that assume a guardrail can grant access or reach the wrong principal.
FullAWSAccess without a replacement allow breaks every member account.Only trusted identities, accessing trusted resources, from expected networks.
Each perimeter is a coarse, org-wide deny that sits underneath fine-grained IAM.
| Perimeter | Question | Main policy type | Key condition keys |
|---|---|---|---|
| Identity | Only trusted identities can access my resources? | RCP, resource-based policies | aws:PrincipalOrgID, aws:PrincipalIsAWSService |
| Resource | My identities can access only trusted resources? | SCP, VPC endpoint policies | aws:ResourceOrgID, aws:ResourceAccount |
| Network | Access only from expected networks? | RCP / resource policies (inbound), SCP (outbound) | aws:SourceVpc, aws:SourceVpce, aws:SourceIp, aws:ViaAWSService |
"*".One policy at the root covers every supported resource in every member account.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "EnforceOrgIdentities",
"Effect": "Deny",
"Principal": "*",
"Action": ["s3:*", "sqs:*", "kms:*",
"secretsmanager:*", "sts:AssumeRole"],
"Resource": "*",
"Condition": {
"StringNotEqualsIfExists":
{"aws:PrincipalOrgID": "o-a1b2c3d4e5"},
"BoolIfExists":
{"aws:PrincipalIsAWSService": "false"}
}
}, {
"Sid": "EnforceTLS",
"Effect": "Deny",
"Principal": "*",
"Action": ["s3:*"],
"Resource": "*",
"Condition": {"BoolIfExists": {"aws:SecureTransport": "false"}}
}]
}IfExists keeps anonymous or service calls from being matched wrongly.aws:PrincipalIsAWSService exempts AWS service principals (e.g. CloudTrail writing logs).aws:PrincipalAccount.AccessDenied.These stop exfiltration to outside buckets and use of stolen credentials from the internet.
{"Sid": "EnforceResourcePerimeter",
"Effect": "Deny",
"Action": ["s3:*", "sqs:*", "kms:*"],
"Resource": "*",
"Condition": {
"StringNotEqualsIfExists":
{"aws:ResourceOrgID": "o-a1b2c3d4e5"},
"ForAllValues:StringNotEquals":
{"aws:CalledVia": ["cloudformation.amazonaws.com"]}}}{"Sid": "EnforceNetworkPerimeter",
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"NotIpAddressIfExists":
{"aws:SourceIp": ["203.0.113.0/24"]},
"StringNotEqualsIfExists":
{"aws:SourceVpc": ["vpc-0abc123"]},
"BoolIfExists": {"aws:ViaAWSService": "false"},
"ArnNotLikeIfExists": {"aws:PrincipalArn":
"arn:aws:iam::*:role/aws-service-role/*"}}}Resource perimeters need exceptions for AWS-owned resources your workloads use (e.g. AWS-managed repositories or service buckets). Network perimeters need aws:ViaAWSService so AWS can call onward on your behalf.
Most questions name a leak path; match it to the perimeter that closes it.
| Scenario | Answer | Why |
|---|---|---|
| A developer copies data to a personal S3 bucket in another account | SCP with aws:ResourceOrgID (resource perimeter) | Stops org identities reaching non-org resources |
| Leaked access keys used from a home IP | Network perimeter on aws:SourceIp / aws:SourceVpc | Credentials only work from expected networks |
| Instances in a VPC must only reach org-owned buckets | S3 gateway endpoint policy with aws:ResourceOrgID | Endpoint policy filters every call through it |
A bucket policy mistakenly grants Principal: * | RCP identity perimeter with aws:PrincipalOrgID | Resource-side deny applies to every caller |
| After an RCP rollout, CloudTrail fails to write to the log bucket | Add aws:PrincipalIsAWSService exemption | Service principals are not in your org |
An opinionated landing zone, a control catalog, and an account vending machine on top of Organizations.
Control Tower orchestrates Organizations, CloudTrail, Config, Identity Center, and StackSets into one baseline.
Behavior says how a control works; guidance says how strongly AWS recommends it.
| Behavior | Implemented with | Status values | Acts |
|---|---|---|---|
| Preventive | SCPs, RCPs, declarative policies | Enforced · Not enabled | Blocks the action before it happens |
| Detective | AWS Config rules (incl. Security Hub CSPM controls) | Clear · In violation · Not enabled | Flags noncompliant resources after the fact |
| Proactive | CloudFormation hooks | PASS · FAIL · SKIP | Rejects noncompliant resources at CloudFormation deploy time |
EnableControl API).Every new account should arrive already enrolled, baselined, and guarded.
| Option | How it works | Use when |
|---|---|---|
| Account Factory (console / Service Catalog) | Provisions an enrolled account into a chosen OU | Low volume, click-ops acceptable |
| Account Factory for Terraform (AFT) | Git repo of account requests → pipeline creates accounts, runs global and per-account Terraform customizations | Terraform shops, GitOps account vending |
| Customizations for Control Tower (CfCT) | CloudFormation templates and SCPs deployed by a pipeline on lifecycle events | CloudFormation shops |
| Account Factory Customization (AFC) | Blueprints (Service Catalog products) applied when vending | Standard per-account stacks from the console |
AWSControlTowerExecution role).Prefer Control Tower features over hand-rolled automation when the question says “least operational overhead”.
| Scenario | Answer | Why |
|---|---|---|
| Block resource creation that violates policy before it exists, for CloudFormation deployments | Proactive control (CloudFormation hook) | Evaluates at provisioning time |
| Alert when an existing bucket allows public reads | Detective control (Config rule) | Detects state after creation |
| Prevent any account in an OU from disabling CloudTrail | Preventive control (SCP) | Blocks the API call |
| Vend accounts from a Git workflow with Terraform baselines | Account Factory for Terraform | Request-as-code pipeline |
| Bring an existing org with 50 accounts under Control Tower | Set up landing zone, register OUs, enroll accounts | Extends baselines and controls |
Remove standing root credentials from member accounts and keep a tested break-glass path.
Root bypasses IAM inside its own account; only SCPs (member accounts) can limit it.
userIdentity.type = Root.Enabled in IAM from the management account (tasks can be delegated to an IAM delegated admin); needs trusted access for IAM.
IAMAuditRootUserCredentialsIAMDeleteRootUserCredentialsIAMCreateRootUserPassword (allow recovery)S3UnlockBucketPolicySQSUnlockQueuePolicy# From the delegated admin for IAM, as a role with sts:AssumeRoot (never as root)
aws sts assume-root --region us-east-1 \
--target-principal 111122223333 \
--task-policy-arn arn=arn:aws:iam::aws:policy/root-task/S3UnlockBucketPolicy \
--duration-seconds 900
# Regional STS endpoint required; restrict with the sts:TaskPolicyArn condition key
Break-glass is for when normal federation or IAM is broken; it must work, be rare, and be loud.
aws:PrincipalArn.sts:AssumeRoot, not stored passwords.These distractors appear often in governance questions.
sts:AssumeRoot cannot be called with root credentials.S3UnlockBucketPolicy.Infrastructure as code, policy checks in the pipeline, tags, central firewall policy, and safe sharing.
One template, deployed as stack instances into many accounts and Regions from an admin account.
| Self-managed permissions | Service-managed permissions | |
|---|---|---|
| Roles | You create AWSCloudFormationStackSetAdministrationRole and ...ExecutionRole | Created by Organizations trusted access |
| Targets | Explicit account IDs | OUs or the whole org |
| New accounts | Add manually | Automatic deployment when an account joins the target OU |
| Delegated admin | n/a | Supported (run from a member account) |
| Typical use | Accounts outside the org | Security baselines for every org account |
Shift checks left into the pipeline, then back them up with proactive and detective controls.
cfn-lint: schema, types, valid properties.cfn-guard rules for CloudFormation.# rules/s3.guard
let buckets = Resources.*[ Type == 'AWS::S3::Bucket' ]
rule s3_encrypted_and_versioned when %buckets !empty {
%buckets.Properties.BucketEncryption exists
%buckets.Properties.VersioningConfiguration.Status == 'Enabled'
}
cfn-guard validate -d template.yaml -r rules/s3.guard
checkov -d ./terraform --framework terraform
trivy config ./terraform --severity HIGH,CRITICALA small mandatory tag set, standardized by tag policies, enforced on create by SCPs.
Environment: prod, staging, dev.CostCenter and Owner for chargeback and contact.DataClassification: public, internal, confidential.Project / Application for grouping.enforced_for blocks noncompliant tagging on listed resource types.ec2:RunInstances when aws:RequestTag/CostCenter is null.{"tags": {"Environment": {
"tag_key": {"@@assign": "Environment"},
"tag_value": {"@@assign": ["prod", "staging", "dev"]},
"enforced_for": {"@@assign": ["ec2:instance", "s3:bucket"]}}}}
Define protection once; Firewall Manager applies it to current and future accounts and resources in scope.
| Type | Applies |
|---|---|
| AWS WAF | Web ACLs on ALB, API Gateway stages, CloudFront |
| Shield Advanced | Protection and automatic L7 mitigation |
| Security group | Common SGs, content audit, usage audit |
| Network Firewall | Firewalls and policies in VPCs |
| Route 53 Resolver DNS Firewall | Rule groups associated to VPCs |
| Network ACL | Required first/last NACL rules |
| Third-party firewalls | Partner NGFW from Marketplace |
Scope by account, OU, Region, resource type, and tags. Auto-remediation makes noncompliant resources compliant; without it Firewall Manager only reports.
Share instead of duplicating, and give teams pre-approved products instead of broad permissions.
ram:RequestedAllowsExternalPrincipals in an SCP.Exam signal: “users must deploy approved resources without having permissions to create them” → Service Catalog with a launch constraint.
Look for the managed, organization-aware option first.
| Scenario | Answer | Why |
|---|---|---|
| Every new account must get the same security IAM roles automatically | Service-managed StackSet with automatic deployment to the OU | Deploys on account join |
| Ensure all ALBs in the org have the same WAF web ACL, including future ones | Firewall Manager WAF policy with auto-remediation | Applies to new resources too |
| One central network team owns the VPC; app accounts deploy into it | VPC sharing via AWS RAM | Participants cannot change network config |
| Pipeline must fail if a Terraform plan creates an unencrypted bucket | Checkov or Trivy scan in CI | Policy as code before deploy |
| Developers launch approved EMR clusters without EMR permissions | Service Catalog product with launch constraint | Role provisions on their behalf |
| Tag values must be standardized and the tag must exist on new instances | Tag policy plus SCP with aws:RequestTag condition | Tag policies do not require presence |
Continuously evaluate resources, remediate drift automatically, and collect audit evidence.
The configuration recorder captures resource state; rules evaluate it; aggregators give the org-wide view.
s3-bucket-public-read-prohibited).Config remediation runs Systems Manager Automation runbooks; EventBridge covers everything else.
aws configservice put-remediation-configurations \
--remediation-configurations '[{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"TargetType": "SSM_DOCUMENT",
"TargetId": "AWS-DisableS3BucketPublicReadWrite",
"Automatic": true,
"MaximumAutomaticAttempts": 3, "RetryAttemptSeconds": 60,
"Parameters": {
"AutomationAssumeRole": {"StaticValue": {"Values":
["arn:aws:iam::111122223333:role/ConfigFix"]}},
"S3BucketName": {"ResourceValue": {"Value": "RESOURCE_ID"}}}}]'CSPM runs automated security checks (backed by Config rules) and aggregates findings across the org.
Know which service answers “prove it to the auditor” and which answers “give me AWS’s own reports”.
| Service | What it gives you | Notes |
|---|---|---|
| AWS Audit Manager | Continuous evidence collection mapped to frameworks (CIS, PCI DSS, HIPAA, SOC 2, GDPR, custom) | Evidence from Config, Security Hub CSPM, CloudTrail, API calls; delegated admin. Maintenance mode: closed to new customers from 30 Apr 2026 |
| AWS Artifact | AWS’s own compliance reports (SOC, ISO, PCI AoC) and agreements (e.g. BAA) | Download on demand; accept agreements for an account or the org |
| AWS Config conformance packs | Continuous compliance against framework-mapped rules | AWS’s recommended alternative to Audit Manager for new customers |
| AWS Well-Architected Tool | Workload review against the six pillars, incl. Security | Lenses, milestones, improvement plans |
| AWS Trusted Advisor | Account checks incl. security (MFA on root, open ports, exposed keys) | Full checks need Business Support+ or higher |
Audit Manager collects evidence about *your* resources; Artifact provides evidence about *AWS’s* controls. “Download the SOC 2 report” → Artifact.
Separate “detect”, “fix”, and “prove” in the question.
| Scenario | Answer | Why |
|---|---|---|
| See noncompliant resources across all accounts and Regions in one place | Config aggregator in the delegated admin account | Org-wide view of rules and inventory |
| Automatically close public access on noncompliant buckets | Config rule with automatic SSM Automation remediation | Native detect-and-fix loop |
| Deploy the same 30 rules plus remediations to every account | Organization conformance pack | One unit, deployed org-wide |
| Enable FSBP in all accounts with different controls for the sandbox OU | Security Hub CSPM central configuration policies | Per-OU configuration from delegated admin |
| Auditor asks for AWS’s PCI DSS Attestation of Compliance | AWS Artifact | AWS-provided report |
| Security Hub CSPM controls show “no data” in a new Region | Enable AWS Config recording there | Controls rely on Config rules |
Most traps confuse detection with prevention or ignore a dependency.
Answer out loud, then check the slide that covers it.
aws:PrincipalIsAWSService?Who can authenticate, what they may do, and how to prove least privilege at scale. Domain 4 · 20% of the exam.
Workforce sign-in with IAM Identity Center, an external IdP, MFA, and AWS Directory Service.
Pick the identity mechanism from who is calling, not from habit. Long-term access keys are the last resort.
| Caller | Recommended mechanism | Credential it ends up with | Avoid |
|---|---|---|---|
| Workforce humans | IAM Identity Center + external IdP (SAML 2.0 + SCIM) | Role session via a permission set (1–12 h) | IAM users with passwords and keys |
| Customers of your app | Amazon Cognito user pool (+ identity pool for AWS calls) | JWTs; optional scoped STS credentials | Creating IAM principals per customer |
| AWS compute | Instance profile, ECS task role, Lambda execution role, EKS Pod Identity / IRSA | Auto-rotated STS credentials | Keys baked into AMIs, images or env vars |
| CI/CD outside AWS | OIDC federation (AssumeRoleWithWebIdentity) | Short session per job | Static keys stored as CI secrets |
| On-premises servers | IAM Roles Anywhere (X.509 certificates) | STS session from a certificate | Long-term IAM user keys |
| Break-glass | Root (centralized root access) or a vaulted emergency role | Short, audited session | Daily use of root |
Exam heuristic: “temporary credentials”, “no long-term keys”, “centrally managed workforce access across accounts” almost always points to IAM Identity Center or STS federation.
One organization instance, one identity source, and permission sets pushed into member accounts as IAM roles.
aws configure sso / aws sso login.Run Identity Center administration from a delegated admin account so the management account is not used day to day. Permission sets that target the management account can only be managed from the management account itself.
Assign (group or user) × (permission set) × (account). Identity Center creates and owns the IAM role.
AWSReservedSSO_<PermissionSet>_<hash> under path /aws-reserved/sso.amazonaws.com/.aws:PrincipalArn + ArnLike on the AWSReservedSSO_* name, because the hash suffix differs per account.Trap: a customer managed policy reference only works if a policy with exactly that name and path exists in each target account. Otherwise provisioning to that account fails.
Identity Center needs the user and group objects to exist before an assignment can apply. SCIM provides them automatically.
NameID / subject must match the provisioned username.AWSReservedSSO_* role; CloudTrail shows the user name as the session name.Without SCIM you must create users and groups in Identity Center manually with matching usernames. Exam answer for “groups in the corporate IdP should automatically control AWS access” is SCIM provisioning plus group-based assignments.
Where MFA is enforced depends on who owns the sign-in.
aws:MultiFactorAuthPresent is only present for credentials obtained with MFA.BoolIfExists in a Deny so long-term access keys (key absent) are also denied.aws:MultiFactorAuthAge limits how long ago MFA happened.{ "Sid": "DenyAllExceptMfaSetupWithoutMfa", "Effect": "Deny",
"NotAction": ["iam:CreateVirtualMFADevice", "iam:EnableMFADevice", "iam:ListMFADevices", "sts:GetSessionToken"],
"Resource": "*",
"Condition": { "BoolIfExists": { "aws:MultiFactorAuthPresent": "false" } } }
The exam tests which one fits connectivity, trust, and feature requirements.
| AWS Managed Microsoft AD | AD Connector | Simple AD | |
|---|---|---|---|
| What it is | Real Microsoft AD domain controllers run by AWS (Standard or Enterprise edition) | Proxy that forwards requests to your on-premises AD; stores nothing | Samba 4–based AD-compatible directory |
| Trusts with on-prem AD | Yes (one-way or two-way forest trusts) | N/A — uses on-prem AD directly | No |
| Works when on-prem is down | Yes | No — needs VPN/Direct Connect to on-prem DCs | Yes |
| MFA | RADIUS-based MFA | RADIUS-based MFA | No |
| Typical use | AD-aware workloads in AWS (RDS SQL Server, FSx for Windows), multi-Region replication (Enterprise) | Sign in to Identity Center, WorkSpaces, console with existing corporate accounts | Small, basic AD needs at low cost |
Scenario cue: “users must sign in with existing on-premises AD credentials and no directory data may be stored in AWS” → AD Connector. “Need AD in AWS that keeps working if the data center link fails” → AWS Managed Microsoft AD with a trust.
Start with CloudTrail sign-in and STS events, then the identity source.
| Symptom | Likely cause | Evidence |
|---|---|---|
| SAML sign-in fails with “invalid assertion” | Clock skew, wrong ACS URL / audience, expired IdP certificate, NameID not matching an Identity Center user | IdP logs; CloudTrail signin.amazonaws.com / Identity Center events |
| User signs in but sees no accounts | No assignment for the user or their group, or the group was not provisioned by SCIM | Identity Center assignments; SCIM sync status in the IdP |
| Assignment shows “provisioning failed” | Customer managed policy or boundary missing in the target account; SCP blocks IAM role creation | Permission set provisioning status |
AssumeRoleWithSAML AccessDenied | Role trust policy does not trust the SAML provider, or SAML:aud condition mismatch | CloudTrail AssumeRoleWithSAML event |
Cognito NotAuthorizedException | Wrong app client / secret, disabled user, unconfirmed account, auth flow not enabled | Cognito user pool logs; CloudTrail |
| AD users cannot log in through AD Connector | Network path or DNS to on-prem DCs broken; service account password changed | Directory health, VPC routes, security groups |
Read the requirement word by word; most wrong answers are almost right.
AWSReservedSSO_* role in an account — Identity Center overwrites or breaks it.aws:MultiFactorAuthPresent is absent, not false, for long-term keys.Practice choosing the least operational overhead option that meets every constraint.
| Scenario | Answer | Why |
|---|---|---|
| 500 employees in Entra ID need role-based access to 40 accounts; leavers must lose access immediately | Identity Center with Entra ID as external IdP, SCIM provisioning, group assignments | Disabling the user in the IdP removes access; no per-account IAM |
| Developers need a read-only role in prod and admin in sandbox | Two permission sets assigned to the same group on different accounts | Assignments are per account |
| Auditors may use the console for 2 hours only | Permission set with 2 h session duration | Session duration is set per permission set |
| Windows workloads on EC2 must join the corporate domain even if the VPN drops | AWS Managed Microsoft AD with a forest trust to on-prem | Domain controllers run in AWS |
| IAM users must use MFA for every API call except enrolling a device | Deny with NotAction + BoolIfExists aws:MultiFactorAuthPresent false | Covers both console and long-term key calls |
Amazon Cognito for end users and Amazon Verified Permissions for fine-grained app authorization.
They are separate services that are often used together.
| User pool | Identity pool (federated identities) | |
|---|---|---|
| Purpose | User directory and OIDC/OAuth 2.0 authorization server | Exchange an identity token for temporary AWS credentials |
| Output | ID token, access token, refresh token (JWTs) | STS credentials for an IAM role |
| Sign-in sources | Local users, social IdPs, SAML and OIDC IdPs, managed login pages | User pool, social IdPs, SAML/OIDC IdPs, developer-authenticated, guest |
| Security features | MFA (SMS, TOTP, email), passkeys, threat protection (adaptive auth, compromised credentials) in the Plus plan | Authenticated vs unauthenticated roles; role mapping by rules or token claims |
| Consumed by | API Gateway Cognito authorizer, ALB authenticate-cognito, your backend | Mobile/web clients calling S3, DynamoDB, IoT directly |
Exam cue: “users must upload directly to their own S3 prefix from a mobile app” → user pool sign-in + identity pool credentials + policy using ${cognito-identity.amazonaws.com:sub} in the resource ARN.
Identity pool roles are assumed with web identity. The conditions are what keep other pools out.
{
"Effect": "Allow",
"Principal": { "Federated": "cognito-identity.amazonaws.com" },
"Action": ["sts:AssumeRoleWithWebIdentity", "sts:TagSession"],
"Condition": {
"StringEquals": {
"cognito-identity.amazonaws.com:aud": "us-east-1:1111aaaa-...-pool-id"
},
"ForAnyValue:StringLike": {
"cognito-identity.amazonaws.com:amr": "authenticated"
}
}
}GetId → GetCredentialsForIdentity; Cognito calls STS for you. Recommended.GetOpenIdToken and then STS itself; off by default — keep it off.cognito:preferred_role from user pool groups), or rules on claims.Trap: a trust policy without the aud condition lets identities from any identity pool assume the role.
IAM authorizes calls to AWS APIs. Verified Permissions authorizes actions inside your app, using the Cedar policy language.
// Cedar: managers may approve expenses under 1000 in their own department
permit (
principal in Role::"manager",
action == Action::"ApproveExpense",
resource
) when {
resource.amount < 1000 &&
resource.department == principal.department
};
forbid (principal, action, resource)
when { resource.status == "locked" };IsAuthorizedWithToken.forbid always overrides permit — same idea as IAM explicit deny.The distractors usually mix up the two Cognito pools or use IAM for app-level permissions.
| Scenario | Answer |
|---|---|
| API must accept only signed-in app users | API Gateway Cognito user pool authorizer (or JWT authorizer) |
| Block sign-ins from leaked passwords | User pool threat protection (Plus plan) |
| Corporate partners sign in to a customer app with their SAML IdP | User pool SAML federation |
| Externalize document sharing rules out of code | Verified Permissions with Cedar policy templates |
STS, role sessions, OIDC federation, EKS workloads, on-premises servers, and presigned URLs.
Every temporary credential in AWS comes from one of these calls.
| API | Who calls it | Duration | Typical use |
|---|---|---|---|
AssumeRole | IAM user or role session | 15 min – role max (1–12 h); 1 h max when chaining | Cross-account access, switching roles |
AssumeRoleWithSAML | Anyone with a SAML assertion | 15 min – role max | Workforce federation without Identity Center |
AssumeRoleWithWebIdentity | Anyone with an OIDC token | 15 min – role max | GitHub Actions, IRSA, Cognito basic flow |
GetSessionToken | IAM user (or root) | 15 min – 36 h (root: max 1 h) | MFA-protected API calls with an IAM user |
GetFederationToken | IAM user (custom broker) | 15 min – 36 h (root: max 1 h) | Legacy identity broker; session policy required to grant |
AssumeRoot | Management or delegated admin account | Up to 15 min | Privileged root tasks in member accounts |
A role’s maximum session duration (1–12 h) does not apply to EC2 instance profile credentials or to sessions AWS services assume for you. Default DurationSeconds is 1 h.
Session attributes travel with every call and show up in CloudTrail.
sts:RoleSessionName.sts:SetSourceIdentity): set once, persists through role chaining; use for “who really did it”.sts:TagSession): become aws:PrincipalTag/*; can be marked transitive for chaining.AWSRevokeOlderSessions.aws:TokenIssueTime is earlier than the revoke time.{ "Effect": "Deny", "Action": "*", "Resource": "*",
"Condition": { "DateLessThan": { "aws:TokenIssueTime": "2026-10-18T09:30:00Z" } } }
Questions often hinge on picking the right role for the right job.
| Service | Role | Used by | Common mistake |
|---|---|---|---|
| EC2 | Instance profile (wraps one role) | Code on the instance via IMDS (use IMDSv2) | Copying credentials off the instance; IMDSv1 SSRF exposure |
| ECS | Task role | Your application containers | Granting app permissions to the execution role |
| ECS | Task execution role | ECS agent: pull images from ECR, fetch secrets, write logs | Missing secretsmanager:GetSecretValue → task fails to start |
| Lambda | Execution role | Function code and Lambda logging | Missing logs:CreateLogStream / PutLogEvents → no logs |
| EKS | Pod Identity association or IRSA role | Pods via their service account | Using the node role for every pod |
| Any service | Service role / service-linked role | The service acting on your behalf | Editing service-linked roles (they are managed by the service) |
iam:PassRole is the permission that lets a human hand a role to a service. Scope it to specific role ARNs and use iam:PassedToService — unrestricted iam:PassRole is a classic privilege-escalation path.
The job gets an OIDC token from GitHub, then calls AssumeRoleWithWebIdentity.
{
"Effect": "Allow",
"Principal": {
"Federated":
"arn:aws:iam::111122223333:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
},
"StringLike": {
"token.actions.githubusercontent.com:sub":
"repo:my-org/payments:ref:refs/heads/main"
}
}
}token.actions.githubusercontent.com.sub to org/repo and branch, tag or environment (repo:org/repo:environment:prod).permissions: id-token: write.Trap: a trust policy that checks only aud lets any GitHub repository in the world assume the role.
Both give each Kubernetes service account its own IAM role. Pod Identity is the newer, simpler default.
| IRSA | EKS Pod Identity | |
|---|---|---|
| Mechanism | Projected service account token → AssumeRoleWithWebIdentity by the SDK | Pod Identity Agent on the node → eks-auth:AssumeRoleForPodIdentity |
| IAM setup | One IAM OIDC provider per cluster; trust policy names the cluster issuer and system:serviceaccount:ns:sa | Trust principal pods.eks.amazonaws.com, actions sts:AssumeRole + sts:TagSession; no OIDC provider |
| Binding | Annotation eks.amazonaws.com/role-arn on the service account | Pod Identity association created through the EKS API |
| Reuse across clusters | Edit the trust policy for every new cluster | Same role, new association; trust policy unchanged |
| ABAC | Limited | Session tags such as eks-cluster-name, kubernetes-namespace, kubernetes-service-account |
| Where it runs | EC2 nodes and Fargate | Linux EC2 nodes only (not Fargate, not Windows) |
| Cross-account | Trust the cluster OIDC provider in the other account | Role must be in the cluster account; chain to other accounts |
In both cases, block pods from using the node role: enforce IMDSv2 with a hop limit of 1 on nodes so containers cannot reach instance credentials.
On-premises or other-cloud workloads present an X.509 certificate instead of storing access keys.
rolesanywhere.amazonaws.com, actions sts:AssumeRole, sts:TagSession, sts:SetSourceIdentity.aws:PrincipalTag/x509Subject/CN.aws:SourceArn = the trust anchor ARN.# ~/.aws/config on the server: the signing helper exchanges the certificate for STS credentials
[profile onprem]
credential_process = aws_signing_helper credential-process \
--certificate /etc/pki/app.pem --private-key /etc/pki/app.key \
--trust-anchor-arn arn:aws:rolesanywhere:us-east-1:111122223333:trust-anchor/TA_ID \
--profile-arn arn:aws:rolesanywhere:us-east-1:111122223333:profile/PROFILE_ID \
--role-arn arn:aws:iam::111122223333:role/onprem-backup
Anyone holding the URL can perform that one operation until it expires.
# Download link valid for 15 minutes
aws s3 presign s3://reports-bucket/2026/q3.pdf --expires-in 900
# Upload: presigned PUT (or POST policy) from the SDK
# generate_presigned_url("put_object", ..., ExpiresIn=300)expires-in is longer.aws:SourceIp, aws:SourceVpce, or s3:signatureAge.For many objects or a whole site, prefer CloudFront signed URLs or signed cookies; presigned URLs are per object and per operation.
These distinctions appear in multiple-response and matching questions.
GetSessionToken cannot call IAM APIs unless MFA was included.sub condition is open to every repo or cluster.aud is open to every identity pool.arn:aws:iam::ACCOUNT:root means “any principal in that account that is allowed by its own policies”.sts:ExternalId.iam:PassRole = privilege escalation.Look for “no long-term credentials” and “least operational overhead”.
| Scenario | Answer | Why |
|---|---|---|
| Jenkins on-prem needs to push to ECR; security bans access keys | IAM Roles Anywhere with the corporate CA as trust anchor | Certificate-based STS credentials |
| Leaked keys found in a public repo were used to start EC2 | Deactivate the keys, revoke sessions of any role assumed, review CloudTrail, then delete | Temporary sessions created from the key survive key deactivation until revoked |
| Ten EKS clusters share one IAM role for a logging agent | EKS Pod Identity associations | No per-cluster trust policy edits |
| Partner SaaS needs read access to your account | Cross-account role with sts:ExternalId condition | Prevents the confused deputy problem |
| Users must download a private file for 10 minutes without AWS accounts | S3 presigned URL with 600 s expiry from a backend role | Time-boxed, per-object access |
How AWS decides allow or deny across every policy type, in one account and across accounts.
Knowing which category a policy belongs to answers most “why is this denied” questions.
| Policy type | Attached to | Grants? | Notes |
|---|---|---|---|
| Identity-based | User, group, role | Yes | Managed (default 10 per user / 20 per role; quota up to 20 / 25) or inline |
| Resource-based | Bucket, key, queue, topic, secret, role trust, Lambda… | Yes | Has a Principal; enables cross-account access |
| Permissions boundary | User or role | No — caps identity-based | Managed policy; used for delegation |
| SCP | Root, OU, account | No — caps principals in member accounts | Not the management account; not service-linked roles |
| RCP | Root, OU, account | No — caps access to resources in member accounts | Applies to external principals too; subset of services |
| Session policy | Passed at AssumeRole* / GetFederationToken | No — caps the session | One inline + up to 10 managed ARNs |
| VPC endpoint policy / ACLs | Endpoint; S3 bucket or object | Endpoint: caps; ACL: grants (legacy) | Disable S3 ACLs with Object Ownership “bucket owner enforced” |
Default is implicit deny. Any explicit deny ends evaluation. Every guardrail that applies must allow.
Deny that matches in any policy type → denied.RCPFullAWSAccess does).Cross-account: the request must be allowed by the caller’s side (identity policy, boundary, session policy, caller’s SCPs) and by the resource side (resource policy, resource owner’s RCPs). Neither side alone is enough.
Implicit deny vs explicit deny matters for troubleshooting: an implicit deny is fixed by adding an allow; an explicit deny must be removed or narrowed.
Within one account, identity-based and resource-based permissions are a union — with exceptions that depend on which principal ARN is named.
| Resource policy names… | Limited by implicit deny in identity policy? | Limited by implicit deny in boundary / session policy? |
|---|---|---|
| IAM user ARN | No | No (boundary) |
| IAM role ARN | No | Yes — boundary or session policy must also allow |
Role session ARN (assumed-role/...) | No | No — granted directly to the session |
Federated user ARN (GetFederationToken session) | No | No |
Account (arn:aws:iam::ACCOUNT:root) | Yes — delegates to IAM: identity policy must allow | Yes |
Explicit denies always win, in every row. KMS keys are the main exception to the union rule: the key policy must allow, see the next slides.
Resource-based policy (caller keeps its identity) vs role assumption (caller becomes a principal of the other account).
sts:AssumeRole on that role ARN.aws:PrincipalOrgID in resource policies.A deputy (a service or a vendor) is tricked into using its access on someone else’s resource.
// Vendor role: require the agreed ExternalId
{ "Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::999988887777:root" },
"Action": "sts:AssumeRole",
"Condition": { "StringEquals": { "sts:ExternalId": "c0ffee-tenant-42" } } }
// AWS service principal writing to your bucket: pin the source
{ "Effect": "Allow",
"Principal": { "Service": "cloudtrail.amazonaws.com" },
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::org-trail-logs/AWSLogs/*",
"Condition": {
"StringEquals": { "aws:SourceAccount": "111122223333" },
"ArnLike": { "aws:SourceArn":
"arn:aws:cloudtrail:*:111122223333:trail/*" } } }ExternalId per customer; you require it in the trust policy.aws:SourceArn, aws:SourceAccount or aws:SourceOrgID.aws:SourceArn is for service principals; aws:PrincipalArn is for IAM principals.Unlike other resources, an IAM policy alone never grants access to a KMS key.
// Default key policy statement: lets IAM policies in this account work
{ "Sid": "EnableIAMUserPermissions", "Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111122223333:root" },
"Action": "kms:*", "Resource": "*" }
// Allow use only through S3 in this Region
{ "Sid": "AllowViaS3", "Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111122223333:role/app" },
"Action": ["kms:Decrypt", "kms:GenerateDataKey"], "Resource": "*",
"Condition": { "StringEquals": {
"kms:ViaService": "s3.us-east-1.amazonaws.com" } } }root statement).Most least-privilege controls are conditions, not actions.
| Operator | Use |
|---|---|
StringEquals / StringLike | Exact or wildcard match |
ArnLike / ArnEquals | Compare ARNs (aws:PrincipalArn, aws:SourceArn) |
IpAddress / NotIpAddress | CIDR checks on aws:SourceIp |
Bool, Null | True/false keys; test key presence |
Date*, Numeric* | Times, ages, counts |
...IfExists | Match also when the key is absent |
ForAnyValue: / ForAllValues: | Multi-valued keys such as aws:TagKeys |
| Key | Typical control |
|---|---|
aws:PrincipalOrgID / aws:ResourceOrgID | Data perimeter: only my org |
aws:SourceVpce / aws:SourceVpc | Only through my VPC endpoints |
aws:SourceIp | Public IP only — not seen via VPC endpoints |
aws:PrincipalTag / aws:ResourceTag / aws:RequestTag | ABAC |
aws:CalledVia, aws:ViaAWSService | Allow only when a service calls on your behalf |
aws:RequestedRegion | Region restriction |
aws:SecureTransport | Require TLS |
These four patterns behave differently from how they read.
NotAction with AllowNotAction mostly in Deny statements (e.g. region guardrails that exempt global services).NotPrincipal with DenyArnNotEquals / ArnNotLike on aws:PrincipalArn instead.ForAllValues on an empty setNull check, or use ForAnyValue for “must include”.IfExists.aws:SourceIp is absent for calls through VPC endpoints and from AWS services.Walk the flow: explicit deny → RCP → SCP → resource → identity/boundary/session.
| Scenario | Answer | Why |
|---|---|---|
| Admin role in a member account cannot launch EC2 in eu-west-3 | An SCP region deny | SCPs cap even full admins in member accounts |
| Role in account A gets AccessDenied reading B’s bucket; bucket policy allows A’s role | Add s3:GetObject to the role’s identity policy in A | Cross-account needs both sides |
| Same as above, but the objects are SSE-KMS with B’s key | Also allow the role in the key policy and its IAM policy for kms:Decrypt | KMS needs its own authorization |
Role assumed with a session policy allowing s3:* cannot write to DynamoDB | Session policy caps the session to S3 | Effective = identity ∩ session |
| Bucket policy must allow only principals of our org | aws:PrincipalOrgID condition | One condition covers every current and future account |
Boundaries, session policies, ABAC, IAM Access Analyzer, and a method for every AccessDenied.
Let teams create their own roles, but only roles that carry your boundary — so they can never exceed it.
{ "Sid": "CreateRolesOnlyWithBoundary", "Effect": "Allow",
"Action": ["iam:CreateRole", "iam:PutRolePermissionsBoundary",
"iam:AttachRolePolicy", "iam:PutRolePolicy"],
"Resource": "arn:aws:iam::111122223333:role/app/*",
"Condition": { "StringEquals": {
"iam:PermissionsBoundary":
"arn:aws:iam::111122223333:policy/AppBoundary" } } },
{ "Sid": "NoBoundaryTampering", "Effect": "Deny",
"Action": ["iam:DeleteRolePermissionsBoundary",
"iam:CreatePolicyVersion", "iam:SetDefaultPolicyVersion"],
"Resource": ["arn:aws:iam::111122223333:role/*",
"arn:aws:iam::111122223333:policy/AppBoundary"] },
{ "Sid": "PassOnlyAppRoles", "Effect": "Allow", "Action": "iam:PassRole",
"Resource": "arn:aws:iam::111122223333:role/app/*" }AppBoundary./app/ scopes what they can create and pass.Pass a policy when assuming a role to get a session that can do less than the role.
# Broker issues tenant-scoped credentials from one shared role
aws sts assume-role \
--role-arn arn:aws:iam::111122223333:role/tenant-data \
--role-session-name tenant-42 \
--policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
"Action":["s3:GetObject","s3:PutObject"],
"Resource":"arn:aws:s3:::tenant-data/tenant-42/*"}]}' \
--duration-seconds 900--policy) and up to 10 managed policy ARNs (--policy-arns).RBAC grows one policy per job per resource set. ABAC writes one policy that compares tags.
| RBAC | ABAC | |
|---|---|---|
| Grant based on | Role or group membership | Matching attributes (tags) on principal and resource |
| New project | New roles and policies | Tag new resources and users; no policy change |
| Policy count | Grows with teams × resources | Small and stable |
| Risk | Over-broad roles over time | Whoever can change tags can change access |
| Best for | Few, stable job functions | Many fast-changing projects or tenants |
{ "Effect": "Allow",
"Action": ["ec2:StartInstances", "ec2:StopInstances"],
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": { "StringEquals": {
"aws:ResourceTag/project":
"${aws:PrincipalTag/project}" } } }Principal tags come from IAM user/role tags, session tags (SAML/OIDC attributes, sts:TagSession), or IAM Identity Center “attributes for access control” mapped from the IdP.
Control who can set tags, require tags at creation, and block tag changes on existing resources.
// Create only with my project tag, and only allowed tag keys
{ "Effect": "Allow", "Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"StringEquals": {
"aws:RequestTag/project": "${aws:PrincipalTag/project}" },
"ForAllValues:StringEquals": {
"aws:TagKeys": ["project", "env", "owner"] } } },
// Nobody but the platform role may change the project tag
{ "Effect": "Deny", "Action": ["ec2:CreateTags", "ec2:DeleteTags"],
"Resource": "*",
"Condition": {
"ForAnyValue:StringEquals": {
"aws:TagKeys": ["project"] },
"ArnNotLike": {
"aws:PrincipalArn": "arn:aws:iam::*:role/platform-admin" } } }aws:RequestTag) and allow the tag action only in the create call.iam:TagRole themselves.aws:ResourceTag in the Service Authorization Reference.A path is part of the ARN, so you can scope permissions to a family of roles or policies.
arn:aws:iam::111122223333:role/team-a/ci/deployer.--path /team-a/ci/); cannot be changed for roles later./aws-reserved/sso.amazonaws.com/.iam:CreateRole only on role/team-a/*.iam:PassRole limited to a path.ArnLike aws:PrincipalArn on role/security/*.aws iam list-roles --path-prefix /team-a/).Logic-based reasoning (automated reasoning) over policies, not sampling of traffic.
| Analyzer | Question it answers | Scope | Notes |
|---|---|---|---|
| External access | Which resources are shared outside my zone of trust (account or org)? | Per Region; create one in every Region you use | No charge. S3, IAM roles, KMS keys, Lambda, SQS, Secrets Manager, SNS, EBS/RDS snapshots, ECR, EFS, DynamoDB |
| Internal access | Which principals inside my org/account can reach these critical resources? | Selected resources (S3, DynamoDB, RDS snapshots…) | Paid per monitored resource |
| Unused access | Which roles, keys, passwords, services and actions are unused? | Account or org; not Region-specific | Paid per IAM role/user analyzed; tracking period is configurable |
Findings can be archived automatically with archive rules (e.g. a trusted partner account), sent to EventBridge and Security Hub, and re-checked on demand with StartResourceScan.
Use the organization as the zone of trust with a delegated administrator account, so cross-account access inside the org is not reported as external.
Validation, custom checks, and policy generation turn least privilege into a pipeline gate.
# 1. Grammar + best practices (no charge)
aws accessanalyzer validate-policy --policy-type IDENTITY_POLICY \
--policy-document file://policy.json
# 2. Custom checks (charged per call)
aws accessanalyzer check-no-new-access --policy-type IDENTITY_POLICY \
--existing-policy-document file://old.json --new-policy-document file://new.json
aws accessanalyzer check-access-not-granted --policy-type IDENTITY_POLICY \
--policy-document file://new.json \
--access '[{"actions":["iam:PassRole","s3:DeleteBucket"]}]'
aws accessanalyzer check-no-public-access --resource-type AWS::S3::Bucket \
--policy-document file://bucket-policy.json
# 3. Generate a policy from CloudTrail activity
aws accessanalyzer start-policy-generation \
--policy-generation-details principalArn=arn:aws:iam::111122223333:role/app \
--cloud-trail-details file://trail.jsoncheck-no-new-access blocks PRs that widen access.check-access-not-granted blocks sensitive actions or resources.Read the error message first: most services now say which policy type denied the request.
...with an explicit deny in a service control policy → find the SCP....because no identity-based policy allows... → add an allow.errorCode, principal ARN, source IP, VPC endpoint, sessionContext.aws sts decode-authorization-message (needs sts:DecodeAuthorizationMessage).aws sts get-caller-identity: are you who you think you are?User: arn:aws:sts::123456789012:assumed-role/app/i-0abc is not authorized to perform:
secretsmanager:GetSecretValue on resource: arn:aws:secretsmanager:us-east-1:123456789012:secret:db
with an explicit deny in a resource control policy
These appear as “which change is MOST secure with LEAST effort” questions.
ForAllValues on aws:TagKeys passes when no tags are sent.aws:ResourceTag; check the Service Authorization Reference.Prefer managed, scalable controls over hand-maintained lists.
| Scenario | Answer | Why |
|---|---|---|
| Developers must create Lambda roles without being able to escalate privileges | Permissions boundary condition iam:PermissionsBoundary + deny boundary removal + scoped iam:PassRole | Delegation pattern |
| 100 projects; each team may manage only its own EC2 and RDS | ABAC on project tag with tags from the IdP via Identity Center | One policy scales to all projects |
| Find all S3 buckets and KMS keys shared outside the organization | IAM Access Analyzer external access analyzer, org zone of trust, every Region | Continuous, reasoning-based findings |
| Remove permissions a role has not used in 90 days | Unused access analyzer findings or last-accessed data, then policy generation | Evidence-based right-sizing |
Block any policy change that grants iam:* in the CI pipeline | check-access-not-granted in CI | Automated gate before deployment |
Answer out loud, then verify in the docs or a sandbox account.
NotPrincipal with Deny discouraged?Collect the right logs, detect threats across the organization, alert on what matters, and fix monitoring when it goes quiet. Domain 1 · 16%.
What each AWS log records, where it can go, and what it cannot tell you.
Start from the question an investigator will ask, then pick the source that records it.
| Question | Source | Destinations |
|---|---|---|
| Who called which AWS API, from where? | CloudTrail management events | S3, CloudWatch Logs, EventBridge |
| Who read or deleted this S3 object / invoked this Lambda? | CloudTrail data events | S3, CloudWatch Logs |
| Which calls went through my VPC endpoint (incl. denied)? | CloudTrail network activity events | S3, CloudWatch Logs |
| Which IPs and ports talked, accepted or rejected? | VPC / Transit Gateway flow logs | CloudWatch Logs, S3, Firehose |
| Which domains did workloads resolve? | Route 53 Resolver query logs | CloudWatch Logs, S3, Firehose |
| Which HTTP requests hit the edge or the app? | CloudFront, ALB, API Gateway, WAF logs | Per service (next slides) |
| What did the OS or application do? | CloudWatch agent / app logs | CloudWatch Logs |
No single log is enough. API activity (CloudTrail), network activity (flow and DNS logs), and request activity (edge and app logs) together let you reconstruct an incident.
Management events are on by default in Event history; everything else must be selected on a trail or event data store.
| Type | Records | Default | Notes |
|---|---|---|---|
| Management events | Control-plane calls: CreateUser, RunInstances, PutBucketPolicy, console sign-in | Event history: 90 days, free | Create a trail to keep them longer; first copy of management events per Region is free |
| Data events | Data-plane calls: S3 GetObject/PutObject, Lambda Invoke, DynamoDB items, and more | Off | High volume and charged; scope with advanced event selectors |
| Network activity events | API calls made through a VPC endpoint, including calls denied by the endpoint policy | Off (opt-in) | Shows who tried to use your endpoint; supports a growing list of services such as EC2, KMS, S3, Secrets Manager |
| Insights events | Unusual API call rate or error rate compared with a learned baseline | Off | Management events and, since Nov 2025, data events; extra charge |
A read-only Describe* storm is a management event. An attacker downloading a bucket is a data event — invisible unless data events are on.
One trail, created centrally, logs every account in the organization — and member accounts cannot turn it off.
AWSLogs/o-xxxx/<account-id>/ in the bucket.aws cloudtrail create-trail \
--name org-trail \
--s3-bucket-name org-trail-logs \
--is-organization-trail \
--is-multi-region-trail \
--enable-log-file-validation \
--kms-key-id alias/org-trail
aws cloudtrail start-logging \
--name org-trailProtect the trail with an SCP that denies cloudtrail:StopLogging, DeleteTrail and UpdateTrail for everyone except a break-glass role.
Advanced event selectors filter by event category, resource type, ARN prefix, read/write and event name.
[
{
"Name": "Write data events on the payments bucket",
"FieldSelectors": [
{ "Field": "eventCategory", "Equals": ["Data"] },
{ "Field": "resources.type", "Equals": ["AWS::S3::Object"] },
{ "Field": "readOnly", "Equals": ["false"] },
{ "Field": "resources.ARN",
"StartsWith": ["arn:aws:s3:::payments-prod/"] }
]
},
{
"Name": "All management events",
"FieldSelectors": [
{ "Field": "eventCategory", "Equals": ["Management"] }
]
}
]userIdentity.arn NotStartsWith a backup role.aws cloudtrail put-event-selectors --advanced-event-selectors file://sel.json.Know how CloudTrail proves its logs were not changed, how fast it delivers, and where Lake stands today.
aws cloudtrail validate-logs --trail-arn ... --start-time ... detects modified, deleted or missing files.The unified CloudWatch agent ships files and metrics; configuration usually lives in Parameter Store.
{
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{ "file_path": "/var/log/secure",
"log_group_name": "/ec2/linux/secure",
"log_stream_name": "{instance_id}",
"retention_in_days": 365 },
{ "file_path": "/var/log/nginx/access.log",
"log_group_name": "/app/nginx/access",
"log_stream_name": "{instance_id}" }
]
}
}
}
}CloudWatchAgentServerPolicy (and SSM access to read the config).amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c ssm:AmazonCloudWatch-linux -s.logs endpoint: NAT or an interface VPC endpoint.Copying logs, streaming logs and viewing logs are different features with different trade-offs.
| Option | How it works | Use when | Watch out |
|---|---|---|---|
| Subscription filter → destination | Log group streams matching events to a cross-account destination (Kinesis Data Streams, Firehose or Lambda) | Real-time feed into a SIEM or a central S3 bucket | Max 2 subscription filters per log group; destination policy must allow source accounts |
| Log centralization rules (Sep 2025) | Organizations-aware rules copy log groups from many accounts and Regions into one account | A central copy for search and retention | Only new events after the rule is created; adds @aws.account and @aws.region |
| Cross-account observability (OAM) | Monitoring account links to source accounts with a sink and links | One console to search logs, metrics and traces | Data is viewed, not copied; within one Region |
| Export to S3 | CreateExportTask batch copy | Occasional archive | Not real time; one active export task per account |
Metadata about IP traffic on ENIs, subnets or VPCs — not packet contents.
# version account-id interface-id srcaddr dstaddr srcport dstport protocol packets bytes start end action log-status
2 111122223333 eni-0a1b2c 203.0.113.12 10.0.1.25 51544 22 6 10 840 1728000000 1728000060 REJECT OK
2 111122223333 eni-0a1b2c 10.0.1.25 198.51.100.7 44321 443 6 220 182400 1728000000 1728000060 ACCEPT OKvpc-id, subnet-id, instance-id — context without joins.pkt-srcaddr / pkt-dstaddr — real IPs behind NAT gateways and load balancers.tcp-flags, flow-direction, traffic-path — direction and egress path.ACCEPT; a REJECT comes from a SG or NACL.delivery.logs.amazonaws.com. To CloudWatch Logs: an IAM role.Choose network log sources from the design: hub-and-spoke traffic and DNS are blind spots for ENI flow logs alone.
Threat → source: data exfiltration over HTTPS → flow logs + pkt-dstaddr; DNS tunnelling → Resolver query logs; lateral movement between VPCs → Transit Gateway flow logs.
Each service has its own logging switch, destination and permission model.
| Service | Log | Destination | Gotcha |
|---|---|---|---|
| ALB | Access logs, connection logs (mTLS) | S3 | Bucket must use SSE-S3, not SSE-KMS; bucket policy grants ELB log delivery |
| NLB | Access logs for TLS listeners only | S3 | Plain TCP/UDP listeners produce no access logs |
| CloudFront | Standard logs (v2), real-time logs | Standard: S3, CloudWatch Logs, Firehose · real-time: Kinesis Data Streams | Legacy S3 logging needs ACLs enabled on the bucket |
| API Gateway | Execution logs (REST), access logs | CloudWatch Logs (access logs can also go to Firehose) | REST needs an account-level CloudWatch role per Region; HTTP APIs have access logs only |
| AWS WAF | Full request logs with matched rules | CloudWatch Logs, S3, Firehose | Destination name must start with aws-waf-logs-; redact fields if needed |
| S3 | Server access logs | S3 (another bucket) | Best effort, delayed; use CloudTrail data events when completeness matters |
| Lambda | Function logs | CloudWatch Logs | Execution role needs logs:CreateLogStream and logs:PutLogEvents |
These distinctions decide many Detection questions.
aws-waf-logs- prefix.Read the requirement words, then map them to the feature.
| Scenario | Answer | Why |
|---|---|---|
| Prove nobody edited CloudTrail logs after delivery | Log file integrity validation + validate-logs | Signed, chained digest files detect changes |
| Find who deleted objects from a bucket last night | CloudTrail data events for S3 (write) | Management events do not include DeleteObject |
| Detect an EC2 instance resolving known mining-pool domains | Route 53 Resolver query logs / DNS Firewall, GuardDuty | Flow logs do not see DNS names |
| See requests denied by a VPC endpoint policy | CloudTrail network activity events | Records calls through the endpoint, including denials |
| Every new account must be logged with no member opt-out | Organization trail | Applies to new accounts; members cannot modify it |
| Find the real client IP behind a NAT gateway in flow logs | Custom format with pkt-srcaddr / pkt-dstaddr | Default srcaddr shows the NAT ENI |
Store logs where attackers cannot reach them, normalize them, and query them fast.
Workload accounts produce logs; a Log Archive account keeps them; a security tooling account analyzes them.
Control Tower creates the Log Archive and Audit accounts for you. Deny s3:DeleteObject, s3:PutBucketPolicy and s3:PutLifecycleConfiguration on log buckets with an SCP or RCP except for a break-glass role.
A security data lake in your own account that normalizes AWS and third-party logs to OCSF.
Why OCSF matters: one schema for all sources means one detection query works across CloudTrail, flow logs and a partner firewall. The new Security Hub also uses OCSF.
Serverless SQL over the archive; partition projection avoids loading partitions by hand.
-- Table created from the CloudTrail console ("Create Athena table")
-- or with partition projection on account, region and date.
SELECT eventtime, useridentity.arn, eventname,
sourceipaddress, errorcode
FROM cloudtrail_logs
WHERE eventsource = 'iam.amazonaws.com'
AND eventname IN ('CreateAccessKey', 'CreateUser',
'AttachUserPolicy', 'PutUserPolicy')
AND timestamp >= '2026/10/01'
ORDER BY eventtime DESC
LIMIT 50;kms:Decrypt on the trail key and S3 read on the bucket.Purpose-built query language over log groups, including across accounts with cross-account observability.
fields @timestamp, eventName, userIdentity.arn, sourceIPAddress
| filter errorCode like /AccessDenied|UnauthorizedOperation/
| stats count(*) as denied by userIdentity.arn, eventName
| sort denied desc
| limit 20fields @timestamp, srcAddr, dstAddr, dstPort, action
| filter action = "REJECT" and dstPort in [22, 3389]
| stats count(*) as attempts by srcAddr
| sort attempts desc
| limit 20Left: CloudTrail log group — who is hitting AccessDenied. Right: VPC flow logs — SSH/RDP scanners. Queries are billed per GB scanned, so narrow the time range; save queries and add results to dashboards.
Match the tool to latency, volume and who needs the answer.
| Tool | Best for | Notes |
|---|---|---|
| CloudWatch Logs Insights | Interactive search of recent logs in log groups | No setup; pay per GB scanned |
| Amazon Athena | SQL over S3 archives (CloudTrail, flow logs, Security Lake) | Long retention at low cost; pay per data scanned |
| Amazon OpenSearch Service | Full-text search, correlation dashboards, SIEM-style alerting | Ingest via Firehose or OpenSearch Ingestion; Security Analytics plugin |
| Amazon Managed Grafana | Dashboards across CloudWatch, Athena, OpenSearch, Prometheus | Users via IAM Identity Center; no data store of its own |
| AWS Lambda | Parse, enrich, normalize or route events | Triggered by subscription filters, S3 events, Firehose transforms |
| Security Lake + subscribers | Normalized OCSF data for many tools | Third-party SIEMs read it directly |
The best answer usually centralizes, protects, and minimizes operational overhead.
| Requirement | Answer |
|---|---|
| Normalize AWS and partner logs, least effort | Security Lake (OCSF) |
| Ad hoc SQL over 2 years of CloudTrail in S3 | Athena with partition projection |
| Stream all app logs to a SIEM account in real time | Subscription filter → cross-account Firehose |
| Logs must be immutable for 7 years | S3 Object Lock (compliance mode) in Log Archive |
| Correlate findings on dashboards for the SOC | OpenSearch or Managed Grafana |
GuardDuty, Inspector, Macie and Detective: what each one finds and how it finds it.
A managed threat detection service: threat intelligence, anomaly detection and ML over AWS-native data.
ThreatPurpose:ResourceType/ThreatFamily.Mechanism!ArtifactUnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWSCryptoCurrency:EC2/BitcoinTool.B!DNSRecon:EC2/PortProbeUnprotectedPortseverity field.GuardDuty is Regional. Enable it in every Region, including ones you do not use — attackers like unused Regions.
Optional plans extend detection to more data. New accounts get all except Runtime Monitoring in the 30-day trial.
| Plan | Data analyzed | Detects |
|---|---|---|
| S3 Protection | CloudTrail S3 data events | Exfiltration, destruction, suspicious access patterns |
| EKS Protection | EKS audit logs | Anonymous access, privileged pods, suspicious API calls |
| Runtime Monitoring | OS-level events via a security agent on EKS, EC2, ECS (incl. Fargate) | Reverse shells, crypto miners, privilege escalation, file tampering |
| Malware Protection for EC2 / S3 / AWS Backup | EBS volume scans · new S3 objects · EBS snapshots, AMIs, recovery points | Malware; EC2 scans triggered by findings or on demand |
| RDS Protection | RDS / Aurora login activity | Brute force and anomalous logins |
| Lambda Protection | Lambda network activity logs | Crypto mining, contact with malicious hosts |
| AI Protection | CloudTrail data events for Bedrock, Bedrock AgentCore, SageMaker AI | Anomalous model invocations, cost harvesting |
Correlates many weak signals across sources, resources and time into one critical attack sequence finding.
AttackSequence:IAM/CompromisedCredentialsAttackSequence:S3/CompromisedDataAttackSequence:EKS/CompromisedClusterAttackSequence:EC2/CompromisedInstanceGroup (Dec 2025)AttackSequence:ECS/CompromisedCluster (Dec 2025)Delegate administration, auto-enable everywhere, tune noise, and export findings for retention.
Continuous scanning for software vulnerabilities and unintended network exposure.
| Scan type | What it scans | How |
|---|---|---|
| EC2 scanning | OS and application packages on instances | SSM agent-based, or agentless via EBS snapshots (hybrid mode) |
| ECR scanning | Container images | Enhanced scanning on push and continuously when new CVEs appear |
| Lambda standard scanning | Function and layer dependencies | Automatic when functions are created or updated |
| Lambda code scanning | Custom function code | Injection flaws, hard-coded secrets, weak crypto |
| Code security | Source repositories and IaC | SAST, SCA and IaC scanning integrated with GitHub and GitLab Self Managed |
| Network reachability | Paths from the internet to EC2 ports | Analyzes VPC config without sending traffic |
| CIS scans | EC2 OS configuration | CIS benchmark assessments on demand or scheduled |
Inspector risk score adjusts CVSS with network reachability and exploitability. Export SBOMs to S3 for supply-chain evidence.
Discovers and classifies sensitive data, and flags risky bucket configurations.
Policy:IAMUser/S3BlockPublicAccessDisabled.SensitiveData:S3Object/Personal.kms:Decrypt to read objects encrypted with customer managed keys.Builds a behavior graph so you can answer "what else did this principal or IP do?" quickly.
Many exam distractors swap these services. Learn the one-line job of each.
| Need | Service | Not this |
|---|---|---|
| Active threats: compromised credentials, crypto mining, C2 | GuardDuty | Inspector (vulnerabilities only) |
| CVEs in instances, images, Lambda | Inspector | GuardDuty |
| PII or credentials stored in S3 | Macie | GuardDuty S3 Protection (behavior, not content) |
| Root cause and blast radius of a finding | Detective | Security Hub (aggregates, does not graph) |
| Resource configuration compliance over time | AWS Config (+ Security Hub CSPM controls) | CloudTrail (who changed it, not current state) |
| Resources shared outside the org / unused access | IAM Access Analyzer | Macie |
| Prioritized exposures across all the above | Security Hub | Any single detector |
Watch for the word that reveals the data source.
| Requirement | Answer |
|---|---|
| Alert when an EC2 role’s credentials are used from outside AWS | GuardDuty (InstanceCredentialExfiltration) |
| Block deploys of images with critical CVEs | Inspector ECR scanning + pipeline gate |
| Find buckets with credit card numbers | Macie discovery job / automated discovery |
| Scan uploaded files for malware before processing | GuardDuty Malware Protection for S3 |
| Show everything an IP did across accounts last month | Detective |
Turn findings and metrics into prioritized, routed, actionable alerts.
In 2025 AWS split the product: the original service became Security Hub CSPM, and a new Security Hub sits on top.
| Security Hub (GA 2 Dec 2025) | Security Hub CSPM | |
|---|---|---|
| Job | Correlate threats, vulnerabilities, misconfigurations and sensitive data into prioritized exposures | Run security controls and standards; aggregate findings |
| Inputs | GuardDuty, Inspector, Macie, Security Hub CSPM, partners | AWS service and partner findings; AWS Config-based controls |
| Format | OCSF | AWS Security Finding Format (ASFF) |
| Highlights | Exposure findings, potential attack path graph, trends, Jira/ServiceNow tickets | Standards (FSBP, CIS, PCI DSS, NIST 800-53), security score, automation rules |
| Multi-account | Delegated administrator, cross-Region aggregation | Delegated administrator, central configuration, cross-Region aggregation |
Exposure example: "EC2 instance is reachable from the internet and has software vulnerabilities" — Inspector + network reachability + CSPM signals combined into one prioritized item.
Central configuration makes the delegated administrator the single place that decides standards and controls.
Security Hub Findings - Imported for every new or updated finding.BatchImportFindings (custom sources) and BatchUpdateFindings (workflow status).Event patterns match on any field; targets run notification and remediation.
{
"source": ["aws.guardduty"],
"detail-type": ["GuardDuty Finding"],
"detail": {
"severity": [{ "numeric": [">=", 7] }]
}
}{
"source": ["aws.signin"],
"detail-type": ["AWS Console Sign In via CloudTrail"],
"detail": {
"userIdentity": { "type": ["Root"] }
}
}AWS API Call via CloudTrail.ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS.Turn log patterns into metrics, alarm on them, and show them on shared dashboards.
# Root account usage (CIS-style filter on the CloudTrail log group)
{ $.userIdentity.type = "Root"
&& $.userIdentity.invokedBy NOT EXISTS
&& $.eventType != "AwsServiceEvent" }
# Unauthorized API calls
{ ($.errorCode = "*UnauthorizedOperation") ||
($.errorCode = "AccessDenied*") }
# Console sign-in without MFA
{ ($.eventName = "ConsoleLogin")
&& ($.additionalEventData.MFAUsed != "Yes") }
aws logs put-metric-filter --log-group-name org-trail \
--filter-name RootUsage --filter-pattern file://root.txt \
--metric-transformations \
metricName=RootUsage,metricNamespace=Security,metricValue=1Security monitoring includes availability: a DDoS or a broken control often shows first as failing health.
HealthCheckStatus in us-east-1.Detect drift from the desired configuration continuously, and fix it automatically.
Most "least operational overhead" answers are a managed rule + EventBridge + a managed target.
| Requirement | Answer |
|---|---|
| Page on-call within minutes of any root sign-in | EventBridge rule on aws.signin → SNS |
| One compliance view for 300 accounts | Config aggregator / Security Hub CSPM delegated admin |
| Auto-fix S3 buckets that lose encryption | Config rule + SSM Automation auto-remediation |
| Rank which issues to fix first across services | Security Hub exposure findings |
| Alert on unusual spikes in API errors | CloudWatch anomaly detection alarm or CloudTrail Insights |
When logs or findings go missing: permissions, keys, scope and Regions.
Most delivery failures are a bucket policy, a key policy, or a trail that is not logging what you think.
{
"Sid": "AWSCloudTrailWrite",
"Effect": "Allow",
"Principal": { "Service": "cloudtrail.amazonaws.com" },
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::org-trail-logs/AWSLogs/*",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control",
"aws:SourceArn": "arn:aws:cloudtrail:us-east-1:<acct>:trail/org"
}
}
}aws cloudtrail get-trail-status: IsLogging, LatestDeliveryError.s3:GetBucketAcl and s3:PutObject for cloudtrail.amazonaws.com (and the org path).kms:GenerateDataKey* with the trail encryption context.logs:PutLogEvents.When logs are encrypted with a customer managed key, the delivering service must be allowed in the key policy.
| Log destination | Principal that needs the key | Typical permissions |
|---|---|---|
| CloudTrail → S3 (SSE-KMS) | cloudtrail.amazonaws.com | kms:GenerateDataKey*, kms:DescribeKey; readers need kms:Decrypt |
| CloudWatch Logs group with KMS | logs.<region>.amazonaws.com | kms:Encrypt*, kms:Decrypt*, kms:GenerateDataKey* with log group ARN context |
| VPC Flow Logs → S3 (SSE-KMS) | delivery.logs.amazonaws.com | kms:GenerateDataKey*, kms:Encrypt, kms:Decrypt |
| SNS topic with KMS (EventBridge / CloudWatch publisher) | events.amazonaws.com / cloudwatch.amazonaws.com | kms:GenerateDataKey*, kms:Decrypt |
| GuardDuty findings export | guardduty.amazonaws.com | kms:GenerateDataKey (scoped with aws:SourceArn to the detector) |
| ALB access logs | — not supported | Use SSE-S3 on the bucket |
Analyze the functionality, permissions and configuration of the resource that should be logging.
| Symptom | Likely cause | Fix |
|---|---|---|
| CloudWatch agent running, no logs | Wrong file_path, unreadable file, missing IAM permissions, no route to logs endpoint | Check agent log /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log |
| Lambda logs missing | Execution role lacks CloudWatch Logs permissions | Attach AWSLambdaBasicExecutionRole or equivalent |
| API Gateway REST execution logs missing | No account-level CloudWatch role ARN set for the Region, or stage logging off | Set the role in API Gateway settings; enable stage logging |
| ALB access logs fail | Bucket uses SSE-KMS or policy lacks ELB log delivery | SSE-S3 bucket + correct bucket policy |
| CloudFront logs missing in S3 (legacy) | Bucket has ACLs disabled (BucketOwnerEnforced) | Enable ACLs or use standard logging v2 |
| Health check always failing | SG/NACL blocks checker IPs, wrong path or port | Allow Route 53 health checker ranges; verify target |
A monitoring design is only as strong as the account and Region it forgot.
guardduty:DeleteDetector, config:StopConfigurationRecorder, securityhub:DisableSecurityHub.Read the error first: most answers are a policy statement.
| Scenario | Answer | Why |
|---|---|---|
| New org trail delivers nothing after switching to SSE-KMS | Add CloudTrail to the KMS key policy | Service cannot generate data keys |
| Analysts get AccessDenied querying CloudTrail in Athena | Grant kms:Decrypt on the trail key | S3 read is not enough for SSE-KMS objects |
| No GuardDuty findings from a member account in eu-west-2 | Enable / auto-enable GuardDuty in that Region | GuardDuty is Regional |
| EventBridge rule never triggers SNS email | SNS topic key policy or topic policy missing events.amazonaws.com | Encrypted topics need the publisher in the key policy |
| Agent logs stop after moving instances to a private subnet | Add a logs interface VPC endpoint or NAT | Agent cannot reach CloudWatch Logs |
Answer without notes, then verify against the slides.
Prepare before anything happens, automate the first minutes, follow tested playbooks, and recover with evidence intact. Domain 2 · 14%.
Plans, people, access and tooling that must exist before the first alert.
The classic NIST SP 800-61 Rev. 2 phases map directly to AWS services (Rev. 3, 2025, reframes IR around CSF 2.0). Preparation is the phase you control most.
Cloud changes the response: you can snapshot disks and isolate hosts by API in seconds, but credentials and APIs are now the main attack surface — most cloud incidents start with an identity.
A plan is useless if responders discover at 3 a.m. that they have no access or no one to call.
| Element | Content | AWS-specific detail |
|---|---|---|
| Roles | Incident commander, responders, communications, legal | Who may assume the IR roles; break-glass owners |
| Severity matrix | Impact × urgency → response time and paging | Map GuardDuty / Security Hub severities to your levels |
| Contacts | Internal escalation, AWS Support, external parties | Keep account security contacts current; support plan level |
| Access | How responders get in, read-only vs containment | Pre-provisioned IR roles / Identity Center permission sets in every account |
| Runbooks | Step-by-step per scenario | SSM Automation documents, Step Functions workflows |
| Evidence | What to collect, where to store, who may access | Forensic account, Object Lock bucket, KMS keys |
| Communications | Status updates, regulators, customers | Out-of-band channel in case the main identity provider is compromised |
Codify repeatable steps so they run the same way every time, with approvals where judgment is needed.
description: Isolate a suspicious EC2 instance
schemaVersion: '0.3'
assumeRole: '{{ AutomationAssumeRole }}'
parameters:
InstanceId: { type: String }
IsolationSgId: { type: String }
AutomationAssumeRole: { type: String }
mainSteps:
- name: approve
action: aws:approve
inputs: { Approvers: ['arn:aws:iam::111122223333:role/IR-Lead'] }
- name: isolate
action: aws:executeAwsApi
inputs:
Service: ec2
Api: ModifyInstanceAttribute
InstanceId: '{{ InstanceId }}'
Groups: ['{{ IsolationSgId }}']AWS-DisableS3BucketPublicReadWrite.Provision access and tooling before an incident, and keep evidence away from the compromised environment.
aws/ebs cannot be shared.Preparation includes architecture choices that limit what one compromise can reach.
aws:EC2InstanceSourceVPC / aws:EC2InstanceSourcePrivateIPv4.AWSShieldDRTAccessPolicy) and access to WAF log buckets in advance.An untested plan fails at the worst moment. Test people, process and automation.
aws:ec2:stop-instances, aws:network:disrupt-connectivity, aws:ssm:send-command.Preparation answers are usually "set it up before the incident, centrally, with least privilege".
aws/ebs-encrypted snapshot with the forensic account — not possible.| Requirement | Answer |
|---|---|
| Responders need consistent access to 200 accounts | StackSets-deployed IR roles / Identity Center permission set |
| Validate that failover works within RTO | Resilience Hub assessment + FIS experiment |
| Repeatable, approved containment steps | SSM Automation runbook with aws:approve |
| DDoS help from AWS experts during an attack | Shield Advanced + SRT access + support plan |
| Investigate with reusable queries | SageMaker AI notebook over Athena / Security Lake |
Event-driven containment and remediation in seconds, with humans in the loop where it matters.
Detectors publish findings; EventBridge routes them; workflows contain and notify.
Automate the reversible, high-confidence steps (snapshot, tag, revoke sessions). Keep destructive or business-impacting steps (terminate, delete) behind approval.
Each service fits a different shape of response.
| Mechanism | Best for | Example |
|---|---|---|
| Security Hub CSPM automation rules | Change finding fields on ingest (no code) | Raise severity for prod; suppress known scanner findings |
| AWS Config remediation | Fix a non-compliant resource configuration | Re-enable bucket encryption with an SSM document |
| EventBridge → Lambda | Short, single-purpose actions | Disable an access key; add an IP to a WAF IP set |
| EventBridge → SSM Automation | Multi-step AWS actions with approvals, no custom code | Isolate instance, snapshot volumes |
| EventBridge → Step Functions | Long, branching workflows with retries and waits | Full forensic acquisition across accounts |
| GuardDuty / Shield built-ins | Service-native response | Shield automatic L7 mitigation; Malware Protection scan on finding |
An AWS Solution that turns a finding into isolation plus memory and disk acquisition, analyzed in a forensic account.
Order matters: memory first (volatile), then isolate, then disk. Isolating or stopping first can destroy the evidence you need.
Recovery is part of response: move traffic away from an impaired or compromised location quickly and safely.
Look for "automatically", "least operational overhead" and "without custom code".
* permissions — scope them.| Requirement | Answer |
|---|---|
| Disable an IAM key within a minute of a GuardDuty finding | EventBridge → Lambda UpdateAccessKey |
| Isolate + snapshot + notify, with manager approval | SSM Automation with aws:approve or Step Functions |
| Automatic memory and disk acquisition for EC2 findings | Automated Forensics Orchestrator for EC2 |
| Fix public buckets as soon as Config detects them | Config rule + automatic SSM remediation |
| Shift traffic away from an impaired AZ quickly | ARC zonal shift / autoshift |
Contain and eradicate the common cloud incidents without destroying evidence.
Preserve volatile evidence, contain without terminating, then analyze copies elsewhere.
| Step | Action | How |
|---|---|---|
| 1 Record | Capture instance metadata, tags, ENIs, roles, SGs; tag the instance as under investigation | describe-instances; tag ir:status=quarantine |
| 2 Protect | Enable termination protection; set shutdown behavior to stop | modify-instance-attribute |
| 3 Remove from service | Detach from Auto Scaling group (or set Standby), deregister from target groups | Prevents replacement and traffic |
| 4 Memory | Acquire memory and volatile data before anything else changes | SSM Run Command with a memory capture tool → S3 |
| 5 Isolate | Replace security groups with an isolation group; consider a NACL | See connection tracking next slide |
| 6 Disk | Snapshot all EBS volumes; share to the forensic account | Customer managed KMS key |
| 7 Credentials | Revoke instance-role sessions; check CloudTrail for role use elsewhere | AWSRevokeOlderSessions; GuardDuty exfiltration findings |
Do not stop or terminate first: stopping loses memory and terminating can delete volumes. Do not log in interactively and "look around" — every command changes the evidence.
Changing a security group does not always cut an attacker’s existing session.
0.0.0.0/0 / ::/0 and the opposite direction allows all responses to 0.0.0.0/0 / ::/0 on all ports. ICMP and connections through NAT gateways, NLBs or interface endpoints are always tracked.Exam pattern: "The SG was changed but the attacker is still connected" → existing tracked connection; use a NACL deny to cut it.
Deactivating the key is not enough — temporary credentials minted from it can still be valid.
update-access-key --status Inactive), do not delete it yet — you need it to search logs.GetSessionToken / AssumeRole live on until they expire.AWSRevokeOlderSessions.AWSCompromisedKeyQuarantineV3 and opens a Support case — follow the case.{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"DateLessThan": {
"aws:TokenIssueTime":
"2026-10-18T09:30:00Z"
}
}
}]
}userIdentity.accessKeyId.Stop further exposure, then work out exactly what was read and by whom.
GetObject by anonymous or external principals.PutBucketPolicy in CloudTrail) and by whom?Contain the pod and node without deleting the evidence that Kubernetes would otherwise replace.
# label the pod, then apply a deny-all policy for that label
kubectl label pod web-7d9f -n shop ir/quarantine=true
kubectl apply -f - <<'EOF'
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: { name: quarantine, namespace: shop }
spec:
podSelector: { matchLabels: { ir/quarantine: "true" } }
policyTypes: [Ingress, Egress]
EOF
kubectl cordon ip-10-0-1-25.ec2.internalThen collect and eradicate: capture pod logs, kubectl describe and node memory and disk (as for EC2); review EKS audit logs for the attacker’s API calls; rebuild from a patched image and replace the node. Isolation needs a NetworkPolicy engine, e.g. VPC CNI network policy.
No host to image: the evidence is the code, configuration, role and logs.
put-function-concurrency --reserved-concurrent-executions 0).AWSRevokeOlderSessions) and reduce its permissions.UpdateFunctionCode, UpdateFunctionConfiguration, AddPermission — who changed what.The order of actions is a favourite exam question — and an ordering question type exists.
| Requirement | Answer |
|---|---|
| Invalidate all sessions of a compromised role now | Revoke active sessions (aws:TokenIssueTime deny) |
| Attacker still connected after SG swap | NACL deny on the subnet (tracked connection) |
| Halt a malicious Lambda without deleting it | Reserved concurrency = 0 |
| Know what data left a public bucket | S3 data events / access logs + Macie classification |
| Correct order for EC2 compromise | Record → protect → remove from service → memory → isolate → snapshot |
Validate, scope, find the root cause, keep evidence defensible, and come back clean.
A finding is a hypothesis. Answer these questions, each from a specific source.
| Question | Where to look |
|---|---|
| Is it real or expected activity (scanner, pentest, new deployment)? | Change records, tags, suppression rules, the resource owner |
| Which principal, and how did it get credentials? | CloudTrail userIdentity, AssumeRole chain, Identity Center sign-in |
| Which accounts and Regions are involved? | Org-wide Athena / Security Lake query on the principal or access key |
| What resources did it touch, and what data? | CloudTrail data events, S3 access logs, Macie classification |
| Did it talk to the internet or move laterally? | Flow logs, Resolver query logs, Transit Gateway flow logs |
| Is it still happening? | Live GuardDuty findings, Detective timeline, recent API calls |
| What is the business impact? | Data sensitivity, customer exposure, availability, cost |
Pivot on stable identifiers: access key ID, role session name, source IP, instance ID.
-- Everything a leaked key did, all accounts and Regions
SELECT eventtime, recipientaccountid, awsregion,
eventsource, eventname, sourceipaddress, errorcode
FROM cloudtrail_logs
WHERE useridentity.accesskeyid = 'AKIAEXAMPLE1234567'
OR useridentity.sessioncontext.sessionissuer.arn
LIKE '%role/compromised-app%'
ORDER BY eventtime;AssumeRole events link a source identity to the role session it created.sourceIdentity (if set) persists through role chains.Collect in order of volatility and keep a defensible chain of custody.
Containment stops the bleeding; root cause analysis stops the next incident.
Restore to a known-good state and prove the attacker is gone before declaring recovery.
Forensic integrity and clean recovery are the recurring themes.
| Scenario | Answer | Why |
|---|---|---|
| Evidence must be provably unmodified for legal proceedings | Object Lock compliance mode + hashes + CloudTrail data events on the bucket | Immutable storage and an access trail |
| Find which other resources a compromised role touched | Amazon Detective | Behavior graph across CloudTrail, flow logs, findings |
| Determine when a security group was opened | AWS Config resource timeline + CloudTrail | Config shows the change; CloudTrail shows who |
| Recover from ransomware that deleted backups in the account | Cross-account backup copies / logically air-gapped vault | Backups outside the compromised account survive |
| Assess whether a finding affects other accounts | Org-wide Athena or Security Lake query on the identifier | Scope before deciding severity |
Answer without notes, then verify against the slides.
aws/ebs-encrypted snapshot, and what do you do instead?Domain 3 · 18% — protect the edge, the network, the compute, and the GenAI apps that run on them.
Stop bad traffic before it reaches your VPC: CloudFront, origin lock-down, CORS, and IoT policies.
The exam describes an attack; your job is to name the cheapest control that stops it at the right layer.
| Threat | Layer | First-choice control | Add when needed |
|---|---|---|---|
| Volumetric / SYN / UDP flood | L3–L4 | Shield Standard (automatic, free) + CloudFront / Global Accelerator | Shield Advanced for SRT, cost protection |
| HTTP request flood | L7 | WAF rate-based rule, Anti-DDoS managed rule group | Shield Advanced (SRT, cost protection, Anti-DDoS rule group included) |
| SQLi, XSS, LFI (OWASP Top 10) | L7 | WAF Core rule set + SQL database rule group | Custom rules, labels |
| Scrapers, scalpers, bad bots | L7 | WAF Bot Control, CAPTCHA / Challenge | JA3/JA4 fingerprint rules |
| Credential stuffing / fake sign-ups | L7 | WAF ATP (login) / ACFP (registration) | Cognito advanced security |
| Direct-to-origin bypass | Origin | CloudFront OAC, VPC origins, origin-facing prefix list | Secret custom header |
| Content theft / paywall bypass | App | CloudFront signed URLs or signed cookies | Geo restriction |
Push controls as far out as possible: CloudFront and WAF at the edge absorb traffic in AWS’s global network, so the origin never sees it.
A WAF on CloudFront is useless if attackers can hit the origin directly.
cloudfront.amazonaws.com with AWS:SourceArn = the distribution ARN.com.amazonaws.global.cloudfront.origin-facing in its SG.TLSv1.2_2021.us-east-1.The condition on the distribution ARN prevents other CloudFront distributions (other accounts) from reading your bucket.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "AllowCloudFrontServicePrincipalReadOnly",
"Effect": "Allow",
"Principal": { "Service": "cloudfront.amazonaws.com" },
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::media-bucket/*",
"Condition": {
"StringEquals": { "AWS:SourceArn":
"arn:aws:cloudfront::111122223333:distribution/EDFDV" }
}
}]
}cloudfront.amazonaws.com to kms:Decrypt with the same AWS:SourceArn condition.AWS:SourceArn condition you have a confused deputy: any distribution could read the bucket.CloudFront has several access controls; the exam tests which one fits the scenario.
| Feature | What it does | Pick it when |
|---|---|---|
| Signed URL | Time-limited access to one object; policy can restrict IP range and start/end time | One file per link, or clients that do not support cookies |
| Signed cookies | Same policy, carried in cookies across many objects | Many files (HLS segments, a members area) without changing URLs |
| Trusted key groups | Public keys you upload to CloudFront; managed with IAM | Always; root-account CloudFront key pairs are legacy |
| Geo restriction | Allow list or block list of countries for the whole distribution | Licensing/sanctions; use WAF geo match for per-path rules |
| Field-level encryption | Encrypts specific POST form fields at the edge with your public key | Only one back-end service may read card numbers or PII |
| Response headers policy | Adds HSTS, CSP, X-Frame-Options, X-Content-Type-Options, CORS headers | Browser-side hardening without changing the origin |
CORS is a browser relaxation, not an authorization control. IoT policies are authorization for devices.
Access-Control-Allow-Origin.AllowedOrigins, AllowedMethods, AllowedHeaders, MaxAgeSeconds.* origins with credentials; list exact origins.iot:Connect, Publish, Subscribe, Receive."Resource": "arn:aws:iot:…:topic/devices/${iot:Connection.Thing.ThingName}/*"iot:Connect restricted to client/${iot:Connection.Thing.ThingName}.Layer 7 filtering, bot and fraud controls, and DDoS protection with response support.
Rules run in priority order; the first terminating action wins; otherwise the default action applies.
us-east-1).Labels let one rule tag a request (e.g. awswaf:managed:aws:bot-control:bot:category:…) and a later rule act on that label. This is how you tune managed rules without disabling them: set a rule to Count, then block on its label with a scope-down.
Numbers that show up in design questions.
aws-waf-logs-.Authorization header) and filter which requests to log.Start with baseline groups, add use-case groups, and pay for intelligent threat mitigation only where needed.
| Rule group | Covers | Notes |
|---|---|---|
| Core rule set (CRS) | Broad OWASP Top 10 coverage: XSS, LFI/RFI, size limits, bad user agents | Baseline for almost every web ACL |
| Known bad inputs | Exploit patterns such as Log4j (${jndi:), Java deserialization | Baseline |
| SQL database / Linux / POSIX / Windows / PHP / WordPress | Platform-specific injection and exploit patterns | Add only what matches your stack |
| Amazon IP reputation / Anonymous IP list | Known malicious IPs, botnets; VPNs, Tor, hosting providers | Anonymous IP can block legitimate users behind VPNs |
| Bot Control (Common / Targeted) | Self-identifying bots; targeted adds browser interrogation, fingerprinting, ML | Extra fee; scope down to sensitive paths |
| ATP / ACFP | Account takeover on login; account creation fraud on sign-up | Extra fee; inspects credentials, compares against stolen-credential DB |
Anti-DDoS (AWSManagedRulesAntiDDoSRuleSet) | Baselines traffic, labels suspected DDoS requests, Challenge or Block | Extra fee; 50 WCU; default for Shield Advanced L7 flood protection since 26 Mar 2026 |
Requirements-driven rules: "only Vietnam and Japan", "max 100 logins per IP per 5 minutes", "block this TLS client".
X-Forwarded-For).POST /login.Count first, read the logs, then switch to Block.
{
"Name": "login-rate-limit",
"Priority": 10,
"Action": { "Block": {} },
"Statement": {
"RateBasedStatement": {
"Limit": 100,
"EvaluationWindowSec": 300,
"AggregateKeyType": "IP",
"ScopeDownStatement": {
"ByteMatchStatement": {
"FieldToMatch": { "UriPath": {} },
"PositionalConstraint": "STARTS_WITH",
"SearchString": "/login",
"TextTransformations": [{ "Priority": 0, "Type": "LOWERCASE" }]
}
}
}
},
"VisibilityConfig": { "SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true, "MetricName": "loginRate" }
}Standard is on for everyone. Advanced is a paid service with people and money behind it.
| Shield Standard | Shield Advanced | |
|---|---|---|
| Cost | Free, automatic | US$3,000/month per payer account (covers the org), 1-year commitment, plus data transfer out |
| Protects | L3/L4 for all AWS customers | EC2 EIPs, ELB, CloudFront, Global Accelerator, Route 53 hosted zones |
| Detection | Generic signatures | Per-resource baselines; health-based detection using Route 53 health checks |
| L7 | — | WAF included at no extra fee for protected resources; Anti-DDoS managed rule group included (supersedes legacy automatic L7 mitigation) |
| People | — | Shield Response Team (SRT) 24/7 (requires Business or Enterprise Support); proactive engagement |
| Money | — | Cost protection: credits for scaling charges caused by a DDoS |
| Visibility | Basic | Attack diagnostics, CloudWatch metrics, Firewall Manager to apply org-wide |
Prepare before the attack (Task 2.1.2): associate a web ACL, configure health checks, grant SRT access through an IAM role (AWSShieldDRTAccessPolicy) and the WAF log bucket, and set up proactive engagement contacts.
C03 adds OCSF and third-party integration to the edge domain.
Wrong answers that look right.
us-east-1.us-east-1.Scenario → answer → why.
| Scenario | Answer | Why |
|---|---|---|
| Login page hit by credential stuffing from thousands of rotating IPs | WAF ATP managed group on the login path; optionally JA4 rules | IP rate limits fail when IPs rotate; ATP checks stolen-credential patterns |
| Private S3 media must be served via CloudFront only; objects use SSE-KMS | OAC + bucket policy with AWS:SourceArn + KMS key policy grant | OAI cannot use KMS; both policies are required |
| Paid videos with many segment files per stream | Signed cookies with a trusted key group | One authorization covers many objects |
| Company wants DDoS cost credits and a 24/7 response team | Shield Advanced + Business/Enterprise Support | Only Advanced has SRT and cost protection |
Block traffic from two countries on /admin only | WAF geo match with a URI scope-down | CloudFront geo restriction is all-or-nothing per distribution |
| Apply the same web ACL to every ALB in 40 accounts, including new ones | Firewall Manager WAF policy | Central, auto-remediating, covers new resources |
Security groups, NACLs, Network Firewall, DNS Firewall, and segmentation.
Know the mechanics, not just "stateful vs stateless".
| Security group | Network ACL | |
|---|---|---|
| Attached to | ENI (instance, Lambda in VPC, RDS, endpoint, ALB…) | Subnet (every ENI in it) |
| State | Stateful: return traffic allowed automatically (connection tracking) | Stateless: allow return traffic explicitly (ephemeral ports 1024–65535) |
| Rules | Allow only; all rules evaluated together | Allow and deny; numbered, lowest first, first match wins |
| Default | New SG: no inbound, all outbound | Default NACL allows all; a new custom NACL denies all |
| References | Other SGs (same VPC, peered VPC, or across Transit Gateway when enabled), prefix lists | CIDRs only |
| Quotas (default) | 60 inbound + 60 outbound rules per SG; 5 SGs per ENI (adjustable) | 20 rules per direction (adjustable to 40) |
| Use for | Primary micro-segmentation | Coarse subnet guardrails, explicit deny of an IP range |
Removing a rule does not interrupt an existing tracked flow. This matters during containment.
0.0.0.0/0 (or ::/0) and the other direction allows all response traffic to/from 0.0.0.0/0 on all ports. ICMP is always tracked.A managed stateful firewall and IPS that you insert into the routing path.
0.0.0.0/0 to the TGW; TGW sends it to the inspection VPC.Rule order is the most common source of confusion.
# Suricata rule: drop outbound TLS to a domain not on the allow list is handled by a domain list;
# this example alerts on any TLS SNI ending in .xyz
alert tls $HOME_NET any -> $EXTERNAL_NET 443 (tls.sni; content:".xyz"; endswith; msg:"TLS to .xyz"; sid:1000001; rev:1;)
Block exfiltration and malware callbacks at the DNS layer, for every VPC that uses the Resolver.
* with lower priority.Design so that one compromised workload cannot reach everything.
aws:SourceVpce for a data perimeter.VPC endpoints, PrivateLink, zero-trust access, VPN, Direct Connect, and finding unwanted paths.
Both keep traffic off the internet; they work very differently.
| Gateway endpoint | Interface endpoint (PrivateLink) | |
|---|---|---|
| Services | S3 and DynamoDB only | Most AWS services, your own services, SaaS |
| Mechanism | Prefix-list route in the route table | ENI with private IPs in your subnets; private DNS |
| Access from on-prem / peered VPC | No | Yes (via VPN, DX, TGW, peering) |
| Security controls | Endpoint policy; bucket policy aws:SourceVpce | Endpoint policy + security group on the ENI |
| Cost | Free | Per hour per AZ + per GB |
| Cross-Region | Same Region only | Same Region (cross-Region PrivateLink for some services) |
With endpoints, the request source is a private IP, so aws:SourceIp no longer matches. Use aws:SourceVpce, aws:SourceVpc or aws:VpcSourceIp in resource policies.
The endpoint policy limits what can pass through the endpoint; the bucket policy limits where requests can come from.
{
"Statement": [{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:PrincipalOrgID": "o-a1b2c3d4e5",
"aws:ResourceOrgID": "o-a1b2c3d4e5"
}
}
}]
}{
"Statement": [{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": ["arn:aws:s3:::pii-bucket",
"arn:aws:s3:::pii-bucket/*"],
"Condition": {
"StringNotEquals": {
"aws:SourceVpce": "vpce-0a1b2c3d4e5f67890"
}
}
}]
}Left: endpoint policy (only org principals, only org buckets). Right: bucket policy (deny unless via our endpoint). Endpoint policies never grant: IAM and resource policies must still allow (default endpoint policy = full access). Together they block exfiltration to an attacker’s bucket. The bucket deny also locks out the console and AWS services, so add exceptions such as aws:PrincipalIsAWSService with care.
Three ways to give someone or something private access — with different trust models.
Direct Connect is private, not encrypted. Decide how to encrypt it.
should_encrypt (default) vs must_encrypt.Prove what can reach what — without sending a packet.
| Tool | Question it answers | Example |
|---|---|---|
| Network Access Analyzer | Which paths match a scope I define as unwanted? | "Any path from an IGW to a resource tagged tier=db" → findings |
| VPC Reachability Analyzer | Can source A reach destination B, and which component blocks it? | Debug: why can the ECS task not reach RDS on 5432? |
| Inspector network reachability | Which EC2 ports are reachable from the internet / outside the VPC? | Finding: port 22 open via IGW → SG → ENI |
| IAM Access Analyzer (external access) | Which resource policies grant access outside my zone of trust? | S3 bucket shared to an unknown account |
| Verified Access logs | Who accessed which internal app, with which device posture? | Audit contractor access |
Network Access Analyzer is the tool for continuous compliance ("no database is ever internet-reachable"); Reachability Analyzer is the tool for one-off troubleshooting.
Wrong answers that look right.
aws:SourceIp does not match private IPs through endpoints.Scenario → answer → why.
| Scenario | Answer | Why |
|---|---|---|
| Allow egress only to a list of SaaS domains from 30 VPCs | Central inspection VPC + Network Firewall stateful domain list (strict order, default drop) | Domain-aware egress filtering, managed once |
| Instances must never resolve known malware domains | Route 53 Resolver DNS Firewall with AWS managed domain lists | Blocks at lookup, no routing change |
| Contractors need SSH to 5 private hosts, with device posture checks, no VPN | Verified Access (TCP/SSH) with identity + device trust providers | Per-connection zero-trust evaluation |
| DX must be encrypted at 100 Gbps line rate | Dedicated 100 Gbps DX with MACsec | IPsec VPN tunnels cannot reach that throughput |
| Continuously prove no RDS instance is reachable from an IGW | Network Access Analyzer scope | Path analysis against a defined scope |
| Stop an active attacker session on one EC2 instance right now | Quarantine subnet / NACL deny (then SG isolation) | SG changes do not cut tracked connections |
Hardened images, roles for workloads, vulnerability management, patching, and access without SSH keys.
Build security in once, then deploy only approved images.
Enforce "only approved AMIs" with the EC2 Allowed AMIs setting (also available as a declarative policy) and with IAM conditions on ec2:RunInstances.
IMDSv1 can be abused through SSRF to steal role credentials. IMDSv2 requires a session token obtained with PUT.
# IMDSv2: get a token, then use it
TOKEN=$(curl -sX PUT http://169.254.169.254/latest/api/token \
-H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" \
http://169.254.169.254/latest/meta-data/iam/security-credentials/
# Enforce on an existing instance
aws ec2 modify-instance-metadata-options --instance-id i-0abc \
--http-tokens required --http-put-response-hop-limit 1
# Account default for new instances in a Region
aws ec2 modify-instance-metadata-defaults --http-tokens requiredHttpTokens=required.ImdsSupport=v2.0 so launches default to v2.ec2:RunInstances unless ec2:MetadataHttpTokens = required.MetadataNoToken.Every compute type gets credentials from a role; know which role is which.
| Role type | Who assumes it | Example | Watch out for |
|---|---|---|---|
| Instance profile role | EC2 (credentials via IMDS) | App on EC2 reads an S3 bucket | One role per instance; all processes share it |
| Lambda execution role | Lambda service for your function | Function writes to DynamoDB and CloudWatch Logs | Missing logs:* → no logs at all |
| ECS task execution role | ECS agent | Pull from ECR, send logs, fetch secrets for env vars | Not used by your application code |
| ECS task role | Your container | App calls SQS | The role your code should use |
| EKS Pod Identity / IRSA | A Kubernetes service account | Pod reads Secrets Manager | Block IMDS so pods cannot use the node role |
| Service role | An AWS service acting for you | CodeBuild, Config, Step Functions | Trust policy + aws:SourceArn against confused deputy |
| Service-linked role | A service, with AWS-defined permissions | AWSServiceRoleForECS | Not restricted by SCPs; you cannot edit permissions |
Inspector finds what is vulnerable; GuardDuty finds what is being attacked or misbehaving at runtime.
Automate patching and prove compliance continuously.
Patch Group tag + maintenance windows.AWS-RunPatchBaseline with operation Scan or Install.No bastions, no long-lived SSH keys, every session logged.
AmazonSSMManagedInstanceCore) or Default Host Management Configuration, and reach to SSM endpoints (VPC endpoints for private subnets).ssm:StartSession, tag conditions).Shift left: scan code, dependencies, IaC and images in the pipeline.
OWASP Top 10 for LLM Applications and the AWS guardrails that address them.
C03 adds GenAI guardrails. Map each risk to a control.
| ID | Risk | AWS-side controls |
|---|---|---|
| LLM01 | Prompt injection (direct and indirect) | Bedrock Guardrails prompt-attack filter; treat retrieved content as untrusted |
| LLM02 | Sensitive information disclosure | Guardrails sensitive information filters (mask/block PII); Macie on training data |
| LLM03 / LLM04 | Supply chain; data and model poisoning | Trusted model sources, signed artifacts, versioned and access-controlled training data |
| LLM05 | Improper output handling | Validate and encode model output before using it in SQL, shell, HTML |
| LLM06 | Excessive agency | Least-privilege IAM for agent tools; human confirmation for actions |
| LLM07 / LLM08 | System prompt leakage; vector and embedding weaknesses | No secrets in prompts; per-tenant access control on knowledge bases |
| LLM09 / LLM10 | Misinformation; unbounded consumption | Contextual grounding checks; quotas, WAF rate limits, token limits |
Guardrails evaluate both the user input and the model output.
ApplyGuardrail API checks text for any model, even outside Bedrock.bedrock:GuardrailIdentifier.Scenario → answer → why, plus the traps.
| Scenario | Answer | Why |
|---|---|---|
| SSRF in a web app stole EC2 role credentials | Require IMDSv2 (hop limit 1), enforce with SCP/declarative policy | IMDSv2 needs a PUT token that SSRF usually cannot obtain |
| Admins need shell access, no inbound ports, full session logs | Session Manager with S3/CloudWatch logging + KMS | Outbound-only agent, IAM-controlled, logged |
| Know immediately when a new CVE affects running containers | Inspector ECR enhanced (continuous) scanning | Re-evaluates images when new CVEs are published |
| Detect a reverse shell inside an ECS Fargate task | GuardDuty Runtime Monitoring for ECS Fargate | Inspector does not watch runtime behavior |
| ECS app gets AccessDenied calling SQS though the execution role allows it | Grant SQS on the task role | Execution role is for the agent, not app code |
| Chatbot must never reveal customer phone numbers | Bedrock Guardrails sensitive information filter (Mask) on output | Applied to responses regardless of the prompt |
Explain the answer and name the exact control.
Keys, encryption at rest and in transit, integrity, backups, and secrets — Domain 5, 18% of the exam.
Key types, envelope encryption, encryption context, quotas, and the key lifecycle.
Who owns the key decides who can see it, audit it, share it, and delete it.
| AWS owned key | AWS managed key | Customer managed key | |
|---|---|---|---|
| Example | DynamoDB default table encryption | aws/s3, aws/ebs, aws/rds | Any key you create |
| Visible in your account | No | Yes | Yes |
| Key policy | AWS controls | Fixed by AWS; read only | You write it |
| CloudTrail usage events | No | Yes | Yes |
| Rotation | AWS decides | Every year, automatic | Optional automatic + on-demand |
| Cross-account use | No | No | Yes, via key policy + IAM |
| Cost | Free | No monthly fee; pay per request | Monthly fee + per request |
Exam rule of thumb: “share encrypted snapshots/secrets with another account”, “control the key policy”, “disable or delete the key” or “audit who used the key” all mean a customer managed key.
Most AWS integrations need a symmetric encryption key; the others solve specific problems.
SYMMETRIC_DEFAULT)GenerateDataKey, encryption context, rotation.GenerateMac / VerifyMac with a secret symmetric key.Code signing for Lambda uses AWS Signer, not a raw KMS asymmetric key; container images are signed with AWS Signer (Notation) or with cosign and a KMS key.
KMS Encrypt accepts at most 4 KB. Real data is encrypted locally with a data key.
Decrypt.GenerateDataKeyWithoutPlaintext: create now, decrypt later (e.g. a pipeline stage).GenerateDataKeyPair: asymmetric data keys for client-side signing or encryption.ReEncrypt: move ciphertext to another KMS key without exposing plaintext.Non-secret key–value pairs bound to the ciphertext: decrypt must supply the same context.
aws kms encrypt --key-id alias/app \
--plaintext fileb://token.bin \
--encryption-context tenant=acme,purpose=invoice
# Decrypt fails with InvalidCiphertextException
# unless the same context is supplied.{
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::111122223333:role/acme-app"},
"Action": "kms:Decrypt",
"Resource": "*",
"Condition": {
"StringEquals": {"kms:EncryptionContext:tenant": "acme"}
}
}kms:EncryptionContext:<key>.kms:EncryptionContextKeys requires that a context key is present.Every SSE-KMS read and write is a KMS call counted against the caller account.
| Quota | Default |
|---|---|
| Symmetric crypto ops (shared: Encrypt, Decrypt, GenerateDataKey, ReEncrypt, GenerateMac…) | 10,000 rps; 20,000 in some Regions; 100,000 in us-east-1, us-west-2, eu-west-1 |
| RSA crypto ops | 1,000 rps |
| ECC / SM2 crypto ops | 1,000 rps |
| Each CloudHSM or external key store | 1,800 rps (not adjustable) |
| CreateGrant | 50 rps |
ThrottlingExceptionDeletion is irreversible for symmetric keys, so KMS forces a waiting period.
Enabled → usable.Disabled → crypto calls fail; reversible with EnableKey.PendingDeletion → unusable, rotation stops, cancellable.PendingImport → imported key with no material yet.Unavailable → custom key store disconnected.CancelKeyDeletion returns the key to Disabled.ScheduleKeyDeletion and the final DeleteKey.kms:ScheduleKeyDeletion except for a key admin role.Data keys already decrypted in memory (EBS volumes attached, RDS running) keep working until the resource needs KMS again, e.g. on reboot or reattach.
Key policies, IAM delegation, grants, and condition keys for least-privilege key use.
Unlike most resources, IAM alone cannot grant access to a KMS key; the key policy must allow it first.
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::111122223333:root"},
"Action": "kms:*",
"Resource": "*"
},
{
"Sid": "Allow key administrators",
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::111122223333:role/KeyAdmin"},
"Action": ["kms:Create*","kms:Describe*","kms:Enable*","kms:List*",
"kms:Put*","kms:Update*","kms:Revoke*","kms:Disable*",
"kms:Get*","kms:Delete*","kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion","kms:TagResource","kms:UntagResource"],
"Resource": "*"
}:root principal means *the account*, not the root user.kms:Decrypt by default.AWS services such as EBS, RDS and Secrets Manager create grants so they can use your key on your behalf.
CreateGrant; removed with RetireGrant or RevokeGrant.kms:GrantIsForAWSResource: true lets users let services create grants, but not create grants for themselves.aws kms list-grants --key-id …aws kms create-grant --key-id alias/app --grantee-principal arn:aws:iam::111122223333:role/batch \
--operations Decrypt GenerateDataKey --constraints EncryptionContextSubset={tenant=acme}
Condition keys turn a broad key policy into least privilege.
| Condition key | Use |
|---|---|
kms:ViaService | Allow use only through a service in a Region, e.g. s3.us-east-1.amazonaws.com |
kms:CallerAccount | Allow every principal of an account, typically combined with kms:ViaService (this is how AWS managed keys work) |
kms:EncryptionContext:<k> | Bind decrypt rights to a tenant, object ARN or purpose |
kms:GrantIsForAWSResource | Grants only for AWS services acting on resources |
kms:KeySpec, kms:KeyOrigin | In IAM policies: who may create which kind of key |
aws:PrincipalOrgID | Allow any principal in your organization |
aws:SourceVpce / aws:SourceVpc | Only via a VPC endpoint (com.amazonaws.<region>.kms) |
A key used only by EBS: allow kms:CreateGrant, Decrypt, GenerateDataKey* with kms:ViaService = ec2.<region>.amazonaws.com and kms:CallerAccount.
Two policies must both allow: the key policy in the owner account and IAM in the caller account.
// Account A (key owner): key policy statement
{
"Sid": "AllowAccountB",
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::444455556666:root"},
"Action": ["kms:Decrypt", "kms:DescribeKey"],
"Resource": "*"
}// Account B: IAM policy on the app role
{
"Effect": "Allow",
"Action": ["kms:Decrypt", "kms:DescribeKey"],
"Resource": "arn:aws:kms:us-east-1:111122223333:key/1234abcd-..."
}Each of these appears in scenario questions.
:root statement).kms:ViaService, context).aws/ebs or aws/rds.kms:Decrypt explicitly.kms:Decrypt for admin roles to prove it.Where the key material comes from, how it rotates, and when you need CloudHSM or an external key store.
Rotation adds new key material behind the same key ID; old material stays to decrypt old ciphertexts.
| Key | Automatic rotation | On-demand rotation | Notes |
|---|---|---|---|
| AWS managed key | Always, every year | No | Cannot be changed |
| Customer managed, symmetric, AWS-generated | Optional; period 90–2,560 days (default 365 when enabled) | Yes (RotateKeyOnDemand) | No re-encryption of data needed |
Customer managed, imported material (EXTERNAL) | No | Yes, since Jun 2025 (symmetric) | You import the new material first |
| Asymmetric or HMAC | No | No | Manual: new key, update alias |
| CloudHSM or external key store | No | No | Manual rotation |
| Multi-Region key | Set on the primary; replicas share material | Yes, on the primary | Replicas cannot rotate independently |
UpdateAlias.aws kms get-key-rotation-status --key-id …aws kms list-key-rotations --key-id …RotateKey).Importing (BYOK) gives you control over the material — and responsibility for it.
AWS-generated (AWS_KMS) | Imported (EXTERNAL) | |
|---|---|---|
| Who creates the material | KMS HSMs | You, in your own HSM or tooling |
| Durability | Managed by AWS | You must keep a copy; KMS can lose it if expired or deleted |
| Expiration | Never | Optional expiration date; KMS deletes the material at expiry |
| Delete the material immediately | No (only schedule key deletion) | Yes: DeleteImportedKeyMaterial; reversible by reimporting |
| Rotation | Automatic and on-demand | On-demand only (import new material first) |
| Import process | — | GetParametersForImport → wrap with public key → ImportKeyMaterial |
| Use case | Default choice | Regulatory proof of origin, instant revocation, keys generated outside AWS |
A symmetric key cannot be “recreated” from the same material: a new KMS key with identical material cannot decrypt the old ciphertexts. Asymmetric and HMAC material can be reimported into a new key.
Both keep the KMS API and integrations, but the root key lives in hardware you control.
kmsuser crypto user in the cluster.Related keys with the same key ID and key material, so ciphertext moves between Regions without re-encryption.
mrk-; same ID in every Region, different ARN.ReplicateKey.kms:MultiRegion.UpdatePrimaryRegion moves the primary role.Both are FIPS 140-3 Level 3; the difference is tenancy, control, and interfaces.
| AWS KMS | AWS CloudHSM | |
|---|---|---|
| Tenancy | Multi-tenant, AWS-managed HSM fleet | Single-tenant HSMs in your VPC |
| Who controls keys | You via key policy; AWS operates the service | Only your crypto users; AWS cannot access keys |
| Interfaces | KMS API; integrates with 100+ services | PKCS#11, JCE, OpenSSL dynamic engine, KSP/CNG |
| Typical use | Server-side encryption for AWS services | TLS offload, Oracle/SQL Server TDE, PKI root CA, custom apps |
| High availability | Built in | You deploy ≥2 HSMs across AZs; backups to S3 are automatic |
| Cost | Per key + per request | Per HSM-hour (significant) |
Exam keywords: “single-tenant”, “customer has exclusive control”, “PKCS#11”, “SSL/TLS offload” → CloudHSM. “Integrates with S3/EBS/RDS, least operational overhead” → KMS.
Read the requirement words; they point to one answer.
| Scenario | Answer | Why |
|---|---|---|
| Must be able to make data unreadable immediately, and prove the key came from the on-prem HSM | Imported key material; DeleteImportedKeyMaterial | Instant, reversible removal; BYOK origin |
| Regulator requires keys never stored in AWS | External key store (XKS) | Material stays outside AWS |
| S3 uploads throttled by KMS at peak | Enable S3 Bucket Keys | Far fewer GenerateDataKey calls |
| Annual rotation without app changes | Enable automatic rotation on the customer managed key | Same key ID; old material kept |
| One key, many tenants, no cross-tenant decrypt | Encryption context + kms:EncryptionContext:tenant condition | Ciphertext bound to tenant |
| Encrypted data must be decryptable in a DR Region without re-encryption | Multi-Region key | Same material in both Regions |
ACM for public TLS, AWS Private CA for internal identity and mTLS.
ACM manages certificates for integrated services; AWS Private CA issues certificates you control.
us-east-1.acm-pca:IssueCertificate with templates and conditions.EventBridge + ACM “Certificate Approaching Expiration” events and the Security Hub CSPM control on expiring imported certificates catch the certificates ACM cannot renew.
mTLS authenticates the client by certificate before any application code runs.
X-Amzn-Mtls-Clientcert header; the backend validates.execute-api endpoint so clients cannot bypass mTLS.Encryption choices, enforcement, immutability, lifecycle, and secure replication.
Since January 2023 every new object is encrypted; the question is with which key and who controls it.
| Option | Key managed by | Audit in CloudTrail | Notes |
|---|---|---|---|
| SSE-S3 | S3 (AES-256) | No KMS events | Default for all buckets |
| SSE-KMS | KMS (AWS managed aws/s3 or customer managed) | Yes, per request | Key policy controls readers; KMS quotas apply |
| SSE-KMS + S3 Bucket Key | KMS → bucket-level key | Fewer events | Reduces KMS calls and cost; context becomes the bucket ARN |
| DSSE-KMS | KMS, two independent layers | Yes | For mandates requiring dual-layer encryption |
| SSE-C | Customer supplies the key per request | No KMS events | Disabled by default on new buckets since Apr 2026 |
| Client-side | You (often KMS via Encryption SDK) | Depends | S3 never sees plaintext |
SSE-C opt-in: call PutBucketEncryption with BlockedEncryptionTypes set to NONE. Blocked requests get HTTP 403. Most designs should use SSE-KMS instead.
Default encryption covers objects; policies make violations fail loudly.
{
"Version": "2012-10-17",
"Statement": [
{"Sid": "DenyNonTLS", "Effect": "Deny", "Principal": "*",
"Action": "s3:*",
"Resource": ["arn:aws:s3:::data-prod", "arn:aws:s3:::data-prod/*"],
"Condition": {"Bool": {"aws:SecureTransport": "false"}}},
{"Sid": "DenyWrongKey", "Effect": "Deny", "Principal": "*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::data-prod/*",
"Condition": {"StringNotEqualsIfExists": {
"s3:x-amz-server-side-encryption-aws-kms-key-id":
"arn:aws:kms:us-east-1:111122223333:key/1234abcd-..."}}}
]
}s3:TlsVersion can require a minimum TLS version (e.g. ≥ 1.2).s3:GetObject and kms:Decrypt on the key.Two settings that remove whole classes of S3 data leaks.
RestrictPublicBuckets limits access to AWS services and the bucket owner account.aws:PrincipalOrgID in the bucket policy: only your org.aws:SourceVpce: only through your gateway endpoint.aws:ResourceOrgID).WORM storage protects integrity against mistakes, insiders, and ransomware.
s3:BypassGovernanceRetention + bypass header can delete.s3:PutObjectLegalHold.InitiateVaultLock → 24 hours to test → CompleteVaultLock.Test retention in governance mode first; compliance mode retention on the wrong objects cannot be undone — the only exit is closing the account.
Lifecycle controls cost and retention; replication controls copies across Regions and accounts.
SseKmsEncryptedObjects in SourceSelectionCriteria.ReplicaKmsKeyID in the destination Region/account.kms:Decrypt on the source key and kms:Encrypt on the destination key.EBS, RDS, EFS and FSx encryption plus AWS Backup, DLM and DataSync.
Most services encrypt only at creation time; changing it means copying the data.
| Service | How to enable | Encrypt an existing unencrypted resource | Gotchas |
|---|---|---|---|
| EBS | Account-level “encryption by default” per Region | Snapshot → copy with encryption → new volume | Snapshots and volumes inherit encryption |
| RDS / Aurora | At creation, choose a KMS key | Snapshot → encrypted copy → restore | Cannot share snapshots encrypted with aws/rds |
| RDS read replicas | Inherit from the source | — | Cross-Region replica uses a key in the destination Region |
| EFS | At creation only | Create a new encrypted file system, copy with DataSync | In transit: mount helper -o tls |
| DynamoDB | Always encrypted; choose owned, managed or customer managed key | Switch key any time | Table key change is online |
| EKS (1.28+) | Envelope encryption of all Kubernetes API data by default | Optional customer managed key | Does not cover node disks or EBS volumes |
An SCP condition (ec2:Encrypted) can make encryption mandatory across all accounts; Config rule encrypted-volumes detects stragglers.
One service for EBS, EC2, RDS, Aurora, DynamoDB, EFS, FSx, S3 and more, managed across the org.
ChangeableForDays ≥ 3).Assume the production account is fully compromised; recovery must still work.
DeleteRecoveryPoint, Backup Audit Manager.Small details that flip the answer.
Enforcing TLS at the edge, between services, and inside the VPC.
Every listener has a policy that fixes protocol versions and cipher suites.
ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09.ELBSecurityPolicy-2016-08 — set the policy explicitly.PQ policies add hybrid post-quantum key exchange (ML-KEM).FIPS variants for FIPS 140 requirements.TLSv1.2_2021.us-east-1.rds.force_ssl / require_secure_transport parameters.Config / Security Hub CSPM controls detect listeners with outdated policies and HTTP listeners without redirects.
New in SCS-C03: traffic between nodes, containers and instances must be encrypted too.
Private connectivity reduces exposure; it does not replace encryption.
| Need | Use | Detail |
|---|---|---|
| EC2 → S3/DynamoDB without internet | Gateway VPC endpoint | Free; endpoint policy restricts buckets/tables |
| EC2 → other AWS APIs (KMS, Secrets Manager, STS…) | Interface endpoint (PrivateLink) | ENI in your subnet; SG + endpoint policy |
| Expose your service to other VPCs/accounts | PrivateLink endpoint service (NLB/GWLB) | Consumers see only one service, not your VPC |
| Remote users → private apps without VPN | AWS Verified Access | Identity and device posture per request |
| Remote users → whole VPC | AWS Client VPN | OpenVPN-based, mutual or SAML auth |
| On-prem → AWS | Site-to-Site VPN (IPsec) / Direct Connect + MACsec | DX alone is private but not encrypted |
Pick the control that satisfies the exact requirement.
| Scenario | Answer | Why |
|---|---|---|
| Deny any S3 request not using TLS | Bucket policy deny on aws:SecureTransport = false | Applies to all principals |
| Direct Connect traffic must be encrypted at line rate | MACsec on dedicated connections (or VPN over DX) | DX is not encrypted by default |
| Prove all traffic in a VPC is encrypted | VPC Encryption Controls, monitor then enforce | Flow log encryption status + enforcement |
| ALB must authenticate partner clients by certificate | ALB mTLS verify mode with a trust store | Validation at the edge |
| Support PQ-capable clients but keep TLS 1.2 clients working | ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09 | Hybrid PQ + TLS 1.3/1.2 |
| Encrypt distributed training traffic | SageMaker AI inter-container traffic encryption | Inter-node encryption |
Rotate credentials, choose the right store, discover and mask sensitive data.
A Lambda function (or the owning service) moves a secret through four steps using staging labels.
AWSPENDING.AWSPENDING.AWSCURRENT to the new version.AWSPREVIOUS.ManageMasterUserPassword), Redshift.Choose by rotation needs, size, sharing and cost.
| Secrets Manager | Parameter Store SecureString | |
|---|---|---|
| Rotation | Built in (Lambda or managed) | None (build your own) |
| Size | Up to 64 KB | 4 KB standard, 8 KB advanced |
| Cross-account | Resource policy + customer managed key | Advanced parameters via AWS RAM |
| Replication | Multi-Region replica secrets | No |
| Cost | Per secret per month + API calls | Standard tier free |
| Encryption | KMS (aws/secretsmanager or customer managed) | KMS |
aws/secretsmanager).kms:Decrypt for that role (with kms:ViaService = secretsmanager).secretsmanager:GetSecretValue on the secret ARN.BlockPublicPolicy on PutResourcePolicy.Find sensitive data at rest and stop it leaking through logs and messages.
logs:Unmask.Macie findings flow to EventBridge and Security Hub; use EventBridge to tag or quarantine buckets automatically.
Typical SCS-C03 wording and the answer it expects.
| Scenario | Answer | Why |
|---|---|---|
| Rotate RDS credentials every 30 days with no downtime | Secrets Manager, alternating users strategy | Old user stays valid during rotation |
| Hard-coded DB password in Lambda environment variables | Move to Secrets Manager; fetch with the extension or SDK | Rotation + least privilege |
| Share a secret with a partner account | Resource policy + customer managed key policy | aws/secretsmanager cannot be shared |
| Application logs contain credit card numbers | CloudWatch Logs data protection policy | Mask at ingestion; logs:Unmask to view |
| Find buckets containing PII across 200 accounts | Macie with a delegated administrator + automated discovery | Org-wide, low effort |
| Prevent PII in notifications to an email subscriber | SNS message data protection (de-identify/deny outbound) | Exam answer; closed to new customers since Apr 2026 |
Explain each answer out loud, then verify in the docs or a lab.
:root principal in a key policy mean?aws/rds snapshot not be shared?Most questions have two technically valid answers. The qualifier in the stem picks the winner.
Ordering questions follow real procedures: evidence before containment changes, isolation before termination, and test before rollout.
Common stems and the answer they almost always point to.
| If the stem says… | Think first of |
|---|---|
| Restrict what member accounts can do, even admins | SCP (does not affect the management account) |
| Stop outside principals from reaching our S3/KMS/STS, whatever the bucket policy says | RCP with aws:PrincipalOrgID |
| Enforce IMDSv2 / block public AMIs and snapshots org-wide | Declarative policy for EC2 |
| Let developers create roles without escalating | Permission boundary + condition requiring it |
| Which resources are shared outside the org? | IAM Access Analyzer external access analyzer |
| Unused roles, keys, and permissions | IAM Access Analyzer unused access analyzer |
| Workforce SSO with Okta / Entra ID across accounts | IAM Identity Center + SAML + SCIM |
Common stems and the answer they almost always point to.
| If the stem says… | Think first of |
|---|---|
| Crypto-mining, malicious IPs, credential exfiltration | GuardDuty (and Detective to investigate) |
| CVEs in EC2, ECR images, or Lambda | Amazon Inspector |
| PII in S3 buckets | Amazon Macie |
| Prove logs were not modified | CloudTrail log file integrity validation |
| Data must be undeletable for N years, even by root | S3 Object Lock in compliance mode |
| Single-tenant HSM, PKCS#11, full key control | AWS CloudHSM (or a CloudHSM key store) |
| Keys must stay outside AWS | KMS external key store (XKS) |
Sandbox organization with a Workloads OU. Attach to a test OU first, never the root.
aws organizations enable-policy-type --root-id r-abcd \
--policy-type SERVICE_CONTROL_POLICY
aws organizations enable-policy-type --root-id r-abcd \
--policy-type RESOURCE_CONTROL_POLICY
aws organizations create-policy --name deny-other-regions \
--type SERVICE_CONTROL_POLICY --description "Region guardrail" \
--content file://deny-regions.json
aws organizations attach-policy --policy-id p-1111 \
--target-id ou-abcd-test
# test from a member account
aws ec2 describe-instances --region eu-west-3 # expect AccessDenieddeny-regions.json with aws:RequestedRegion and NotAction for global services (IAM, STS, Organizations, CloudFront, Route 53, Support).aws:PrincipalOrgID matches your org (exempt service principals).One trail for every account and Region, encrypted, validated, and queryable.
# in the management (or delegated admin) account
aws cloudtrail create-trail --name org-trail \
--s3-bucket-name log-archive-trail-111122223333 \
--is-organization-trail --is-multi-region-trail \
--enable-log-file-validation \
--kms-key-id arn:aws:kms:us-east-1:111122223333:key/abcd-...
aws cloudtrail start-logging --name org-trail
# prove integrity later
aws cloudtrail validate-logs \
--trail-arn arn:aws:cloudtrail:us-east-1:999988887777:trail/org-trail \
--start-time 2026-10-01T00:00:00Zcloudtrail.amazonaws.com with aws:SourceArn of the trail.GenerateDataKey* with the trail encryption context.ConsoleLogin events without MFA.Detect once for the whole organization and route findings to a human.
# management account
aws guardduty enable-organization-admin-account \
--admin-account-id 222233334444
aws securityhub enable-organization-admin-account \
--admin-account-id 222233334444
# delegated admin (security tooling) account
aws guardduty update-organization-configuration \
--detector-id <id> --auto-enable-organization-members ALL
aws guardduty create-sample-findings --detector-id <id> \
--finding-types "UnauthorizedAccess:EC2/SSHBruteForce"
# EventBridge pattern for the alert rule
{"source": ["aws.guardduty"], "detail-type": ["GuardDuty Finding"]}detail.severity ≥ 7 for paging-level alerts.Detect a public bucket and fix it without a human.
# managed rule
aws configservice put-config-rule --config-rule '{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"Source": {"Owner": "AWS",
"SourceIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED"}}'
# attach an SSM Automation remediation
aws configservice put-remediation-configurations \
--remediation-configurations file://remediation.json
# TargetId: AWS-DisableS3BucketPublicReadWrite
# Automatic: true, MaximumAutomaticAttempts: 3
# Parameters: AutomationAssumeRole, S3BucketName (RESOURCE_ID)Let a team create roles safely, then work out exactly why a call fails.
# simulate before you deploy
aws iam simulate-principal-policy \
--policy-source-arn arn:aws:iam::111122223333:role/dev-app \
--action-names s3:GetObject \
--resource-arns arn:aws:s3:::team-a-data/report.csv
# decode an encoded authorization failure message
aws sts decode-authorization-message \
--encoded-message <message> --query DecodedMessage --output text
# find who can reach a resource from outside the org
aws accessanalyzer list-findings-v2 --analyzer-arn <arn>iam:CreateRole only with iam:PermissionsBoundary set to it.team; write one ABAC policy using aws:PrincipalTag/team = aws:ResourceTag/team.Two accounts: A owns the key, B uses it.
# account A
aws kms create-key --description "lab key"
aws kms create-alias --alias-name alias/lab --target-key-id <key-id>
aws kms enable-key-rotation --key-id <key-id> \
--rotation-period-in-days 180
aws kms create-grant --key-id <key-id> \
--grantee-principal arn:aws:iam::444455556666:role/app \
--operations Decrypt GenerateDataKey
# account B (role must also allow kms:Decrypt on the key ARN)
aws kms encrypt --key-id arn:aws:kms:...:key/<key-id> \
--plaintext fileb://secret.txt --query CiphertextBlob --output textPrivate S3 origin, edge-only access, and a basic flood control.
cloudfront.amazonaws.com with AWS:SourceArn of the distribution.CLOUDFRONT (managed in us-east-1).AWSManagedRulesCommonRuleSet and a rate-based rule keyed on IP.Treat a test instance as compromised and walk the full sequence.
# 1. protect and preserve
aws ec2 modify-instance-attribute --instance-id i-0abc \
--disable-api-termination
aws ec2 create-tags --resources i-0abc \
--tags Key=ir-status,Value=quarantined
aws ec2 create-snapshot --volume-id vol-0abc \
--description "IR case 42 evidence"
# 2. remove from service
aws autoscaling detach-instances --instance-ids i-0abc \
--auto-scaling-group-name web --no-should-decrement-desired-capacity
# 3. isolate (SG with no rules; see connection-tracking caveat)
aws ec2 modify-instance-attribute --instance-id i-0abc \
--groups sg-0isolationSecurity services bill per account, Region, and volume. A forgotten lab can cost more than the exam.
Short anchors; explain each in your own words.
| Term | Short meaning |
|---|---|
| SCP | Caps permissions of principals in member accounts |
| RCP | Caps permissions on resources in member accounts |
| Declarative policy | Enforces a service configuration baseline |
| Delegated administrator | Member account that runs a service org-wide |
| Landing zone | Pre-built multi-account baseline (Control Tower) |
| Data perimeter | Trusted identities × trusted resources × expected networks |
| Term | Short meaning |
|---|---|
| Permission boundary | Max permissions an identity policy can grant |
| Session policy | Inline cap passed when assuming a role |
| ABAC | Authorization by matching tags or attributes |
| Confused deputy | Service tricked into acting for the wrong party |
| Permission set | Identity Center template that becomes a role |
| Trust policy | Resource policy on a role: who may assume it |
Short anchors; explain each in your own words.
| Term | Short meaning |
|---|---|
| OCSF | Open schema for security events (Security Lake, Security Hub) |
| ASFF | AWS finding format used by Security Hub CSPM |
| Attack sequence | GuardDuty finding correlating multi-stage activity |
| Conformance pack | Bundle of Config rules and remediations |
| Runbook / playbook | Step-by-step automated or manual response |
| Chain of custody | Record proving evidence was not altered |
| Term | Short meaning |
|---|---|
| Envelope encryption | Data key encrypts data; KMS key encrypts data key |
| Encryption context | Non-secret key-value pairs bound to ciphertext |
| Grant | Delegated, revocable KMS permission |
| XKS | KMS external key store: keys stay outside AWS |
| Object Lock | WORM retention for S3 objects |
| mTLS | TLS in which the client also presents a certificate |
The exam tests current AWS behavior; when a slide and the docs disagree, the docs win.
docs.aws.amazon.com/aws-certification/latest/security-specialty-03/docs.aws.amazon.com/prescriptive-guidance/latest/security-reference-architecture/docs.aws.amazon.com/wellarchitected/latest/security-pillar/docs.aws.amazon.com/security-ir/latest/userguide/aws.amazon.com/identity/data-perimeters-on-aws/docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.htmldocs.aws.amazon.com/organizations/latest/userguide/docs.aws.amazon.com/kms/latest/developerguide/aws.amazon.com/blogs/security/