# Deny modifications to specific CloudTrail trails

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

Deny modifications to specific CloudTrail trails is an AWS guardrail written in service control policies. Denies deleting, updating, stopping or changing event selectors on a named CloudTrail trail unless the caller is the privileged role. Copied from a licensed open source set and read on 10 Nov 2026.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Deny",
      "Action": [
        "cloudtrail:DeleteTrail",
        "cloudtrail:PutEventSelectors",
        "cloudtrail:StopLogging",
        "cloudtrail:UpdateTrail",
        "cloudtrail:CreateTrail"
      ],
      "Resource": "arn:aws:cloudtrail:${Region}:${Account}:trail/[CLOUDTRAIL_NAME]",
      "Condition": {
        "ArnNotLike": {
          "aws:PrincipalARN": "arn:aws:iam::${Account}:role/[PRIVILEGED_ROLE]"
        }
      }
    }
  ]
}
```

- **Blocks:** Denies deleting, updating, stopping or changing event selectors on a named CloudTrail trail unless the caller is the privileged role.
- **Breaks:** The resource is a placeholder trail name that must be replaced; the README notes an organization trail already prevents member account users from altering it. ([source](https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Deny-changes-to-security-services/README.md))
- **Test before applying:** As for every Service control policies guardrail: [how to test before enforcing](/mechanisms/scp/)
- **Mechanism:** [Service control policies (SCPs)](/mechanisms/scp/): IAM users, IAM roles and the root user in member accounts; not the management account and not service-linked roles.
- **Taken from:** [open source set](https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Deny-changes-to-security-services/Deny-modifications-to-specific-CloudTrail-trails.json), MIT-0 (README states MIT-0; LICENSE file fetched, MIT-0 text, Copyright Amazon.com, Inc.): https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/LICENSE

## What the policy text names

It names 5 actions or patterns: `cloudtrail:DeleteTrail`, `cloudtrail:PutEventSelectors`, `cloudtrail:StopLogging`, `cloudtrail:UpdateTrail`, `cloudtrail:CreateTrail`. Its conditions test `aws:PrincipalARN`.

## What the source says

`cloudtrail:StopLogging` (read 10 Nov 2026).

On what it breaks: "Users in member accounts will not have sufficient permissions to delete the organization trail, turn logging on or off, change what types of events are logged, or otherwise alter the organization trail in any way."

## Related guardrails

- [Deploy diagnostic settings for Key Vault to Event Hub](/guardrails/azure-policy-keyvault-diagnostic-logs/): Azure, Azure Policy (built-in definitions), logging and monitoring
- [Application Insights components should block non-Entra ingestion](/guardrails/azure-policy-appinsights-entra-ingestion/): Azure, Azure Policy (built-in definitions), logging and monitoring
- [Require predefined policies for VPC flow logs](/guardrails/gcp-orgpolicy-require-vpc-flow-logs/): Google Cloud, Organization Policy Service (managed and legacy constraints), logging and monitoring
- [Deny enabling and disabling AWS Config](/guardrails/aws-scp-deny-config-changes/): AWS, Service control policies (SCPs), logging and monitoring
- [Deny disabling or modifying Amazon GuardDuty](/guardrails/aws-scp-deny-guardduty-changes/): AWS, Service control policies (SCPs), logging and monitoring
- [Deny deleting VPC flow logs](/guardrails/aws-scp-deny-vpc-flow-log-deletion/): AWS, Service control policies (SCPs), logging and monitoring

## Related pages

- [Deny disabling or modifying Amazon GuardDuty (AWS Service control policies)](/guardrails/aws-scp-deny-guardduty-changes/)
- [Deny deleting VPC flow logs (AWS Service control policies)](/guardrails/aws-scp-deny-vpc-flow-log-deletion/)
- [Deny KMS key deletion (AWS Service control policies)](/guardrails/aws-scp-deny-kms-key-deletion/)

## Sources

- Deny modifications to specific CloudTrail trails: https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Deny-changes-to-security-services/Deny-modifications-to-specific-CloudTrail-trails.json (read 10 Nov 2026)
- What it breaks: https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Deny-changes-to-security-services/README.md (read 10 Nov 2026)
- How to test it first: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/guardrails/aws-scp-deny-cloudtrail-trail-changes/
