Courseiva
Security and Compliance →hardMultiple Choice

SOA-C02 Security and Compliance Practice Question

A company has a legacy application that requires access to an S3 bucket using an IAM user's access keys. The security team wants to rotate the access keys every 90 days automatically. What is the MOST efficient way to achieve this?

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

✓

Store the access keys in AWS Secrets Manager and use automatic rotation.

AWS Secrets Manager provides built-in automatic rotation for IAM user access keys, allowing you to set a 90-day rotation schedule without custom code. Option A is incorrect because while AWS Lambda with a scheduled CloudWatch Events rule could rotate keys, it requires custom code and is less efficient than the managed rotation in Secrets Manager. Option B is incorrect because a script on an EC2 instance using cron would require additional infrastructure and maintenance. Option D is incorrect because there is no built-in IAM access key rotation in the IAM console; you must manually rotate keys each time.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use AWS Lambda with a scheduled CloudWatch Events rule to rotate the keys.

    Why it's wrong here

    Lambda + CloudWatch Events can call the IAM API to create a new access key, deactivate the old one, and update whatever downstream system consumes the credentials, but this requires you to build and maintain all of the state machine logic yourself: tracking which key is active, storing the rotation state, and handling failures/rollbacks. It also forces you to reimplement Secrets Manager's built-in integration, and the scheduled trigger only means rotation happens on a timer, not automatically tied to the secret version lifecycle. The biggest miss is that this approach has no native secret storage, no versioning, and no audit trail tied to a secret—so it's a workable but fragile custom solution, not the service-native answer.

  • ✗

    Create a script that runs on an EC2 instance using cron to rotate the keys.

    Why it's wrong here

    A cron-driven script on an EC2 instance assumes the instance is always running, patched, and its IAM role has permission to rotate keys; if the instance is stopped, terminated, or the script errors mid-rotation, the corporate access credentials can be left in a broken half-rotated state with no built-in rollback. Unlike a managed secret store, this script has no integrated version history, no automatic propagation to consuming applications, and no central audit trail—you would need to hard-code or distribute the new key to every consumer yourself. This also creates an open security risk because the EC2 instance itself now holds the ability to rotate IAM user keys, effectively becoming a high-value target, while Secrets Manager provides encrypted storage and fine-grained access policies.

  • ✓

    Store the access keys in AWS Secrets Manager and use automatic rotation.

    Why this is correct

    AWS Secrets Manager natively supports automatic rotation for IAM user access keys: you configure a rotation schedule (e.g., every 30 or 90 days), and the service creates a new access key, updates the secret with the new credentials, and deletes the old key after a safe handoff—all with versioning so you can stage the new secret separately from the current one. It does not require you to write any custom scheduling code because Secrets Manager uses an AWS-provided Lambda rotation function template for IAM user keys, and it can alternate between two active keys to avoid downtime for downstream systems. This directly meets the need to 'require access to the service' without manual intervention, and it also gives you fine-grained IAM permissions to control who can access or rotate the secret, plus CloudTrail audit logs of rotation events.

  • ✗

    Enable IAM access key rotation in the IAM console.

    Why it's wrong here

    The IAM console's 'Access key rotation' feature only reports the age of existing keys and lets you manually create/delete them; it does not have any automatic rotation capability. Even the older 'rotate' button only archives an existing key and asks you to create a new one, so you are still required to update any hard-coded consumer immediately and then return to the console to delete the old key. There is no scheduling, no versioning, and no orchestration with the application that consumes the keys—so this option does not satisfy 'automatic rotation' and would still leave the legacy application broken until someone manually propagates the new credentials.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 1,169 original SOA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SOA-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 SOA-C02 exam.