PIVTR-D
RAWS playbook · Evasion and guardrails

CloudTrail, GuardDuty or guardrails disabled

The attacker stops or narrows logging and detection before acting, or detaches the service control policies (SCPs) that prevent it. Restart the trail and detectors first, then rebuild the gap from event history, which keeps recording management events while a trail is stopped.

Look here

LogSearch for
CloudTrail, cloudtrail.amazonaws.comTrail and event data store changes, which event history records even when the trail is stopped: StopLogging, DeleteTrail, UpdateTrail, PutEventSelectors, StopEventDataStoreIngestion, DeleteEventDataStore
CloudTrail, GuardDutyDetector, filter and trusted IP list changes: DeleteDetector, UpdateDetector, DisassociateFromAdministratorAccount, DeletePublishingDestination, CreateFilter, UpdateFilter, CreateIPSet, UpdateIPSet
CloudTrail, EC2, AWS Config and S3Flow log, recorder and log bucket changes: DeleteFlowLogs, StopConfigurationRecorder, DeleteConfigurationRecorder, DeleteDeliveryChannel, and PutBucketPolicy or PutBucketLifecycle on the log bucket
CloudTrail, organizations.amazonaws.com, us-east-1Policy changes, each logged in the account that made the call: DetachPolicy, UpdatePolicy, DeletePolicy, DisablePolicyType, LeaveOrganization
GuardDutyFindings for logging turned off: Stealth:IAMUser/CloudTrailLoggingDisabled, DefenseEvasion:IAMUser/AnomalousBehavior, Stealth:S3/ServerAccessLoggingDisabled
CloudTrail statusWhether the trail logs now and when it stopped, from IsLogging and TimeLoggingStopped: aws cloudtrail get-trail-status --name <trail>
Event selectorsThe trail's selectors, to compare against your baseline: aws cloudtrail get-event-selectors --trail-name <trail>

Contain

#Item
1Restart the trail from its home Region: aws cloudtrail start-logging --name <trail> --region <home-region>
2Re-enable GuardDuty in each affected Region: aws guardduty update-detector --detector-id <id> --enable
3If the attacker called DeleteDetector, create a new detector, then restore its features, filters and publishing destinations: aws guardduty create-detector --enable
4Restart AWS Config: aws configservice start-configuration-recorder --configuration-recorder-name <name>
5Recreate deleted flow logs: aws ec2 create-flow-logs --resource-type VPC --resource-ids <vpc-id> --traffic-type ALL --log-destination-type s3 --log-destination arn:aws:s3:::<bucket>/<prefix>/
6Reattach detached SCPs: aws organizations attach-policy --policy-id <p-id> --target-id <ou-or-account>
7Contain the identity that made the changes, using credential leak or account takeover

Eradicate and recover

#Item
1Check trail log integrity for the window: aws cloudtrail validate-logs --trail-arn <arn> --start-time <utc-start> --end-time <utc-end> --verbose
2Restore event selectors, GuardDuty filters, IP lists and publishing destinations to baseline
3Record the gap in coverage and fill it from event history, GuardDuty and flow logs
4Move logging to an organization trail that member accounts cannot change
5Add SCPs that deny cloudtrail:StopLogging, cloudtrail:DeleteTrail, GuardDuty detector changes, config:StopConfigurationRecorder, config:DeleteConfigurationRecorder and config:DeleteDeliveryChannel
Watch out
  • PutEventSelectors overwrites the existing selectors. A single call can silently drop data events or management events while IsLogging stays true.
  • For a multi-Region trail, StopLogging and StartLogging work only from the home Region.
Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.