AWS Security Drill, a Weekly Recon series.

Last Friday was Recon Labs #1, the private S3 bucket that still leaks. This is a standalone CloudTrail tamper drill you can finish the same day. Next Friday, Nov 27, is Recon Labs #2, the leaked access key that still works.

CloudTrail still says logging after someone turns off the writes
CloudTrail still says logging after someone turns off the writes
A free AWS security drill from Weekly Recon. See how PutEventSelectors can set a trail to ReadOnly while IsLogging stays true, then stop that path with a permissions boundary and an EventBridge ale...
$0.00 usd

Hands-on drill · about 40 minutes (about 10 of it waiting) · costs under $0.05 · AWS CLI in a sandbox account

Correction, Nov 23, 2026: In our single-trail sandbox, EventBridge alerts stopped about 40 seconds after the trail went ReadOnly. Event History kept recording the writes. The lab and the PDF are updated. We did not test organization trails or a second trail.

Abstract Security published a write-up in March on disabling CloudTrail without calling StopLogging or DeleteTrail. The quiet move is PutEventSelectors: set ReadWriteType to ReadOnly, leave IsLogging true, and keep going. Most teams already alert on StopLogging. Fewer watch the selector change.

I ran that path this morning in the sandbox with a disposable trail and an ops role that had cloudtrail:*. PutEventSelectors to ReadOnly succeeded, get-trail-status still said IsLogging true, and a CreateUser went through. A permissions boundary Deny on the tamper APIs blocked PutEventSelectors, StopLogging, UpdateTrail and DeleteTrail on the next session, while reads still worked. EventBridge rules aimed at those APIs caught the PutEventSelectors change itself, once the rules had warmed up. In a later single-trail test, write alerts, including a small IAM write canary, stopped reaching EventBridge about 40 seconds after the trail went ReadOnly. Event History kept recording those writes. ReadOnly can drop write events from the trail's S3 files, as AWS documents.

A first try with ExcludeManagementEventSources for IAM failed with InvalidEventSelectorsException, so ReadOnly is the dependable quiet path.

AWS also posted this month on GuardDuty Custom Detection Rules over CloudTrail management events (Nov 10) and on the new CloudTrail Data Event Coverage page (Nov 3). I did not test those in this run, and I would still alert on PutEventSelectors.

In this drill you'll set a trail to ReadOnly, watch EventBridge and Event History, then stop that path with a permissions boundary:

  • 🔴 Red: use an ops role with cloudtrail:* to set the trail to ReadOnly, then create an IAM user

  • 🔍 Spot it: Event History keeps recording. The trail's selectors cut EventBridge alerts about 40 seconds after the switch.

  • 🔵 Blue: put a permissions boundary Deny on StopLogging, DeleteTrail, UpdateTrail and PutEventSelectors

  • ✅ Prove it: on a new session, those four calls return AccessDeniedException, and the error names the permissions boundary

  • 🧹 Clean up: delete the disposable trail, role, rules and queue, and check that nothing is left

Commands below are the key ones from the November 22, 2026 sandbox run, with the EventBridge finding from a November 23 rerun. The 27-page PDF has the full command blocks, plus outputs and screenshots.

A few words you'll see

  • PutEventSelectors: the API that changes what a trail records

  • IsLogging: the flag get-trail-status reports, and what the console shows as Logging On

  • Permissions boundary: an IAM policy that caps what a role can do, even if its identity policy is broader

  • Event History and EventBridge: AWS's management-event stream. Event History kept recording after the trail went ReadOnly. In our single-trail sandbox, EventBridge alerts for later writes stopped about 40 seconds after the switch.

Before you start

You need a sandbox AWS account in us-east-1, the AWS CLI, and permission to create a disposable trail, an IAM role, EventBridge rules and an SQS queue. Please do not use production, and never point this at a live trail or a real SIEM destination.

💵 Cost: under $0.05 if you clean up the same day.

The idea

  • PutEventSelectors can set ReadWriteType to ReadOnly and leave IsLogging true. get-trail-status and the trail page can still look fine.

  • Event History kept recording after the trail went ReadOnly. In our single-trail sandbox, EventBridge alerts for later writes stopped about 40 seconds after the switch. Give new EventBridge rules a few minutes to start matching.

  • A permissions boundary Deny on the tamper APIs stopped the same role on a new session, even though its identity policy still had cloudtrail:*.

  • ReadOnly can drop write events from the trail's S3 files, as AWS documents. Do not make IsLogging your only health check.

Part 1: Set up (5 minutes)

Create a disposable trail, an ops role with cloudtrail:* , and two EventBridge rules that write to one SQS queue: one for trail-tamper APIs, and one write-event canary on the drill users. The PDF has those commands. Give the new EventBridge rules a few minutes to start matching before you move on.

🔴 Part 2: RED, set the trail to ReadOnly (3 minutes)

Assume the ops role, then run:

aws cloudtrail get-trail-status --name "$TRAIL" --query IsLogging --output text
aws cloudtrail put-event-selectors --trail-name "$TRAIL" \
  --event-selectors '[{"ReadWriteType":"ReadOnly","IncludeManagementEvents":true}]'
aws cloudtrail get-trail-status --name "$TRAIL" --query IsLogging --output text
aws iam create-user --user-name "$BACKDOOR"

In the run, IsLogging was true before and after, PutEventSelectors returned ReadOnly, and CreateUser went through. In the console, CloudTrail → Trails → the drill trail still said Logging On, and Event selectors showed Management events: Read-only.

🔍 Part 3: Spot it in EventBridge and Event History (5 minutes)

Switch back to your admin profile and look at the SQS queue and Event History. Event History kept recording the selector change and the IAM writes. EventBridge can catch the PutEventSelectors change itself. In our single-trail sandbox, later writes stopped reaching EventBridge about 40 seconds after the trail went ReadOnly.

In the November 22 run, after the rules had a few minutes to start matching, the tamper rule delivered the PutEventSelectors change, and later the denied StopLogging, UpdateTrail and DeleteTrail attempts, to SQS. Event History showed those same calls, and the writes that followed. A November 23 rerun in the same single-trail sandbox found that EventBridge alerts for later writes stopped about 40 seconds after the trail went ReadOnly. Event History kept recording them.

ReadOnly can drop write events from the trail's S3 files, as AWS documents. This run did not wait long enough after the selector change to prove a later write was absent from those files. Writes a few seconds after ReadOnly still landed in the same delivery batch.

🔵 Part 4: BLUE, attach a permissions boundary (5 minutes)

Switch back to your admin profile. Put writes back on the trail, then attach a permissions boundary so the same role can no longer call the tamper APIs, even though its identity policy still has cloudtrail:*.

aws cloudtrail put-event-selectors --trail-name "$TRAIL" \
  --event-selectors '[{"ReadWriteType":"All","IncludeManagementEvents":true}]'
aws iam put-role-permissions-boundary --role-name "$OPS_ROLE" \
  --permissions-boundary "$B_ARN"

The full boundary policy is in the PDF. In the console: IAM → Roles → the ops role → Permissions → Permissions boundary, then attach it. You can use an SCP or RCP to apply the same Deny across an organization. I used a permissions boundary in this run, and I did not test an SCP or RCP.

IAM is eventually consistent. Wait a moment, then start a new session. A permissions boundary applies at AssumeRole time, so a session you already had will not pick this up.

✅ Part 5: Prove the defense works

On that new session, these four calls should fail with AccessDeniedException, and the error should name an explicit deny in a permissions boundary. get-trail-status should still work.

aws cloudtrail put-event-selectors --trail-name "$TRAIL" \
  --event-selectors '[{"ReadWriteType":"ReadOnly","IncludeManagementEvents":true}]'
aws cloudtrail stop-logging --name "$TRAIL"
aws cloudtrail update-trail --name "$TRAIL" --s3-bucket-name "$BUCKET"
aws cloudtrail delete-trail --name "$TRAIL"
aws cloudtrail get-trail-status --name "$TRAIL" --query IsLogging --output text

In the run, all four tamper APIs returned AccessDeniedException with an explicit deny in a permissions boundary, and IsLogging still read as true.

🧹 Part 6: Clean up (please don't skip)

Delete the disposable trail, the ops role, the drill user, the EventBridge rules, the SQS queue and the boundary policy, then check the exact names are gone. The PDF has the full cleanup block and the exact-name checks.

In the test run, every exact-name lookup returned NotFound or NoSuchEntity, and the prefix and tag searches were empty.

What to take away

  • PutEventSelectors to ReadOnly keeps IsLogging true. A check that only reads IsLogging will still say true after the selector change.

  • A permissions boundary Deny on the tamper APIs stops a role that still has cloudtrail:* in its identity policy.

  • Alert on the PutEventSelectors change itself via EventBridge. Event History kept recording after the trail went ReadOnly. A write canary is useful too: if it stops arriving, check the trail's event selectors.

Alert on any successful PutEventSelectors that sets ReadWriteType to ReadOnly or None, or IncludeManagementEvents to false, plus StopLogging, DeleteTrail and Lake stop-ingestion. Deny the tamper APIs for shared ops and Terraform roles, with a permissions boundary or an SCP/RCP, and deny boundary removal too. Run a periodic IAM write canary and check that it shows up. If the canary stops arriving, check the trail's event selectors. Give new EventBridge rules a few minutes to start matching.

AWS Security Drill, from Weekly Recon by Raajhesh Kannaa Chidambaram · join.defensive.works · tested in a real AWS sandbox on November 22, 2026, and retested on November 23, 2026.

The full command blocks, plus outputs and cleanup, are in the 27-page PDF. The PDF is free.

Source: Abstract Security, Ritaban Das, Disabling CloudTrail Without StopLogging or DeleteTrail, March 31, 2026. SCARLETEEL (2023) is the classic real-world case. AWS also posted on GuardDuty Custom Detection Rules (November 10, 2026) and CloudTrail Data Event Coverage (November 3, 2026). I did not test those here.