Exams / DOP-C02 / D1 Security and Compliance
D1.1
Security and Compliance (part 1 of 4): organization guardrails, detective controls, access
- Exam domain: Security and Compliance
You are reading a free preview. The rest of the DOP-C02 course unlocks with an Exam pass or All access.See plans
1. Preventive guardrails: SCPs
SCPs define the maximum permissions of member accounts; they never grant anything.
| Rule | Consequence |
|---|---|
| "SCPs require an explicit Allow at every level in the path." | An allow SCP on the account cannot override a missing allow or a deny higher up (root, OU). |
| An explicit Deny at any level wins | To unblock an action, edit the SCP that denies it (DOP-C02-099). |
| "SCPs don't affect users or roles in the management account." | Use identity policies or permission-set denies there (DOP-C02-038). |
| SCP and permissions boundary and identity policy must all allow | A bucket policy allow does not bypass an SCP or boundary (DOP-C02-009). |
Typical SCP patterns seen in the exam:
| Goal | Pattern |
|---|---|
| Nobody can stop CloudTrail | Deny cloudtrail:StopLogging, cloudtrail:DeleteTrail on OUs |
| Block member root user | Deny * with StringLike aws:PrincipalArn arn:aws:iam::*:root (SCPs have no Principal element) |
| Require VPC Lambda | Deny lambda:CreateFunction and lambda:UpdateFunctionConfiguration when lambda:VpcIds is Null (absent) |
| Lock EC2 credentials to the instance | Deny unless aws:Ec2InstanceSourceVpc = aws:SourceVpc and aws:Ec2InstanceSourcePrivateIPv4 = aws:VpcSourceIp |
| Even full admins of an account cannot create IAM users | SCP deny iam:CreateUser (a deny on the permission-set role is bypassable) |
2. Detective controls and central remediation
| Need | Service |
|---|---|
| Custom compliance logic (e.g. key older than 90 days) | AWS Config custom rule (Lambda or Guard) |
| Same baseline in every account, with remediation, not editable by members | Organization conformance pack from the management or delegated admin account |
| Managed check with auto-fix | Config managed rule (e.g. approved-amis-by-id) + SSM Automation (AWS-StopEC2Instance) |
| Landing-zone managed rules | Control Tower detective controls (implemented as Config rules) + EventBridge to SNS |
| Org-wide WAF, security group policies | Firewall Manager: administrator account, then policy with automatic remediation |
| Aggregate findings of many accounts | Security Hub with delegated admin and auto-enable |
| Tag standards | Tag policy (allowed values) + SCP (require the key) |
3. Event-driven alerts
- AWS API activity (role assumption, security group changes) reaches the default EventBridge bus through CloudTrail; match it with a rule and invoke Lambda or SNS.
- In-guest events (SSH logins) are not API calls: CloudWatch agent, CloudWatch Logs metric filter, alarm, SNS.
- Cross-account: a rule in the source account targets the other account's default bus; the receiver bus policy must allow the sender.
4. Identity and secrets
| Topic | Key point |
|---|---|
| IAM Identity Center with external IdP | SAML signs users in, SCIM provisions users and groups |
| Workloads outside AWS | IAM Roles Anywhere: X.509 certificate from a trusted CA (trust anchor) for temporary credentials; per-device revocation |
| EFS encryption in transit | Mount with the EFS mount helper (amazon-efs-utils, TLS) |
| Cross-account read | Trust policy in the target role plus sts:AssumeRole permission for the caller |
| Database credentials | EC2 role for AWS access, Secrets Manager for secrets; a CMK-encrypted secret also needs KMS permission for the caller |
| CDK least privilege | Permissions boundary via cdk bootstrap --custom-permissions-boundary and app default |
| ABAC for CodeCommit | SAML session tag + resource tag + SCP deny on mismatch |
| Private API Gateway with org conditions | AWS_IAM authorization and SigV4, otherwise the caller is anonymous |
5. Scanning and vulnerabilities
- ECR enhanced scanning (Amazon Inspector) covers OS and programming-language packages; basic scanning does not cover language packages. Alert on the
finding-severity-countsof scan events. - Amazon Inspector re-scans EC2 instances when a new relevant CVE is added.
- Pipeline gate: a CodeBuild stage before deploy that fails on findings. CodeGuru Security (used in old exam answers) is discontinued as of 2025-11-20.
- Macie cost: exclude log buckets, scope jobs by last modified; do not exclude public buckets.
- GuardDuty detects; Network Firewall (drop rule) blocks VPC-wide.
Exam traps
- SCPs do not apply to the management account and have no Principal element.
- Allow SCPs never grant; a lower-level allow cannot beat a higher-level deny.
- StackSets-deployed rules can be edited by member admins; organization conformance packs cannot.
- CloudTrail events are on the default bus only.
- Detective controls (Config, Control Tower) do not prevent; for prevention pick SCP or IAM deny.
- Bearer-token or Cognito auth is anonymous for an endpoint policy; only SigV4 identifies a principal.
- Invited accounts do not get OrganizationAccountAccessRole.
Docs
- https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html
- https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_evaluation.html
- https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html
- https://docs.aws.amazon.com/config/latest/developerguide/conformance-pack-organization-apis.html
- https://docs.aws.amazon.com/config/latest/developerguide/approved-amis-by-id.html
- https://docs.aws.amazon.com/controltower/latest/controlreference/detective-controls.html
- https://docs.aws.amazon.com/waf/latest/developerguide/enable-integration.html
- https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-vpc-endpoint-policies.html
- https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html
- https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-identity-source-idp.html
- https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html
- https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html
- https://docs.aws.amazon.com/cdk/v2/guide/customize-permissions-boundaries.html
- https://docs.aws.amazon.com/cli/latest/reference/codeguru-security/