Skip to content
IAM Policy Generator

IAM policy example: read CloudTrail events, with a least privilege rewrite

Allows a responder to look up management events from the last 90 days and to see which trails exist and whether they are logging. The original uses cloudtrail:* on all resources, which includes stopping and deleting trails. The names and the account ID 111122223333 are AWS documentation placeholders.

Open the workbench ยท All examples

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Trail",
      "Effect": "Allow",
      "Action": "cloudtrail:*",
      "Resource": "*"
    }
  ]
}

What it allows

  • Allows every CloudTrail action, including stopping logging and deleting trails.

What it allows

  1. Allow 66 actions (cloudtrail:*) on every resource.

    Action or patternActionsAccess levels
    cloudtrail:*66List 8, Read 21, Write 35, Tagging 2

Checks

The action cloudtrail:* covers 66 actions, among them StopLogging and DeleteTrail, which hide activity.

Least privilege rewrite

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadEvents",
      "Effect": "Allow",
      "Action": [
        "cloudtrail:LookupEvents",
        "cloudtrail:DescribeTrails",
        "cloudtrail:GetTrailStatus",
        "cloudtrail:GetEventSelectors"
      ],
      "Resource": "*"
    }
  ]
}

The rewrite lists four read actions. Stopping logging, deleting trails and editing selectors are removed.

What it allows

  1. Allow 4 actions (cloudtrail:LookupEvents, cloudtrail:DescribeTrails, cloudtrail:GetTrailStatus, cloudtrail:GetEventSelectors) on every resource.

    Action or patternActionsAccess levels
    cloudtrail:LookupEvents1Read 1
    cloudtrail:DescribeTrails1Read 1
    cloudtrail:GetTrailStatus1Read 1
    cloudtrail:GetEventSelectors1Read 1

Checks

No flags from the six checks.

Sources

  1. AWS CloudTrail User Guide: identity-based policy examples, read 16 Nov 2026
  2. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.