Exams / DOP-C01 / D1 Security and Compliance
D1.1
Security and Compliance (part 1 of 2)
- Exam domain: Security and Compliance
You are reading a free preview. The rest of the DOP-C01 course unlocks with an Exam pass or All access.See plans
Continuous compliance with AWS Config
| Need | Tool | Notes |
|---|---|---|
| Flag unencrypted EBS volumes | Config rule encrypted-volumes |
"The rule is NON_COMPLIANT if attached EBS volumes are unencrypted or are encrypted with a KMS key not in the supplied parameters." |
| Instance without a profile | ec2-instance-profile-attached |
NON_COMPLIANT if no IAM profile is attached to the instance |
| Open SSH in a security group | restricted-ssh |
NON_COMPLIANT when SSH is open to 0.0.0.0/0 or ::/0 |
| Same rule in every account | Config organization rule | Created with the API or CLI only; deployed to accounts that join later |
| Fix automatically | Config remediation | Uses Systems Manager Automation documents |
Existing and future resources → Config rule plus automatic remediation. EventBridge rules on API calls only see future events.
Organization-wide guardrails
- SCPs: a Deny overrides any Allow ("deny in the identity-based policy, an SCP, or an RCP overrides the allow."). Use a Deny with a condition (for example
aws:usernamewithStringNotLike) for an exception list. An SCP is preventive; EventBridge + Lambda is reactive. - Control Tower: enrolls existing accounts and deploys baseline stack sets (CloudTrail, Config, roles). The account to enroll must not have existing AWS Config resources.
- Firewall Manager: a WAF policy applies a web ACL to in-scope ALBs; account owners can add their own rules and rule groups.
IAM Identity Center, ABAC and cross-account access
| Topic | Fact |
|---|---|
| MFA | Always-on prompts every sign-in; users without a device can be required to register one at sign-in. Context-aware can skip the prompt. |
| ABAC | Enable attributes for access control, map IdP attributes; they arrive as session tags. |
| Condition keys | aws:PrincipalTag/KEY (user) vs ec2:ResourceTag/KEY (resource) |
| Cross-account admin | Role (trust policy) in the target account + sts:AssumeRole permission for users in the trusted account |
Least privilege
- IAM last accessed information covers the last 400 days; Access Analyzer policy generation from CloudTrail covers up to 90 days.
- A permissions boundary only limits permissions; it grants none.
- Restrict a CodeCommit branch with an explicit Deny on
codecommit:GitPush/PutFileand a references condition. AWS managed policies cannot be edited.
Secrets and credentials
| Case | Use |
|---|---|
| AWS API access from EC2 | Instance role (temporary credentials) |
| Database credentials with rotation | Secrets Manager |
| CodeBuild secret | env/parameter-store (SecureString) or secrets-manager, never variables |
| Find hardcoded secrets in CodeCommit | CodeGuru Reviewer, then move to Secrets Manager |
| Manage instances without SSH | Systems Manager Run Command |
Detection and data integrity
- GuardDuty findings go to EventBridge in near real time; filter severity in the event pattern (input transformers do not filter).
- OS-level logins: CloudWatch agent → CloudWatch Logs → metric filter → alarm → SNS. CloudTrail does not see SSH logins.
- Inspector finds EC2 software vulnerabilities and rescans on new CVEs.
- S3 upload integrity:
Content-MD5header, or compare the returned ETag with the MD5 (valid only when the ETag is an MD5). - Cross-account replication: role and rule in the source, destination bucket policy granting the source.
- Identical VPC CIDRs: peering and Transit Gateway fail; use NLB + PrivateLink.
Exam traps
- Metadata or tags are not integrity checks; version IDs are not MD5.
- "Existing and future resources" excludes event-only solutions.
- A permissions boundary does not grant access.
- Access keys in CodeBuild environment variables are always wrong.
- Context-aware MFA ≠ prompt every time.
Docs
- https://docs.aws.amazon.com/config/latest/developerguide/encrypted-volumes.html
- https://docs.aws.amazon.com/config/latest/developerguide/config-rule-multi-account-deployment.html
- https://docs.aws.amazon.com/config/latest/developerguide/remediation.html
- https://docs.aws.amazon.com/config/latest/developerguide/restricted-ssh.html
- https://docs.aws.amazon.com/config/latest/developerguide/ec2-instance-profile-attached.html
- https://docs.aws.amazon.com/controltower/latest/userguide/enroll-account.html
- https://docs.aws.amazon.com/waf/latest/developerguide/waf-policies.html
- https://docs.aws.amazon.com/singlesignon/latest/userguide/mfa-getting-started.html
- https://docs.aws.amazon.com/singlesignon/latest/userguide/attributesforaccesscontrol.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed-view-data.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-generation.html
- https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
- https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html
- https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings_eventbridge.html