CloudTrail Gap Troubleshooter
Activation
Activate this skill when the user reports a CloudTrail logging gap.
Trigger phrases: "CloudTrail missing events", "CloudTrail not logging",
"CloudTrail trail stopped", "CloudTrail log delivery delayed", "CloudTrail
data events missing", "CloudTrail Insights not working", "CloudTrail org
trail gap", "CloudTrail member account not logged", "CloudTrail lookup-events
returns empty".
Mindset
One-line takeaway: "CloudTrail is logging but I can't find my event" is
almost always a data-events-vs-management-events misunderstanding or a
region/trail scope mismatch — NOT a CloudTrail outage. Diagnose scope and
configuration before assuming an outage.
Three facts make CloudTrail troubleshooting different:
- Management events are on by default; data events are opt-in. Most
"missing events" complaints are data events that were never configured.
- A trail has TWO independent health signals.
describe-trails reports
configuration; get-trail-status reports active logging state. A
correctly-configured trail can be silently stopped. Always check both.
- CloudTrail Lake and S3 delivery are different pipelines. S3 averages
5 min (up to 15). Lake is near-real-time but selector-filtered. An event
missing from Lake might be in S3.
Quick reference — symptom to failure category
| Observed state |
Failure category |
First probe |
Specific API not found by lookup-events |
MISSING_DATA_EVENTS / MULTI_REGION_GAP |
Is the event source in the trail's management filter? Is it a data event? |
No log files in S3; isLogging: false |
TRAIL_NOT_LOGGING |
get-trail-status; check bucket policy for deny |
| Log files arriving but multi-hour latency |
DELIVERY_DELAYED |
Compare latestDeliveryTime to now |
| Suspicious write activity but no Insights finding |
INSIGHTS_DISABLED |
list-insights-selectors configured? Trail isLogging? |
| Org trail missing specific member account(s) |
ORG_TRAIL_GAP |
Member in org? Delegated admin? Shadow trail? |
| Bucket policy denies CloudTrail writes |
BUCKET_POLICY_BLOCKING |
get-bucket-policy — explicit Deny on cloudtrail:PutObject |
Quick navigation
- Step 0 — Capture the failure signal
- Step 1 — Map symptom to category (A-G)
- Step 2 — MISSING_DATA_EVENTS
- Step 3 — TRAIL_NOT_LOGGING
- Step 4 — DELIVERY_DELAYED
- Step 5 — INSIGHTS_DISABLED
- Step 6 — ORG_TRAIL_GAP
- Step 7 — MULTI_REGION_GAP / BUCKET_POLICY_BLOCKING
- Step 8 — Root-cause catalog
- Step 9 — Verify the fix
- Step 10 — Decide VERDICT
Process — Diagnostic decision tree (apply in order)
Step 0: Capture the failure signal
Gather these four pieces. Each step below branches on which is present.
| Signal |
Source |
Why required |
| Trail name(s) |
User-provided or describe-trails |
All status calls need this |
| Scope of gap (account / region / event) |
User symptom |
Narrows the dimension |
| Expected event source + API |
User-provided |
Determines data vs management event |
| Trail status + latest delivery |
get-trail-status |
Drives TRAIL_NOT_LOGGING vs DELIVERY_DELAYED |
If the trail name is unknown, run:
aws cloudtrail describe-trails --query 'trailList[*].{name:Name,multiRegion:IsMultiRegionTrail,org:IsOrganizationTrail,s3Bucket:S3BucketName,kmsKey:KmsKeyId}'
aws cloudtrail get-trail-status --name <trail-name>
aws cloudtrail lookup-events --max-results 5 --start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ) --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ)
Step 1: Identify the symptom category
| Category |
Signature |
Diagnostic step |
| A. MISSING_DATA_EVENTS |
Operator expects data-plane event (GetObject, PutItem, Invoke); absent; management events fine |
Step 2 |
| B. TRAIL_NOT_LOGGING |
isLogging: false; no log files in S3 for hours; OR trail missing from describe-trails |
Step 3 |
| C. DELIVERY_DELAYED |
isLogging: true but latestDeliveryTime lags > 15 min (mgmt) or > 1h (data) |
Step 4 |
| D. INSIGHTS_DISABLED |
Expected Insights finding; none appears; baseline elapsed |
Step 5 |
| E. ORG_TRAIL_GAP |
Org trail logs management + most members; specific member missing |
Step 6 |
| F. MULTI_REGION_GAP |
Single-region trail; events from other region missing |
Step 7 |
| G. BUCKET_POLICY_BLOCKING |
isLogging: true but no files in S3; policy has Deny or missing Allow |
Step 7 |
Scope rule. When multiple categories apply, narrow broadest to most
specific. A TRAIL_NOT_LOGGING trail produces no events at all — resolve B
before diagnosing A or F.
Step 2: MISSING_DATA_EVENTS diagnostic
The operator expects a data-plane event (GetObject, PutItem, Invoke) but it
is absent. The trail is logging management events correctly.
Management vs data events quick reference:
| Expected event |
Type |
Where to configure |
S3 GetObject / PutObject |
Data |
DataResources with Type: AWS::S3::Object |
S3 CreateBucket / PutBucketPolicy |
Management |
Default (no config needed) |
Lambda Invoke |
Data |
DataResources with Type: AWS::Lambda::Function |
DynamoDB GetItem / PutItem |
Data |
DataResources with Type: AWS::DynamoDB::Table |
CloudTrail LookupEvents itself |
Not logged |
CloudTrail does not log its own read APIs |
IAM GetUser / ListRoles |
Management (read) |
Default — but excluded if ReadWriteType: WriteOnly |
Diagnostic walk:
- Confirm management vs data event. Management = control-plane
(CreateBucket, RunInstances). Data = data-plane (GetObject, PutItem,
Invoke).
- Read event selectors:
aws cloudtrail get-event-selectors --trail-name <trail>.
ReadWriteType: All + IncludeManagementEvents: true — logs both.
ReadWriteType: ReadOnly or WriteOnly — limits direction.
DataResources empty/absent — data events NOT configured.
- Verify in S3 delivery directly: list log objects around the event time
and grep for the event name.
- For Lambda Invoke: check whether selector covers account-level
(
arn:aws:lambda) or function-level.
Common fix patterns:
- S3 data events: add
DataResources with Type: AWS::S3::Object,
Values: ["arn:aws:s3"]. Use advanced selectors for per-bucket scoping.
- Lambda data events:
Type: AWS::Lambda::Function, Values: ["arn:aws:lambda"].
- DynamoDB:
Type: AWS::DynamoDB::Table, Values: ["arn:aws:dynamodb"].
- For cost control: prefer
WriteOnly data events; scope to specific ARNs.
Diagnostic commands:
Canonical CLI for this step (get-event-selectors, S3 log grep, CloudTrail Lake query) — references/diagnostic-commands.md.
Cost warning. Data events are 10-100x more voluminous than management
events. Always scope DataResources.Values to specific ARN prefixes.
See references/diagnostic-commands.md for canonical CLI commands per category.
Step 3: TRAIL_NOT_LOGGING diagnostic
The trail is not delivering any events. Either isLogging: false, or
isLogging: true but no files appearing in S3.
| Sub-symptom |
Root cause |
Probe |
isLogging: false |
Trail explicitly stopped or never started |
start-logging --name <trail> |
Trail missing from describe-trails |
Trail deleted (config retained 30 days) |
--show-shadow-trails |
isLogging: true but no delivery |
S3 bucket policy blocking |
Step 7 (BUCKET_POLICY_BLOCKING) |
| KMS access denied errors |
KMS key policy missing CloudTrail principal |
Verify KMS policy has cloudtrail.amazonaws.com with kms:GenerateDataKey* |
Org trail isLogging: false in member |
Member shadow trail overriding |
Check shadow trails in member account |
Diagnostic walk:
- Read
get-trail-status first. isLogging is the single most important signal.
- If
false: aws cloudtrail start-logging --name <trail>. Re-check status.
- If
true but no delivery: check S3 bucket policy (Step 7) and KMS key policy.
- If trail missing: check shadow trails (
--show-shadow-trails). Recreate if needed.
- For org trails: member accounts see the org trail as a "shadow." If a
member stops logging on the shadow, that member's events stop.
Diagnostic commands:
Canonical CLI for this step (get-trail-status, shadow trails, KMS key policy check, start-logging) — references/diagnostic-commands.md.
Common fixes:
- Trail stopped:
start-logging; add CloudWatch alarm on
NumberOfNotificationsDelivered.
- KMS missing CloudTrail: add statement allowing
cloudtrail.amazonaws.com
to kms:GenerateDataKey* and kms:DescribeKey.
- Trail deleted: recreate from IaC. Note: Terraform
aws_cloudtrail does
NOT auto-start; the start_logging resource must be included.
Step 4: DELIVERY_DELAYED diagnostic
Log files arriving but with latency beyond CloudTrail's targets.
| Sub-symptom |
Root cause |
Action |
| Management events delayed 15-30 min |
Normal can be up to 15 min; > 15 unusual |
Check AWS Health dashboard |
| Data events delayed 30-60 min |
Data events inherently higher-latency |
Expected unless > 1 hour consistently |
| All events delayed > 1 hour |
Service issue OR cross-region bucket |
Check bucket region vs trail HomeRegion |
| Org trail members delayed vs mgmt acct |
Per-account aggregation delay (~5-15 min) |
Expected; if > 30 min check quotas |
| Lake fast but S3 slow |
Different pipelines by design |
Use Lake/EventBridge for real-time needs |
Diagnostic walk:
- Compare
latestDeliveryTime to now via get-trail-status.
- Check bucket region vs trail
HomeRegion — cross-region adds latency.
- Check AWS Health dashboard for CloudTrail service events.
- For org trails: member delay of 5-15 min after management account is normal.
Step 5: INSIGHTS_DISABLED diagnostic
Operator expects Insights finding for anomalous write activity; none appears.
| Sub-symptom |
Root cause |
Probe |
| No findings ever |
Insights not enabled |
get-insight-selectors — should return enabled selectors |
| No findings in first 7 days |
Baseline period not elapsed |
Expected; wait 7 days |
| No findings for write data events |
Insights only analyzes write MANAGEMENT events |
Expected limitation |
| Recently re-enabled |
Baseline resets on re-enable |
Wait another 7 days |
| Insights on stopped trail |
Trail must be isLogging: true |
Fix Step 3 first |
Diagnostic walk:
- Read
aws cloudtrail get-insight-selectors --trail-name <trail>.
- Interpret:
InsightsEnabled: false -> OFF. true with event source ->
Insights for that source.
- Check baseline period (7 days of management events required).
- Verify trail is actively logging — Insights only processes active trails.
- Check S3:
aws s3 ls s3://<bucket>/CloudTrail-Insight/ — if prefix
doesn't exist, no findings delivered.
Fix: aws cloudtrail put-insight-selectors --trail-name <trail> --insight-selectors '[{"InsightType":"ApiCallRateInsight"},{"InsightType":"ApiErrorRateInsight"}]'.
For per-source scoping (2024+), use list-insights-selectors /
put-insights-selectors (newer API).
Step 6: ORG_TRAIL_GAP diagnostic
Org trail logs management account and most members. Specific member missing.
| Sub-symptom |
Root cause |
Probe |
| All members missing |
Org trail isLogging: false in mgmt account |
get-trail-status in mgmt account |
| Specific member missing |
Member shadow trail isLogging: false |
In member: describe-trails --show-shadow-trails |
| New members not logged |
Trail created before auto-enable existed |
start-logging from member, or enable org auto-start |
| Member left org |
Account removed from Organizations |
list-accounts — verify Status: ACTIVE |
| Delegated admin confusion |
Trail might be in delegated admin, not mgmt |
list-delegated-administrators --service-principal cloudtrail.amazonaws.com |
| Member's own trail overrides org trail |
Member trail shadows org trail |
Disable member's trail or accept different bucket |
| SCP blocking CloudTrail |
SCP denies cloudtrail APIs in member |
describe-policy --policy-id <scp-id> |
Diagnostic walk:
- Confirm org trail:
describe-trails --query 'trailList[?IsOrganizationTrail]'.
- Check trail is logging in management account.
- In affected member:
describe-trails --show-shadow-trails — look for
IsShadowTrail: true with IsLogging: false.
- Verify member is in org with
Status: ACTIVE.
- Check for delegated admin: if configured, org trail must be in that
account, not management.
- Check SCPs that might block CloudTrail in the member.
Diagnostic commands:
Canonical CLI for this step (org trail status, delegated admins, member shadow trails, org membership, SCPs) — references/diagnostic-commands.md.
Common fixes:
- Member shadow stopped:
start-logging --name <org-trail> from the member
account (works on shadow trails).
- Delegated admin confusion: consolidate to ONE org trail in EITHER
management OR delegated admin, not both.
- New members: enable "Apply to all accounts" + "Enable for new accounts"
in console, or script start-logging on new members.
Step 7: MULTI_REGION_GAP and BUCKET_POLICY_BLOCKING
7a. MULTI_REGION_GAP
Trail is single-region (IsMultiRegionTrail: false). Events from other
regions not logged.
| Sub-symptom |
Root cause |
Probe |
| Events from other region missing |
IsMultiRegionTrail: false |
describe-trails --query 'trailList[*].{multi:IsMultiRegionTrail,home:HomeRegion}' |
| Global service events (IAM, STS) missing |
Single-region trail not in us-east-1 |
Check IncludeGlobalServiceEvents + HomeRegion |
Fix: aws cloudtrail update-trail --name <trail> --is-multi-region-trail.
Also --include-global-service-events if IAM/STS needed. Global service
events are delivered only to the trail's home region (us-east-1 commercial).
7b. BUCKET_POLICY_BLOCKING
Trail claims isLogging: true but no log files land in S3.
| Sub-symptom |
Root cause |
Probe |
Explicit Deny on cloudtrail:PutObject |
Restrictive policy added later |
get-bucket-policy; grep for Deny |
Missing Allow for cloudtrail.amazonaws.com |
Policy accidentally removed |
Look for Allow with Principal.Service: cloudtrail.amazonaws.com |
| KMS key policy missing CloudTrail |
KMS doesn't allow kms:GenerateDataKey* |
get-key-policy --policy-name default |
| Cross-account bucket |
Bucket policy must include trail's account |
Verify Resource ARN path |
Diagnostic walk:
- Read bucket policy:
aws s3api get-bucket-policy --bucket <bucket>.
- Look for the canonical CloudTrail Allow: both
s3:GetBucketAcl and
s3:PutObject with Condition: StringEquals: s3:x-amz-acl: bucket-owner-full-control.
The bucket-owner-full-control condition is a common omission.
- Check for explicit Deny statements overriding the Allow.
- If KMS configured: verify key policy allows
cloudtrail.amazonaws.com
to kms:GenerateDataKey*.
- For cross-account bucket: policy must include trail's account ID in
Resource ARN path.
See references/failure-decision-tree.md for detailed policy examples.
Step 8: Map to root-cause catalog
| # |
Root cause |
Category |
Fix pattern |
| 1 |
Data events not configured (S3/Lambda/DynamoDB) |
MISSING_DATA_EVENTS |
Add DataResources to event selectors |
| 2 |
Trail stopped (isLogging: false) |
TRAIL_NOT_LOGGING |
start-logging; add CloudWatch alarm |
| 3 |
Trail deleted |
TRAIL_NOT_LOGGING |
Recreate from IaC; --show-shadow-trails |
| 4 |
Bucket policy missing Allow or explicit Deny |
BUCKET_POLICY_BLOCKING |
Add canonical statements with bucket-owner-full-control |
| 5 |
KMS key policy missing CloudTrail |
BUCKET_POLICY_BLOCKING |
Add KMS statement for cloudtrail.amazonaws.com |
| 6 |
Single-region trail; events from other regions missing |
MULTI_REGION_GAP |
update-trail --is-multi-region-trail |
| 7 |
Insights not enabled |
INSIGHTS_DISABLED |
put-insight-selectors |
| 8 |
Insights baseline not elapsed |
INSIGHTS_DISABLED |
Wait 7 days |
| 9 |
Org trail shadow stopped in member |
ORG_TRAIL_GAP |
start-logging from member |
| 10 |
Delegated admin confusion (two org trails) |
ORG_TRAIL_GAP |
Consolidate to ONE org trail |
| 11 |
Trail never started after IaC creation |
TRAIL_NOT_LOGGING |
Call start-logging explicitly |
| 12 |
Org trail not auto-enabled for new members |
ORG_TRAIL_GAP |
Enable org-wide auto-start |
Step 9: Verify the fix
- start-logging fixes: re-read
get-trail-status, verify isLogging: true
and latestDeliveryTime advances.
- Event-selector fixes: make a test API call (e.g.,
aws s3 cp), verify
in lookup-events within 5-15 min.
- Bucket-policy fixes: re-read policy, confirm Allow statements; wait
5-15 min for next delivery window.
- Org trail fixes: check
get-trail-status in both management and member.
- Multi-region fixes: make a test call in previously-missing region.
Step 10: Decide — ROOT_CAUSE_FOUND vs NEED_MORE_INFO vs ESCALATE
- ROOT_CAUSE_FOUND. Walk identified a specific category and config element.
Output REMEDIATION with the exact change.
- NEED_MORE_INFO. Walk reached a step where operator cannot supply
evidence. Output the list of missing inputs.
- ESCALATE. Cause is outside operator's scope (S3 bucket owned by another
team, KMS managed by security team, org trail owned by management account).
Output the escalation target and specific request.
Output format
INCIDENT: <account> / <trail-name> — <symptom>
VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE
ROOT_CAUSE: <category name> — <specific failing config element>
EVIDENCE:
- describe-trails: <field>
- get-trail-status: <field>
- get-event-selectors: <field>
- get-bucket-policy: <field>
- lookup-events: <result count or sample>
ROOT_CAUSE_CATALOG: #<N>
REMEDIATION:
1. <specific config change with field name>
2. <verification command>
3. <post-apply monitoring>
STRICT output contract
Required output structure
Every response MUST begin with this block — no preamble, no conversational
opening:
INCIDENT: <account> / <trail-name> — <symptom>
VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE
ROOT_CAUSE: <MISSING_DATA_EVENTS | TRAIL_NOT_LOGGING | DELIVERY_DELAYED | INSIGHTS_DISABLED | ORG_TRAIL_GAP | MULTI_REGION_GAP | BUCKET_POLICY_BLOCKING> — <one-sentence specific failing config element>
EVIDENCE:
- describe-trails: <quoted field value from output>
- get-trail-status: <quoted field value from output>
- get-event-selectors: <quoted field value from output, or "not fetched">
- get-bucket-policy: <quoted field value, or "not applicable">
- lookup-events: <result count or sample event>
ROOT_CAUSE_CATALOG: #<N>
REMEDIATION:
1. <exact CLI command or policy edit>
2. <verification command>
3. <post-apply monitoring step>
FORBIDDEN output patterns
- NEVER start with "Let me analyze..." — the INCIDENT line is FIRST, always.
- NEVER use lowercase verdict values — emit
ROOT_CAUSE_FOUND,
NEED_MORE_INFO, or ESCALATE.
- NEVER omit EVIDENCE — the judge requires direct quotes from
describe-trails, get-trail-status, or get-event-selectors output.
Paraphrasing is not acceptable; quote the actual field value.
- NEVER declare ROOT_CAUSE_FOUND without referencing BOTH
describe-trails
AND get-trail-status in EVIDENCE — a correctly-configured trail can be
silently stopped.
- NEVER confuse management events with data events in the ROOT_CAUSE —
GetObject, PutItem, Invoke are data events; CreateBucket and RunInstances
are management events. Wrong event type is a hard error.
Perfect example output
INCIDENT: 111111111111 / corp-trail — operator expects GetObject events for audit; lookup-events returns zero GetObject events for any S3 bucket
VERDICT: ROOT_CAUSE_FOUND
ROOT_CAUSE: MISSING_DATA_EVENTS — trail's event selectors do not include S3 DataResources; only management events are logged
EVIDENCE:
- describe-trails: corp-trail IsMultiRegionTrail: true, IsLogging: true (trail is healthy)
- get-trail-status: IsLogging: true, LatestDeliveryTime: 2026-08-10T14:22:00Z (delivery is working)
- get-event-selectors: [{"ReadWriteType":"All","IncludeManagementEvents":true,"DataResources":[]}] (empty DataResources = no data events configured)
- get-bucket-policy: not applicable (delivery is working; bucket policy is not the issue)
- lookup-events AttributeKey=EventName,AttributeValue=GetObject: 0 results in last 24h
- lookup-events AttributeKey=EventName,AttributeValue=CreateBucket: 4 results in last 24h (management events flowing; data events absent)
ROOT_CAUSE_CATALOG: #1 (data events not configured)
REMEDIATION:
1. Add an S3 data event selector to the trail:
aws cloudtrail put-event-selectors --trail-name corp-trail --event-selectors '[{"ReadWriteType":"All","IncludeManagementEvents":true,"DataResources":[{"Type":"AWS::S3::Object","Values":["arn:aws:s3"]}]}]'
2. Verify by making a test S3 read and checking lookup-events in 5-15 minutes:
aws s3 cp s3://my-bucket/test . && aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=GetObject --start-time $(date -u -v-20M +%Y-%m-%dT%H:%M:%SZ)
3. Monitor S3 bucket size — adding data events significantly increases CloudTrail log volume and cost. Consider scoping to specific buckets via advanced-event-selectors if cost is a concern.
Anti-Patterns — NEVER (top 5)
- NEVER assume a CloudTrail outage when specific events are missing — almost
always scope/configuration (data events, region), not an outage.
- NEVER confuse
describe-trails (configuration) with get-trail-status
(active logging state) — a correctly-configured trail can be silently
stopped. Always read both.
- NEVER conclude "data events not configured" without reading
get-event-selectors — the trail may have advanced event selectors that
look different but achieve the same thing.
- NEVER enable
DataResources: ["arn:aws:s3"] (all S3 data events) without
warning about cost — scope to specific bucket ARNs.
- NEVER recommend deleting and recreating a trail as a first fix — deletion
loses event history references and forces an Insights re-baseline. Fix
configuration in place.
See references/failure-decision-tree.md for additional anti-patterns and
edge cases (org trail ownership, global service events region, CloudTrail
Lake vs S3, Insights limitations).
Recent AWS features (2024-2026)
→ All seven updates (Lake adoption, Lake federation, enhanced Insights selectors, org auto-enable, Amazon Q integration, S3 managed bucket policies, delete-trail shadow retention) — references/advanced-patterns.md.
References
references/failure-decision-tree.md — full symptom-to-cause walk with
worked examples per category, detailed S3/KMS policy examples, and
additional anti-patterns
references/diagnostic-commands.md — canonical command script for each
failure category
References (load on demand)
references/diagnostic-commands.md — canonical per-category CLI script (pre-existing) + the Step 2 / Step 3 / Step 6 command blocks moved from SKILL.md
references/advanced-patterns.md — recent AWS features affecting gap diagnosis (2024-2026)
references/failure-decision-tree.md — full symptom-to-cause walk, worked examples per category, S3/KMS policy examples, anti-patterns (pre-existing)
Domain
AWS CloudOps / Governance, Audit Logging & Compliance.
AWS documentation
1---2name: cloudtrail-gap-troubleshooter3description: Diagnoses AWS CloudTrail logging gaps and missing events. Covers events missing because data events (S3/Lambda/DynamoDB) were never configured, multi-region scope mismatches, trails that report IsLogging true but never deliver (S3 bucket policy missing bucket-owner-full-control, KMS key policy missing the cloudtrail principal, explicit deny), silently stopped trails (inadvertent stop-logging, IaC that omitted start-logging), delayed delivery beyond the 5-15 minute window, CloudTrail Insights not firing (selectors missing, baseline not elapsed), and org trails that miss specific member accounts (member shadow trail stopped, delegated-admin confusion, member left org). Emits a deterministic verdict (ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE) with evidence from describe-trails, get-trail-status, get-event-selectors, lookup-events, list-insights-selectors, and get-bucket-policy. Use when a trail is silent, events are missing, Insights is not firing, or a member account is not being logged by the org trail.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline diagnosis works on supplied describe-trails / get-trail-status / get-bucket-policy JSON. Live-account diagnosis uses aws cloudtrail describe-trails, get-trail-status, lookup-events, get-insight-selectors, list-insights-selectors, aws s3api get-bucket-policy, aws organizations list-delegated-administrators, and aws logs filter-log-events (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/cloudtrail-gap-troubleshooter8 domain: aws-cloudops9 complexity: medium10 requires_llm: 'true'11 phase: '2'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Governance15 task_type: troubleshoot16 skill_class: capability17 lifecycle_status: active18 verdict_shape: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE19 when_to_use: Diagnosing why a CloudTrail trail is silent (no log files being delivered to S3), why specific API calls are missing from a trail (data events not configured, single-region trail in the wrong region), why log delivery is delayed beyond the expected 5-15 minute window, why CloudTrail Insights is not firing on suspicious write activity, or why an organization trail is not logging for one or more member accounts.20 activation_triggers: CloudTrail missing events, CloudTrail not logging, CloudTrail trail stopped, CloudTrail log delivery delayed, CloudTrail data events missing, CloudTrail Insights not working, CloudTrail org trail gap, CloudTrail member account not logged, CloudTrail S3 bucket policy, CloudTrail lookup-events returns empty, CloudTrail audit gap21 invocation_schema: 'Input: either (a) a symptom description (trail name, observed gap, any error strings from the console or lookup-events), OR (b) a live-account scenario where the agent runs aws cloudtrail describe-trails / get-trail-status / lookup-events / list-insights-selectors / aws s3api get-bucket-policy to gather evidence. Output: a deterministic INCIDENT / VERDICT / ROOT_CAUSE / EVIDENCE / REMEDIATION block where VERDICT ∈ {ROOT_CAUSE_FOUND, NEED_MORE_INFO, ESCALATE} and ROOT_CAUSE names the specific failure category (MISSING_DATA_EVENTS / TRAIL_NOT_LOGGING / DELIVERY_DELAYED / INSIGHTS_DISABLED / ORG_TRAIL_GAP / MULTI_REGION_GAP / BUCKET_POLICY_BLOCKING) and the offending config element.'22 version: 0.1.023 author: Jacky Chan — AWS Community Builder24 keywords: CloudTrail, audit logging, data events, management events, missing events, trail not logging, log delivery delay, CloudTrail Insights, CloudTrail Lake, organization trail, delegated admin, S3 bucket policy, log file validation, multi-region trail25 tags: cloudtrail, governance, troubleshoot, logging-gap, audit, compliance, org-trail, insights26---2728# CloudTrail Gap Troubleshooter2930## Activation3132Activate this skill when the user reports a CloudTrail logging gap.33Trigger phrases: "CloudTrail missing events", "CloudTrail not logging",34"CloudTrail trail stopped", "CloudTrail log delivery delayed", "CloudTrail35data events missing", "CloudTrail Insights not working", "CloudTrail org36trail gap", "CloudTrail member account not logged", "CloudTrail lookup-events37returns empty".3839## Mindset4041**One-line takeaway:** "CloudTrail is logging but I can't find my event" is42almost always a data-events-vs-management-events misunderstanding or a43region/trail scope mismatch — NOT a CloudTrail outage. Diagnose scope and44configuration before assuming an outage.4546Three facts make CloudTrail troubleshooting different:4748- **Management events are on by default; data events are opt-in.** Most49 "missing events" complaints are data events that were never configured.50- **A trail has TWO independent health signals.** `describe-trails` reports51 configuration; `get-trail-status` reports active logging state. A52 correctly-configured trail can be silently stopped. Always check both.53- **CloudTrail Lake and S3 delivery are different pipelines.** S3 averages54 5 min (up to 15). Lake is near-real-time but selector-filtered. An event55 missing from Lake might be in S3.5657## Quick reference — symptom to failure category5859| Observed state | Failure category | First probe |60|---|---|---|61| Specific API not found by `lookup-events` | MISSING_DATA_EVENTS / MULTI_REGION_GAP | Is the event source in the trail's management filter? Is it a data event? |62| No log files in S3; `isLogging: false` | TRAIL_NOT_LOGGING | `get-trail-status`; check bucket policy for deny |63| Log files arriving but multi-hour latency | DELIVERY_DELAYED | Compare `latestDeliveryTime` to `now` |64| Suspicious write activity but no Insights finding | INSIGHTS_DISABLED | `list-insights-selectors` configured? Trail `isLogging`? |65| Org trail missing specific member account(s) | ORG_TRAIL_GAP | Member in org? Delegated admin? Shadow trail? |66| Bucket policy denies CloudTrail writes | BUCKET_POLICY_BLOCKING | `get-bucket-policy` — explicit Deny on `cloudtrail:PutObject` |6768## Quick navigation6970- **Step 0** — Capture the failure signal71- **Step 1** — Map symptom to category (A-G)72- **Step 2** — MISSING_DATA_EVENTS73- **Step 3** — TRAIL_NOT_LOGGING74- **Step 4** — DELIVERY_DELAYED75- **Step 5** — INSIGHTS_DISABLED76- **Step 6** — ORG_TRAIL_GAP77- **Step 7** — MULTI_REGION_GAP / BUCKET_POLICY_BLOCKING78- **Step 8** — Root-cause catalog79- **Step 9** — Verify the fix80- **Step 10** — Decide VERDICT8182## Process — Diagnostic decision tree (apply in order)8384### Step 0: Capture the failure signal8586Gather these four pieces. Each step below branches on which is present.8788| Signal | Source | Why required |89|---|---|---|90| **Trail name(s)** | User-provided or `describe-trails` | All status calls need this |91| **Scope of gap** (account / region / event) | User symptom | Narrows the dimension |92| **Expected event source + API** | User-provided | Determines data vs management event |93| **Trail status + latest delivery** | `get-trail-status` | Drives TRAIL_NOT_LOGGING vs DELIVERY_DELAYED |9495If the trail name is unknown, run:9697```bash98aws cloudtrail describe-trails --query 'trailList[*].{name:Name,multiRegion:IsMultiRegionTrail,org:IsOrganizationTrail,s3Bucket:S3BucketName,kmsKey:KmsKeyId}'99aws cloudtrail get-trail-status --name <trail-name>100aws cloudtrail lookup-events --max-results 5 --start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ) --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ)101```102103### Step 1: Identify the symptom category104105| Category | Signature | Diagnostic step |106|---|---|---|107| **A. MISSING_DATA_EVENTS** | Operator expects data-plane event (GetObject, PutItem, Invoke); absent; management events fine | Step 2 |108| **B. TRAIL_NOT_LOGGING** | `isLogging: false`; no log files in S3 for hours; OR trail missing from describe-trails | Step 3 |109| **C. DELIVERY_DELAYED** | `isLogging: true` but `latestDeliveryTime` lags > 15 min (mgmt) or > 1h (data) | Step 4 |110| **D. INSIGHTS_DISABLED** | Expected Insights finding; none appears; baseline elapsed | Step 5 |111| **E. ORG_TRAIL_GAP** | Org trail logs management + most members; specific member missing | Step 6 |112| **F. MULTI_REGION_GAP** | Single-region trail; events from other region missing | Step 7 |113| **G. BUCKET_POLICY_BLOCKING** | `isLogging: true` but no files in S3; policy has Deny or missing Allow | Step 7 |114115**Scope rule.** When multiple categories apply, narrow broadest to most116specific. A TRAIL_NOT_LOGGING trail produces no events at all — resolve B117before diagnosing A or F.118119### Step 2: MISSING_DATA_EVENTS diagnostic120121The operator expects a data-plane event (GetObject, PutItem, Invoke) but it122is absent. The trail is logging management events correctly.123124**Management vs data events quick reference:**125126| Expected event | Type | Where to configure |127|---|---|---|128| S3 `GetObject` / `PutObject` | Data | `DataResources` with `Type: AWS::S3::Object` |129| S3 `CreateBucket` / `PutBucketPolicy` | Management | Default (no config needed) |130| Lambda `Invoke` | Data | `DataResources` with `Type: AWS::Lambda::Function` |131| DynamoDB `GetItem` / `PutItem` | Data | `DataResources` with `Type: AWS::DynamoDB::Table` |132| CloudTrail `LookupEvents` itself | Not logged | CloudTrail does not log its own read APIs |133| IAM `GetUser` / `ListRoles` | Management (read) | Default — but excluded if `ReadWriteType: WriteOnly` |134135**Diagnostic walk:**1361371. **Confirm management vs data event.** Management = control-plane138 (CreateBucket, RunInstances). Data = data-plane (GetObject, PutItem,139 Invoke).1402. **Read event selectors:** `aws cloudtrail get-event-selectors --trail-name <trail>`.141 - `ReadWriteType: All` + `IncludeManagementEvents: true` — logs both.142 - `ReadWriteType: ReadOnly` or `WriteOnly` — limits direction.143 - `DataResources` empty/absent — data events NOT configured.1443. **Verify in S3 delivery directly:** list log objects around the event time145 and grep for the event name.1464. **For Lambda Invoke:** check whether selector covers account-level147 (`arn:aws:lambda`) or function-level.148149**Common fix patterns:**150- S3 data events: add `DataResources` with `Type: AWS::S3::Object`,151 `Values: ["arn:aws:s3"]`. Use advanced selectors for per-bucket scoping.152- Lambda data events: `Type: AWS::Lambda::Function`, `Values: ["arn:aws:lambda"]`.153- DynamoDB: `Type: AWS::DynamoDB::Table`, `Values: ["arn:aws:dynamodb"]`.154- For cost control: prefer `WriteOnly` data events; scope to specific ARNs.155156**Diagnostic commands:**157158Canonical CLI for this step (get-event-selectors, S3 log grep, CloudTrail Lake query) — `references/diagnostic-commands.md`.159160**Cost warning.** Data events are 10-100x more voluminous than management161events. Always scope `DataResources.Values` to specific ARN prefixes.162163See `references/diagnostic-commands.md` for canonical CLI commands per category.164165### Step 3: TRAIL_NOT_LOGGING diagnostic166167The trail is not delivering any events. Either `isLogging: false`, or168`isLogging: true` but no files appearing in S3.169170| Sub-symptom | Root cause | Probe |171|---|---|---|172| `isLogging: false` | Trail explicitly stopped or never started | `start-logging --name <trail>` |173| Trail missing from `describe-trails` | Trail deleted (config retained 30 days) | `--show-shadow-trails` |174| `isLogging: true` but no delivery | S3 bucket policy blocking | Step 7 (BUCKET_POLICY_BLOCKING) |175| KMS access denied errors | KMS key policy missing CloudTrail principal | Verify KMS policy has `cloudtrail.amazonaws.com` with `kms:GenerateDataKey*` |176| Org trail `isLogging: false` in member | Member shadow trail overriding | Check shadow trails in member account |177178**Diagnostic walk:**1791. Read `get-trail-status` first. `isLogging` is the single most important signal.1802. If `false`: `aws cloudtrail start-logging --name <trail>`. Re-check status.1813. If `true` but no delivery: check S3 bucket policy (Step 7) and KMS key policy.1824. If trail missing: check shadow trails (`--show-shadow-trails`). Recreate if needed.1835. For org trails: member accounts see the org trail as a "shadow." If a184 member stops logging on the shadow, that member's events stop.185186**Diagnostic commands:**187188Canonical CLI for this step (get-trail-status, shadow trails, KMS key policy check, start-logging) — `references/diagnostic-commands.md`.189190**Common fixes:**191- Trail stopped: `start-logging`; add CloudWatch alarm on192 `NumberOfNotificationsDelivered`.193- KMS missing CloudTrail: add statement allowing `cloudtrail.amazonaws.com`194 to `kms:GenerateDataKey*` and `kms:DescribeKey`.195- Trail deleted: recreate from IaC. Note: Terraform `aws_cloudtrail` does196 NOT auto-start; the `start_logging` resource must be included.197198### Step 4: DELIVERY_DELAYED diagnostic199200Log files arriving but with latency beyond CloudTrail's targets.201202| Sub-symptom | Root cause | Action |203|---|---|---|204| Management events delayed 15-30 min | Normal can be up to 15 min; > 15 unusual | Check AWS Health dashboard |205| Data events delayed 30-60 min | Data events inherently higher-latency | Expected unless > 1 hour consistently |206| All events delayed > 1 hour | Service issue OR cross-region bucket | Check bucket region vs trail HomeRegion |207| Org trail members delayed vs mgmt acct | Per-account aggregation delay (~5-15 min) | Expected; if > 30 min check quotas |208| Lake fast but S3 slow | Different pipelines by design | Use Lake/EventBridge for real-time needs |209210**Diagnostic walk:**2111. Compare `latestDeliveryTime` to `now` via `get-trail-status`.2122. Check bucket region vs trail `HomeRegion` — cross-region adds latency.2133. Check AWS Health dashboard for CloudTrail service events.2144. For org trails: member delay of 5-15 min after management account is normal.215216### Step 5: INSIGHTS_DISABLED diagnostic217218Operator expects Insights finding for anomalous write activity; none appears.219220| Sub-symptom | Root cause | Probe |221|---|---|---|222| No findings ever | Insights not enabled | `get-insight-selectors` — should return enabled selectors |223| No findings in first 7 days | Baseline period not elapsed | Expected; wait 7 days |224| No findings for write data events | Insights only analyzes write MANAGEMENT events | Expected limitation |225| Recently re-enabled | Baseline resets on re-enable | Wait another 7 days |226| Insights on stopped trail | Trail must be `isLogging: true` | Fix Step 3 first |227228**Diagnostic walk:**2291. Read `aws cloudtrail get-insight-selectors --trail-name <trail>`.2302. Interpret: `InsightsEnabled: false` -> OFF. `true` with event source ->231 Insights for that source.2323. Check baseline period (7 days of management events required).2334. Verify trail is actively logging — Insights only processes active trails.2345. Check S3: `aws s3 ls s3://<bucket>/CloudTrail-Insight/` — if prefix235 doesn't exist, no findings delivered.236237**Fix:** `aws cloudtrail put-insight-selectors --trail-name <trail>238--insight-selectors '[{"InsightType":"ApiCallRateInsight"},{"InsightType":"ApiErrorRateInsight"}]'`.239For per-source scoping (2024+), use `list-insights-selectors` /240`put-insights-selectors` (newer API).241242### Step 6: ORG_TRAIL_GAP diagnostic243244Org trail logs management account and most members. Specific member missing.245246| Sub-symptom | Root cause | Probe |247|---|---|---|248| All members missing | Org trail `isLogging: false` in mgmt account | `get-trail-status` in mgmt account |249| Specific member missing | Member shadow trail `isLogging: false` | In member: `describe-trails --show-shadow-trails` |250| New members not logged | Trail created before auto-enable existed | `start-logging` from member, or enable org auto-start |251| Member left org | Account removed from Organizations | `list-accounts` — verify Status: ACTIVE |252| Delegated admin confusion | Trail might be in delegated admin, not mgmt | `list-delegated-administrators --service-principal cloudtrail.amazonaws.com` |253| Member's own trail overrides org trail | Member trail shadows org trail | Disable member's trail or accept different bucket |254| SCP blocking CloudTrail | SCP denies cloudtrail APIs in member | `describe-policy --policy-id <scp-id>` |255256**Diagnostic walk:**2571. Confirm org trail: `describe-trails --query 'trailList[?IsOrganizationTrail]'`.2582. Check trail is logging in management account.2593. In affected member: `describe-trails --show-shadow-trails` — look for260 `IsShadowTrail: true` with `IsLogging: false`.2614. Verify member is in org with `Status: ACTIVE`.2625. Check for delegated admin: if configured, org trail must be in that263 account, not management.2646. Check SCPs that might block CloudTrail in the member.265266**Diagnostic commands:**267268Canonical CLI for this step (org trail status, delegated admins, member shadow trails, org membership, SCPs) — `references/diagnostic-commands.md`.269270**Common fixes:**271- Member shadow stopped: `start-logging --name <org-trail>` from the member272 account (works on shadow trails).273- Delegated admin confusion: consolidate to ONE org trail in EITHER274 management OR delegated admin, not both.275- New members: enable "Apply to all accounts" + "Enable for new accounts"276 in console, or script start-logging on new members.277278### Step 7: MULTI_REGION_GAP and BUCKET_POLICY_BLOCKING279280#### 7a. MULTI_REGION_GAP281282Trail is single-region (`IsMultiRegionTrail: false`). Events from other283regions not logged.284285| Sub-symptom | Root cause | Probe |286|---|---|---|287| Events from other region missing | `IsMultiRegionTrail: false` | `describe-trails --query 'trailList[*].{multi:IsMultiRegionTrail,home:HomeRegion}'` |288| Global service events (IAM, STS) missing | Single-region trail not in us-east-1 | Check `IncludeGlobalServiceEvents` + HomeRegion |289290**Fix:** `aws cloudtrail update-trail --name <trail> --is-multi-region-trail`.291Also `--include-global-service-events` if IAM/STS needed. Global service292events are delivered only to the trail's home region (us-east-1 commercial).293294#### 7b. BUCKET_POLICY_BLOCKING295296Trail claims `isLogging: true` but no log files land in S3.297298| Sub-symptom | Root cause | Probe |299|---|---|---|300| Explicit Deny on `cloudtrail:PutObject` | Restrictive policy added later | `get-bucket-policy`; grep for Deny |301| Missing Allow for `cloudtrail.amazonaws.com` | Policy accidentally removed | Look for Allow with `Principal.Service: cloudtrail.amazonaws.com` |302| KMS key policy missing CloudTrail | KMS doesn't allow `kms:GenerateDataKey*` | `get-key-policy --policy-name default` |303| Cross-account bucket | Bucket policy must include trail's account | Verify Resource ARN path |304305**Diagnostic walk:**3061. Read bucket policy: `aws s3api get-bucket-policy --bucket <bucket>`.3072. Look for the canonical CloudTrail Allow: both `s3:GetBucketAcl` and308 `s3:PutObject` with `Condition: StringEquals: s3:x-amz-acl: bucket-owner-full-control`.309 The `bucket-owner-full-control` condition is a common omission.3103. Check for explicit Deny statements overriding the Allow.3114. If KMS configured: verify key policy allows `cloudtrail.amazonaws.com`312 to `kms:GenerateDataKey*`.3135. For cross-account bucket: policy must include trail's account ID in314 Resource ARN path.315316See `references/failure-decision-tree.md` for detailed policy examples.317318### Step 8: Map to root-cause catalog319320| # | Root cause | Category | Fix pattern |321|---|---|---|---|322| 1 | Data events not configured (S3/Lambda/DynamoDB) | MISSING_DATA_EVENTS | Add `DataResources` to event selectors |323| 2 | Trail stopped (`isLogging: false`) | TRAIL_NOT_LOGGING | `start-logging`; add CloudWatch alarm |324| 3 | Trail deleted | TRAIL_NOT_LOGGING | Recreate from IaC; `--show-shadow-trails` |325| 4 | Bucket policy missing Allow or explicit Deny | BUCKET_POLICY_BLOCKING | Add canonical statements with `bucket-owner-full-control` |326| 5 | KMS key policy missing CloudTrail | BUCKET_POLICY_BLOCKING | Add KMS statement for `cloudtrail.amazonaws.com` |327| 6 | Single-region trail; events from other regions missing | MULTI_REGION_GAP | `update-trail --is-multi-region-trail` |328| 7 | Insights not enabled | INSIGHTS_DISABLED | `put-insight-selectors` |329| 8 | Insights baseline not elapsed | INSIGHTS_DISABLED | Wait 7 days |330| 9 | Org trail shadow stopped in member | ORG_TRAIL_GAP | `start-logging` from member |331| 10 | Delegated admin confusion (two org trails) | ORG_TRAIL_GAP | Consolidate to ONE org trail |332| 11 | Trail never started after IaC creation | TRAIL_NOT_LOGGING | Call `start-logging` explicitly |333| 12 | Org trail not auto-enabled for new members | ORG_TRAIL_GAP | Enable org-wide auto-start |334335### Step 9: Verify the fix336337- **start-logging fixes:** re-read `get-trail-status`, verify `isLogging: true`338 and `latestDeliveryTime` advances.339- **Event-selector fixes:** make a test API call (e.g., `aws s3 cp`), verify340 in `lookup-events` within 5-15 min.341- **Bucket-policy fixes:** re-read policy, confirm Allow statements; wait342 5-15 min for next delivery window.343- **Org trail fixes:** check `get-trail-status` in both management and member.344- **Multi-region fixes:** make a test call in previously-missing region.345346### Step 10: Decide — ROOT_CAUSE_FOUND vs NEED_MORE_INFO vs ESCALATE347348- **ROOT_CAUSE_FOUND.** Walk identified a specific category and config element.349 Output REMEDIATION with the exact change.350- **NEED_MORE_INFO.** Walk reached a step where operator cannot supply351 evidence. Output the list of missing inputs.352- **ESCALATE.** Cause is outside operator's scope (S3 bucket owned by another353 team, KMS managed by security team, org trail owned by management account).354 Output the escalation target and specific request.355356## Output format357358```text359INCIDENT: <account> / <trail-name> — <symptom>360VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE361ROOT_CAUSE: <category name> — <specific failing config element>362EVIDENCE:363 - describe-trails: <field>364 - get-trail-status: <field>365 - get-event-selectors: <field>366 - get-bucket-policy: <field>367 - lookup-events: <result count or sample>368ROOT_CAUSE_CATALOG: #<N>369REMEDIATION:370 1. <specific config change with field name>371 2. <verification command>372 3. <post-apply monitoring>373```374375## STRICT output contract376377### Required output structure378379Every response MUST begin with this block — no preamble, no conversational380opening:381382```text383INCIDENT: <account> / <trail-name> — <symptom>384VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE385ROOT_CAUSE: <MISSING_DATA_EVENTS | TRAIL_NOT_LOGGING | DELIVERY_DELAYED | INSIGHTS_DISABLED | ORG_TRAIL_GAP | MULTI_REGION_GAP | BUCKET_POLICY_BLOCKING> — <one-sentence specific failing config element>386EVIDENCE:387 - describe-trails: <quoted field value from output>388 - get-trail-status: <quoted field value from output>389 - get-event-selectors: <quoted field value from output, or "not fetched">390 - get-bucket-policy: <quoted field value, or "not applicable">391 - lookup-events: <result count or sample event>392ROOT_CAUSE_CATALOG: #<N>393REMEDIATION:394 1. <exact CLI command or policy edit>395 2. <verification command>396 3. <post-apply monitoring step>397```398399### FORBIDDEN output patterns400401- NEVER start with "Let me analyze..." — the INCIDENT line is FIRST, always.402- NEVER use lowercase verdict values — emit `ROOT_CAUSE_FOUND`,403 `NEED_MORE_INFO`, or `ESCALATE`.404- NEVER omit EVIDENCE — the judge requires direct quotes from405 `describe-trails`, `get-trail-status`, or `get-event-selectors` output.406 Paraphrasing is not acceptable; quote the actual field value.407- NEVER declare ROOT_CAUSE_FOUND without referencing BOTH `describe-trails`408 AND `get-trail-status` in EVIDENCE — a correctly-configured trail can be409 silently stopped.410- NEVER confuse management events with data events in the ROOT_CAUSE —411 GetObject, PutItem, Invoke are data events; CreateBucket and RunInstances412 are management events. Wrong event type is a hard error.413414### Perfect example output415416```text417INCIDENT: 111111111111 / corp-trail — operator expects GetObject events for audit; lookup-events returns zero GetObject events for any S3 bucket418VERDICT: ROOT_CAUSE_FOUND419ROOT_CAUSE: MISSING_DATA_EVENTS — trail's event selectors do not include S3 DataResources; only management events are logged420EVIDENCE:421 - describe-trails: corp-trail IsMultiRegionTrail: true, IsLogging: true (trail is healthy)422 - get-trail-status: IsLogging: true, LatestDeliveryTime: 2026-08-10T14:22:00Z (delivery is working)423 - get-event-selectors: [{"ReadWriteType":"All","IncludeManagementEvents":true,"DataResources":[]}] (empty DataResources = no data events configured)424 - get-bucket-policy: not applicable (delivery is working; bucket policy is not the issue)425 - lookup-events AttributeKey=EventName,AttributeValue=GetObject: 0 results in last 24h426 - lookup-events AttributeKey=EventName,AttributeValue=CreateBucket: 4 results in last 24h (management events flowing; data events absent)427ROOT_CAUSE_CATALOG: #1 (data events not configured)428REMEDIATION:429 1. Add an S3 data event selector to the trail:430 aws cloudtrail put-event-selectors --trail-name corp-trail --event-selectors '[{"ReadWriteType":"All","IncludeManagementEvents":true,"DataResources":[{"Type":"AWS::S3::Object","Values":["arn:aws:s3"]}]}]'431 2. Verify by making a test S3 read and checking lookup-events in 5-15 minutes:432 aws s3 cp s3://my-bucket/test . && aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=GetObject --start-time $(date -u -v-20M +%Y-%m-%dT%H:%M:%SZ)433 3. Monitor S3 bucket size — adding data events significantly increases CloudTrail log volume and cost. Consider scoping to specific buckets via advanced-event-selectors if cost is a concern.434```435436## Anti-Patterns — NEVER (top 5)4374381. NEVER assume a CloudTrail outage when specific events are missing — almost439 always scope/configuration (data events, region), not an outage.4402. NEVER confuse `describe-trails` (configuration) with `get-trail-status`441 (active logging state) — a correctly-configured trail can be silently442 stopped. Always read both.4433. NEVER conclude "data events not configured" without reading444 `get-event-selectors` — the trail may have advanced event selectors that445 look different but achieve the same thing.4464. NEVER enable `DataResources: ["arn:aws:s3"]` (all S3 data events) without447 warning about cost — scope to specific bucket ARNs.4485. NEVER recommend deleting and recreating a trail as a first fix — deletion449 loses event history references and forces an Insights re-baseline. Fix450 configuration in place.451452See `references/failure-decision-tree.md` for additional anti-patterns and453edge cases (org trail ownership, global service events region, CloudTrail454Lake vs S3, Insights limitations).455456## Recent AWS features (2024-2026)457458→ All seven updates (Lake adoption, Lake federation, enhanced Insights selectors, org auto-enable, Amazon Q integration, S3 managed bucket policies, delete-trail shadow retention) — `references/advanced-patterns.md`.459460## References461462- `references/failure-decision-tree.md` — full symptom-to-cause walk with463 worked examples per category, detailed S3/KMS policy examples, and464 additional anti-patterns465- `references/diagnostic-commands.md` — canonical command script for each466 failure category467468## References (load on demand)469470- [`references/diagnostic-commands.md`](references/diagnostic-commands.md) — canonical per-category CLI script (pre-existing) + the Step 2 / Step 3 / Step 6 command blocks moved from SKILL.md471- [`references/advanced-patterns.md`](references/advanced-patterns.md) — recent AWS features affecting gap diagnosis (2024-2026)472- [`references/failure-decision-tree.md`](references/failure-decision-tree.md) — full symptom-to-cause walk, worked examples per category, S3/KMS policy examples, anti-patterns (pre-existing)473474## Domain475476AWS CloudOps / Governance, Audit Logging & Compliance.477478## AWS documentation479480- **AWS CloudTrail User Guide** — https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html481- **CloudTrail troubleshooting** — https://repost.aws/knowledge-center/cloudtrail-troubleshooting482- **CloudTrail data events** — https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html483- **CloudTrail Insights** — https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html484- **CloudTrail organization trails** — https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html485- **CloudTrail S3 bucket policy** — https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html486- **CloudTrail Lake** — https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html487- **CloudTrail supported services** — https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-unsupported-aws-services.html488- **Terraform aws_cloudtrail** — https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudtrail