Courseiva
Security Logging and MonitoringeasyMultiple SelectObjective-mapped

Logging IAM Policy Changes with CloudTrail and S3 Object Lock

A security engineer needs to ensure that all changes to IAM policies in an AWS account are logged and that the logs are immutable and cannot be deleted by any user, including the root user. Which actions should the engineer take? (Choose two.)

Quick Answer

The answer is to enable AWS CloudTrail for logging IAM policy changes and configure S3 Object Lock in compliance mode on the destination S3 bucket. CloudTrail captures all API calls that modify IAM policies, such as PutRolePolicy or AttachUserPolicy, and delivers those logs as immutable records to an S3 bucket. S3 Object Lock in compliance mode then prevents any user, including the root user, from deleting or overwriting those log objects for the specified retention period, because compliance mode locks the data with a legal hold that cannot be removed by any account administrator. On the AWS Certified Security Specialty SCS-C02 exam, this pairing tests your understanding of detective controls combined with data protection—a common trap is confusing versioning or MFA delete with true immutability, but only Object Lock in compliance mode provides a hard, irreversible barrier against deletion. Remember the mnemonic: CloudTrail captures the trail, Object Lock locks the log.

⚠ Common exam trap

Test-takers frequently confuse S3 Versioning (which provides object recovery but not immutability) with S3 Object Lock (which provides true WORM immutability), and they may also overlook that MFA Delete still allows deletion by an authorized user with MFA, not preventing root from ultimately deleting logs.

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 AWS CloudTrail to log IAM events.

AWS CloudTrail is the service specifically designed to log all API activity, including IAM policy changes. By enabling CloudTrail with management event logging, all IAM CreatePolicy, PutPolicy, DeletePolicy, and similar actions are recorded in a log file delivered to an S3 bucket. This provides an authoritative audit trail of who made the change, when, and from which source IP. Option E is correct because S3 Object Lock in compliance mode prevents any user, including the root user, from overwriting or deleting objects for the specified retention period. This ensures the log files are immutable and cannot be tampered with or deleted, fulfilling the requirement that logs cannot be deleted by any user.

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 default encryption with AWS KMS on the bucket.

    Why it's wrong here

    Encryption does not prevent deletion.

  • Enable AWS CloudTrail to log IAM events.

    Why this is correct

    CloudTrail records all IAM API calls.

  • Enable S3 Versioning on the bucket.

    Why it's wrong here

    Versioning retains previous versions but does not prevent deletion of current versions.

  • Enable multi-factor authentication (MFA) delete on the S3 bucket.

    Why it's wrong here

    MFA delete protects version deletions but not object deletions.

  • Enable S3 Object Lock in compliance mode on the bucket.

    Why this is correct

    Compliance mode prevents any user from deleting objects.

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 376 original SCS-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

Same concept, more angles

1 more way this is tested on SCS-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A security team needs to audit all changes to IAM policies in their AWS account. Which AWS service should be used?

easy
  • A.AWS Config
  • B.Amazon CloudWatch
  • C.IAM Access Analyzer
  • D.AWS CloudTrail

Why D: AWS CloudTrail is the correct service because it records all API calls made in the AWS account, including IAM policy changes such as CreatePolicy, PutRolePolicy, and AttachUserPolicy. These events are captured as CloudTrail log entries, which can be audited to track who made the change, when it was made, and from which source IP. CloudTrail is the primary service for auditing and logging all management events across AWS services.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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