DOP-C02 SDLC Automation Practice Question
Which TWO actions can be used to improve the security of a CI/CD pipeline that uses AWS CodePipeline? (Choose two.)
⚠ Common exam trap
A common mix-up: candidates confuse 'simplifying permissions' (Option E) with security best practices, but the DOP-C02 exam emphasizes least privilege and role separation over convenience.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enable encryption for artifacts stored in the pipeline's S3 bucket.
AWS CodePipeline stores artifacts in an S3 bucket, and enabling default encryption (SSE-S3 or SSE-KMS) ensures that all objects at rest are encrypted, protecting sensitive build outputs and source code from unauthorized access if the bucket is compromised. This is a fundamental security best practice for data at rest in any CI/CD pipeline.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Enable encryption for artifacts stored in the pipeline's S3 bucket.
Why this is correct
By enabling default encryption on the S3 bucket used as CodePipeline's artifact store—or specifying an AWS KMS customer-managed key in the pipeline settings—all build outputs and source artifacts are encrypted at rest with either SSE-S3 or SSE-KMS. This protects sensitive data from unauthorized direct access to the bucket, even if the bucket policy or ACL is misconfigured. Using KMS adds an additional layer of control by letting you restrict which roles can decrypt artifacts and enabling CloudTrail auditing of all decrypt operations.
- ✓
Use cross-account actions with appropriate IAM roles to limit access.
Why this is correct
Configuring cross-account actions with dedicated IAM roles in each target account limits access by having the pipeline assume a role with a tightly scoped policy rather than relying on shared long-term credentials. The assumed role grants only the exact permissions needed for that action and destination, such as deploying to an ECS service or uploading to a specific S3 bucket. This follows the principle of least privilege and reduces the impact if one role is compromised, because the pipeline cannot directly act in other accounts without assuming the appropriate role.
- ✗
Configure the source action to poll for changes instead of using webhooks.
Why it's wrong here
Switching the source action from webhooks to polling is less secure because the pipeline must repeatedly authenticate to the repository using stored credentials, which remain valid and can be stolen from the pipeline's environment or logs. Webhooks are push-based and can include a shared secret token so the pipeline only accepts verified events from the source provider, eliminating the need for long-lived credentials exposed to the pipeline. Polling also introduces unnecessary risk of unauthorized changes being picked up due to missing webhook validation.
- ✗
Store secrets in the pipeline environment variables in plain text.
Why it's wrong here
Storing secrets directly in pipeline environment variables as plain text makes them visible to anyone with read access to the pipeline definition and risks leaking them in build logs or to third-party actions. Secrets such as API keys, database credentials, or signing tokens should instead be fetched dynamically from AWS Secrets Manager or Systems Manager Parameter Store at runtime, using IAM roles to control access. This approach supports secret rotation, keeps sensitive values out of the pipeline code, and ensures they are never written to storage in a recoverable format.
- ✗
Use a single IAM role for all pipeline actions to simplify permissions.
Why it's wrong here
Assigning a single IAM role to all pipeline actions obliges that role to carry the union of every action's permissions, so any stage that is compromised (e.g., a malicious build script) can abuse broad privileges to access unrelated resources or other accounts. This violates the principle of least privilege because the role is far more powerful than any one action needs. Instead, define granular roles per stage—source, build, and deploy—so that the blast radius of a compromise is limited to the specific resources each action is permitted to touch.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.