Amazon DOP-C02: Security, Compliance and Governance — Study Guide

Part of the AWS DevOps Engineer Professional DOP-C02 — Study Guide. Practice with verified answers in the Amazon exam hub, or take timed practice tests on ExamRoll.io.

Overview

Security, compliance, and governance on AWS hinge on deterministic controls that scale across accounts and Regions without slowing delivery. A robust design layers identity controls (IAM, permission boundaries, and service control policies), multi-account governance (AWS Organizations and Control Tower), continuous assessment and remediation (AWS Config), threat detection (Security Hub, GuardDuty, Inspector), secrets hygiene, encryption with AWS KMS, and network isolation (VPC security groups, NACLs, endpoints, and PrivateLink). The objective is to minimize blast radius, prove compliance continuously, and automate prevention and remediation while preserving least privilege and developer autonomy.

Identity, Policy, and Multi-Account Governance

IAM roles, policies, permission boundaries, and SCPs work together to form the effective permission set. An IAM role’s identity-based policies define allowed actions; the role’s trust policy defines who can assume it. Permission boundaries cap what a principal can do regardless of what identity policies say. SCPs in AWS Organizations set the absolute maximum for any principal in a member account (including the root user). Resource-based policies (for S3, KMS, Secrets Manager, etc.) may allow cross-account access, but they also cannot exceed boundaries imposed by SCPs or permission boundaries. The effective permission is the intersection of: identity policies ∩ permission boundary ∩ session policies (if present) ∩ resource policy (if applicable) ∩ SCPs, with any explicit Deny taking precedence.

Use permission boundaries to enable safe self-service in a single account. For example, a developer vending pipeline can create roles only if it attaches a boundary that denies iam:PassRole except for specific patterns, denies kms:Decrypt on sensitive keys, and caps EC2 instance types. Boundaries are attachable only by principals that already have iam:PutRolePermissionsBoundary; guard that right tightly.

SCPs are organization-wide guardrails. Common guardrails include prohibiting disabling AWS Config or CloudTrail, preventing outside-Organization invitations, denying changes to IAM Identity Center’s delegated administrator, and restricting Regions. Prefer explicit allow-by-exception patterns with conditions (for example, permitting changes by a central admin role) to minimize friction. Always allow creation and use of needed service-linked roles (e.g., for GuardDuty, Inspector, Config) or your SCPs will inadvertently block service setups.

AWS Organizations provides hierarchical OUs to separate environments (e.g., Sandbox, Dev, Prod), workload types, and exception lanes. Inherit SCPs from parent OUs to avoid policy drift. Use account vending to standardize account setup: AWS Control Tower’s Account Factory (console) or Account Factory for Terraform (AFT) to integrate into CI/CD. AFT adds GitOps-style workflows, drift detection, and feature flags (e.g., provisioning Enterprise Support), and scales to hundreds of accounts with consistent baseline guardrails.

AWS Control Tower automates a landing zone with prescriptive guardrails. Preventive guardrails are SCPs Control Tower manages; detective guardrails are AWS Config rules it deploys. Control Tower integrates IAM Identity Center for SSO and permission sets. Use ABAC-based permission sets with attributes for access control to scope actions by aws:PrincipalTag or identity attributes. Extend the baseline with Customizations for AWS Control Tower (CfCT) to deploy CloudFormation, SCPs, and Config packs per OU/account automatically. Keep exception OUs to host workloads needing tailored policies without weakening global guardrails.

Continuous Compliance and Automated Remediation

Enable AWS Config organization-wide from a delegated administrator account. Turn on recording for all resources in all Regions and aggregate configuration across the Organization with an organization aggregator. Use managed rules for common controls (e.g., ebs-encryption-by-default, restricted-ssh, s3-bucket-level-public-access-prohibited) and author custom Lambda-backed rules for bespoke logic (e.g., verifying KMS rotation cadence against a 90-day policy or enforcing default tags and values). Conformance packs group rules, parameters, and remediation into versioned, deployable bundles per OU; maintain them in version control and roll out via StackSets or CfCT for consistency and auditability.

Automated remediation closes the loop. Map each rule’s noncompliant evaluation to an SSM Automation runbook that enforces the baseline: attach a default instance profile, apply a tag with a default value, toggle S3 Block Public Access, or restart an EC2 instance for maintenance. Use parameterized documents and dynamic input (e.g., from the Config finding) to keep runbooks generic. For high-risk resources, configure remediation to auto-execute; for sensitive actions, require a change approval or manual invocation via EventBridge and ChatOps. Protect Config itself with SCPs that deny stopping the recorder or deleting delivery channels except by a central administrator.

Firewall Manager complements this layer for policy-as-a-service across accounts, using Organizations. Delegate a central admin and author policies for WAF web ACL associations on internet-facing ALBs/API Gateway, VPC security group auditing and cleanup, or DNS Firewall rule propagation. This shifts future enforcement from detection/remediation to prevention.

Threat Detection, Secrets Hygiene, and Vulnerability Management

Security Hub serves as the central pane of glass for findings across accounts and Regions. Enable it with a delegated admin, aggregate findings, and activate relevant standards (AWS Foundational Security Best Practices, CIS, PCI DSS where applicable). Findings flow into the AWS Security Finding Format (ASFF), normalizing inputs from GuardDuty, Inspector, IAM Access Analyzer, Config, Macie, and partner tools. Wire EventBridge patterns to route critical findings to remediation automations (SSM Automation, Lambda) and notifications (SNS, chat).

GuardDuty provides managed threat detection without requiring you to manage data-plane log pipelines. It analyzes CloudTrail management and data events, VPC Flow Logs, Route 53 Resolver DNS query logs, and EKS audit logs to detect anomalous behavior, credential exfiltration, crypto-mining, DNS exfiltration, and more. Enable Malware Protection for S3 and EC2/EBS scanning on suspicious activity. Use organization-wide auto-enablement and archive low-signal findings systematically with suppression rules to focus on actionability.

Amazon Inspector continuously assesses EC2 (via SSM agent) for package CVEs, ECR container images for vulnerabilities pre-deploy, and Lambda functions for code package CVEs. Inspector requires that EC2 instances have the SSM Agent installed, the instance profile allows SSM permissions, and egress to SSM/KMS endpoints (via VPC endpoints if internet is restricted). Configure Inspector to send findings to Security Hub and trigger patch workflows with Systems Manager Patch Manager or runbook-driven remediation. Use tags to scope which resources are in scope for scanning and to separate sandbox from regulated workloads.

Secrets Manager centralizes secret storage, rotation, and cross-account access with strong auditability. Prefer Secrets Manager over parameter stores for credentials that require rotation, leveraging built-in rotation for RDS/Aurora or Lambda-based rotation for external systems. Staging labels (AWSCURRENT, AWSPREVIOUS) allow zero-downtime rotation. Run rotation Lambdas in VPCs with the necessary endpoints (Secrets Manager, RDS, KMS) and restrict egress. For cross-account consumption, attach a resource-based policy that grants principals in other accounts GetSecretValue; ensure the KMS key policy for the secret’s CMK allows the consumer’s principals to decrypt and, if needed, to create grants. For disaster recovery or locality controls, replicate secrets across Regions and align rotation windows.

Data Protection and Network Security

Design encryption using KMS with explicit key policies. Key policies, not just IAM policies, ultimately authorize principals for cryptographic operations on a CMK. Adopt a least-privilege, role-based key policy model: delegate administration to a central KMS admin role; grant usage rights narrowly to workload roles; disallow wildcard kms:* to avoid accidental escalation. Use condition keys (kms:EncryptionContext:*) to bind decryption to expected contexts. Multi-Region keys enable active-active encryption where data replicates cross-Region.

Grants are the right tool for delegating temporary or tightly scoped key usage without editing the key policy, and they are required for some service flows (e.g., EC2 Auto Scaling using encrypted launch templates, cross-account AMI usage). To allow another account to create grants, the key policy must permit kms:CreateGrant to that account’s principals; the grantee must supply a grant token for immediate use in the same call path. For cross-account encrypted AMIs, copy and encrypt the AMI with a CMK, share the AMI, permit the target account to create grants on the CMK, and have the target service-linked role receive a grant.

Envelope encryption is the default pattern: generate a data key with KMS, encrypt data locally with the plaintext data key, then store only the ciphertext and the encrypted data key. On read, call KMS Decrypt to recover the plaintext data key into memory. This minimizes KMS calls for large payloads and limits plaintext key exposure. Where supported, use service-managed SSE-KMS (S3, EBS, RDS) for operational simplicity but still align key policies for cross-account producers/consumers.

VPC security starts with least-privilege security groups. Security groups are stateful; return traffic is implied. Prefer security group references over CIDR-based rules to avoid brittle IP allow-lists and to keep intent with infrastructure code. Default outbound allows are risky; explicitly restrict egress to required destinations and use VPC endpoints for AWS service access. NACLs are stateless and evaluated first; keep them as coarse, subnet-level controls with explicit returns for ephemeral ports only when you must implement an additional boundary or meet regulatory requirements; otherwise, favor security groups for manageability.

Eliminate internet dependencies by using VPC endpoints. Gateway endpoints (S3, DynamoDB) route privately over the AWS network; associate an endpoint policy to restrict accessible buckets or tables. Interface endpoints (AWS PrivateLink) expose AWS services (Secrets Manager, KMS, SSM, ECR, CloudWatch) via private IPs; deploy them in subnets with the right security groups and enable Private DNS so standard service names resolve to private addresses. For producer-consumer microservices across accounts/VPCs, publish an NLB-backed endpoint service and have consumers create interface endpoints to it via PrivateLink, avoiding peering or transit gateways and keeping traffic off the public internet. Combine these controls with no-NAT, no-IGW subnets, and centralized egress inspection where internet access is required.

Practical Problem Scenario

Expedia Group is expanding to hundreds of AWS accounts across multiple Regions and must enforce a strict security baseline: no internet egress for workloads, automated remediation of misconfigurations, centralized threat detection, secrets rotation, and controlled cross-account sharing of encrypted AMIs for standardized golden images.

  1. Establish multi-account governance with AWS Organizations and AWS Control Tower
  1. Author SCPs to enforce global guardrails with exceptions
  1. Deploy Config conformance packs with automated remediation
  1. Centralize detection with Security Hub, GuardDuty, and Inspector
  1. Enforce least privilege IAM with permission boundaries and ABAC
  1. Harden network paths with VPC endpoints and PrivateLink
  1. Implement KMS key strategy with grants for cross-account AMIs
  1. Standardize secrets rotation and cross-account access

This architecture gives Expedia Group enforceable guardrails, provable compliance, automated fixes, and tightly controlled data access paths, all while preserving developer velocity through safe self-service and private connectivity.


Monitoring · All domains · Containers and Serverless Operations

Practice these questions → · Timed practice on ExamRoll.io →

Pass the whole exam — not just this question

You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.

Pass your exam →

Browse Amazon →

Related guides

All-in-one access

One subscription. Every exam.

Every plan unlocks unlimited answer search, practice tests, AI explanations, and the full resource library — in 20+ languages.

Monthly
24.87
Just €0.83/day
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

Best value
12 months
179.87
Just €0.49/daySave 40%
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

✓ Free plan included · ✓ Cancel anytime · ✓ All plans unlock the full product