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

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

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.

```json
{
  "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.

- Allows 66 actions (cloudtrail:*) on every resource.

Checks:
- medium: Allows 35 write or permissions-management actions on every resource ("Resource": "*"). (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)

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

## Least privilege rewrite

```json
{
  "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.

- Allows 4 actions (cloudtrail:LookupEvents, cloudtrail:DescribeTrails, cloudtrail:GetTrailStatus, cloudtrail:GetEventSelectors) on every resource.

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every CloudTrail action and its access level](/actions/cloudtrail/)

## Related pages

- [IAM policy example: send messages to one SQS queue](/examples/sqs-send-to-one-queue/)
- [IAM policy example: consume messages from one SQS queue](/examples/sqs-consume-one-queue/)
- [IAM policy example: publish to one SNS topic](/examples/sns-publish-to-one-topic/)
- [All of them](/examples/)

## Sources

- AWS CloudTrail User Guide: identity-based policy examples: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_id-based-policy-examples.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/cloudtrail-read-recent-events/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
