DOP-C02 Security and Compliance Practice Question
A company uses AWS Secrets Manager to rotate database credentials automatically. The rotation is configured to occur every 30 days. The DevOps engineer notices that the latest secret version is not being used by the application after rotation. The application is an EC2 instance that retrieves the secret using the AWS SDK. The engineer checks the secret and sees that the rotation succeeded and the new version is marked as 'AWSCURRENT'. The EC2 instance role has permissions to retrieve the secret. What is the most likely reason the application is still using the old secret?
⚠ Common exam trap
DOP-C02 often tests the misconception that rotation automatically updates the application; candidates may overlook application-side caching and blame permissions or rotation configuration.
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
✓
The application caches the secret value and does not refresh it until the cache expires or the application is restarted.
The most likely reason is that the application caches the secret value in memory and does not refresh it until the cache expires or the application restarts. Even though the secret rotation succeeded and the new version is marked AWSCURRENT, the application continues to use the cached old credentials until it re-fetches the secret. This is a common issue with applications that retrieve secrets at startup and hold them.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The application caches the secret value and does not refresh it until the cache expires or the application is restarted.
Why this is correct
The application caches the secret value and does not refresh it until the cache expires or the application is restarted. This is the classic stale-secret problem: even though Secrets Manager's AWSCURRENT label points to the new version, the boto3 or AWS SDK client-side cache still holds the old value. The application will continue to use the previous database credentials until the cache TTL elapses or the process is restarted. This perfectly matches the symptom of a successful retrieval that still yields outdated credentials.
- ✗
The secret is in a different AWS Region than the application.
Why it's wrong here
If the secret were in a different AWS Region than the EC2 application, any call to GetSecretValue would fail outright with a ResourceNotFoundException, because Secrets Manager secrets are regional resources. The application would not be able to retrieve any secret value at all, let alone a stale one. Since the engineer confirmed the application is actively getting a secret value, the region mismatch cannot be the root cause; the secret must be in the same region or the call would error before returning data.
- ✗
The EC2 instance does not have permission to call secretsmanager:GetSecretValue.
Why it's wrong here
A missing secretsmanager:GetSecretValue permission on the instance's IAM role would cause an AccessDeniedException, not the return of an outdated secret. The application would fail to fetch any secret, so it could never authenticate with old credentials. The engineer explicitly verified that the IAM policy allows the desired action, eliminating this as a cause. Moreover, stale-secret symptoms point to caching behavior, not to authorization failures.
- ✗
The rotation Lambda function is not updating the secret version label to AWSCURRENT.
Why it's wrong here
If the rotation Lambda function were failing to update the AWSCURRENT version label, then calls to GetSecretValue would still return the previous secret—but the engineer confirmed the new version is indeed marked AWSCURRENT. When AWSCURRENT is correct, any fresh, uncached request would return the rotated value. Since the application receives the correct AWSCURRENT secret on API calls but still uses old credentials, the label update is not the issue. The only remaining explanation is client-side caching.
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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
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.