aws DOP-C02: AWS Certified DevOps Engineer – Professional · Practice questions

Domain 6: Security and Compliance Practice Questions

Review 10 sample questions with their correct answers and explanations. Sign up free to continue with the full topic quiz.

Sign up free for the full quiz

Question 1

A company wants to detect and automatically remediate EC2 instances that are missing required security patches across accounts, with a compliance report for auditors. Which approach fits BEST?

  1. Disable automatic updates to keep instances stable
  2. Replace instances only when they are compromised
  3. Patch Manager across the organization with compliance reporting — Correct
  4. Ask each team to patch instances manually and report in a spreadsheet

Correct answer

Patch Manager across the organization with compliance reporting

Explanation

Patch Manager across the organization automates patching and reports compliance. Manual work is inconsistent. Waiting for compromise is unacceptable. Disabling updates leaves vulnerabilities.

Question 2

A company wants to stop developers from deleting production CloudWatch log groups while still allowing them to read logs. Which approach fits BEST?

  1. A weekly backup of log groups to S3
  2. A dashboard that shows when log groups are deleted
  3. A naming convention for production log groups
  4. An SCP or permission set that denies logs:DeleteLogGroup in production — Correct

Correct answer

An SCP or permission set that denies logs:DeleteLogGroup in production

Explanation

Denying the delete action prevents removal while reads remain allowed. Dashboards, backups, and naming do not prevent deletion.

Question 3

A company stores secrets in Secrets Manager and wants to detect secrets that have not been rotated in 90 days. Which approach fits BEST?

  1. The secretsmanager-secret-periodic-rotation Config rule — Correct
  2. Amazon Inspector scanning of Secrets Manager
  3. CloudWatch dashboards for each secret
  4. A monthly manual review of each secret's creation date

Correct answer

The secretsmanager-secret-periodic-rotation Config rule

Explanation

This Config rule checks rotation within a period. Manual reviews are slow. Inspector does not scan secrets. Dashboards do not evaluate rotation.

Question 4

A company uses Amazon ECR. It wants to make sure that images pulled by EKS come only from its own ECR repositories in approved accounts. Which approach fits BEST?

  1. Use a NAT gateway so that pods can pull images from any registry
  2. An admission policy allowing only approved ECR registries — Correct
  3. Store image names in a spreadsheet and check them before each deployment
  4. Allow any public registry and rely on runtime monitoring to detect bad images

Correct answer

An admission policy allowing only approved ECR registries

Explanation

Admission policies restrict image sources, and repository policies control access. Public registries, open egress, and spreadsheets do not enforce sources.

Question 5

A company must encrypt all data at rest in its CI/CD system, including CodeBuild logs, artifacts, and cache. Which configuration fits BEST?

  1. Customer managed KMS keys for artifacts, cache, and log groups — Correct
  2. Rely on developers to encrypt files manually before committing them
  3. Store build artifacts in a public bucket and protect them with obscure names
  4. Disable build logs so that there is nothing to encrypt

Correct answer

Customer managed KMS keys for artifacts, cache, and log groups

Explanation

Customer managed keys on artifact stores, caches, and log groups encrypt CI/CD data at rest. Manual encryption is unreliable. Public buckets and disabled logs are inappropriate.

Question 6

A company needs to audit every API call in all accounts and Regions and keep the logs tamper-evident. Which configuration fits BEST? (Choose TWO.)

  1. AWS Budgets in the management account
  2. CloudTrail log file integrity validation — Correct
  3. An organization trail for all Regions delivered to a central log archive bucket — Correct
  4. VPC flow logs in every subnet
  5. CloudWatch dashboards in each account

Correct answer

CloudTrail log file integrity validation; An organization trail for all Regions delivered to a central log archive bucket

Explanation

An organization trail captures all accounts and Regions, and integrity validation makes logs tamper-evident. Dashboards, flow logs, and budgets do not audit API calls.

Question 7

A company wants to enforce that all Lambda functions in production use only code signed by the CI/CD pipeline. Which feature fits BEST?

  1. Lambda reserved concurrency set to 0 for unsigned functions
  2. Lambda code signing with an AWS Signer profile and an enforce policy — Correct
  3. Lambda environment variables encrypted with a customer managed key
  4. Lambda function URLs with AWS_IAM authorization

Correct answer

Lambda code signing with an AWS Signer profile and an enforce policy

Explanation

Code signing with an enforce policy rejects unsigned code. Concurrency, environment variable encryption, and function URL auth do not verify code.

Question 8

A company wants its pipeline to detect hardcoded secrets and vulnerable code in Lambda functions before deployment and continuously afterward. Which approach fits BEST?

  1. Encrypt the deployment package with KMS to remove the hardcoded secrets
  2. Store all code in a private repository, which prevents vulnerabilities
  3. Rely on peer code reviews only, without automated scanning
  4. Inspector code scanning in the pipeline plus Inspector Lambda scanning — Correct

Correct answer

Inspector code scanning in the pipeline plus Inspector Lambda scanning

Explanation

Automated code scanning in the pipeline and continuous Lambda scanning catch issues. Reviews alone miss issues. Private repositories and encryption do not remove vulnerabilities or secrets.

Question 9

A company needs to rotate RDS credentials automatically, and applications must keep working during rotation. Which approach fits BEST?

  1. A cron job that changes the password in the database once a month
  2. Secrets Manager rotation with the alternating users strategy — Correct
  3. Disabling rotation and using a very long password
  4. Rotating credentials manually and redeploying all applications

Correct answer

Secrets Manager rotation with the alternating users strategy

Explanation

Alternating users rotation keeps one valid credential at all times. Cron jobs and manual rotation risk outages. No rotation does not meet the requirement.

Question 10

A company wants to block deployments of IAM policies that grant wildcard actions on all resources, as part of its CI pipeline. Which approach fits BEST?

  1. Use AWS Trusted Advisor to delete wildcard policies automatically
  2. IAM Access Analyzer policy validation and custom checks in CI — Correct
  3. Deploy the policies and review them in the IAM console the following week
  4. Store the policies in a private repository so that only trusted people can edit them

Correct answer

IAM Access Analyzer policy validation and custom checks in CI

Explanation

Access Analyzer checks validate policies and detect broadened access before deployment. Post-deployment reviews are late. Private repositories do not validate. Trusted Advisor does not delete policies.

Ready for the full quiz?

Create a free QuizAnalyst account to practice the complete question set and save your progress.

Sign up free for the full quiz