CloudTrail Protection

    Policy Description

    What this SCP does

    This Service Control Policy (SCP) prevents tampering with CloudTrail logs by blocking attempts to delete trails, update configurations, or stop logging activities. This ensures audit logs remain intact for compliance and security investigations.

    The policy explicitly denies the deletion of trails, updates to trail configurations, and stopping of logging. This preserves the integrity of your audit trail even if someone gains unauthorized access to your AWS account.

    Validation Strategy

    How to test this SCP works

    To validate this SCP, try to delete, update, or stop logging for a CloudTrail trail:

    • Valid test: Create a new CloudTrail trail (should succeed)
    • Valid test: Start logging on a trail (should succeed)
    • Invalid test: Delete a trail (should be denied)
    • Invalid test: Update a trail's configuration (should be denied)
    • Invalid test: Stop logging on a trail (should be denied)

    We expect creation of trails and starting logging to succeed, while any operations that would tamper with existing trails (delete, update, stop logging) should be denied with an AccessDenied error.

    SCP Policy & Validation Scenarios

    SCP Policy & Validation Scenarios

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "BlockCloudTrailTampering",
          "Effect": "Deny",
          "Action": [
            "cloudtrail:DeleteTrail",
            "cloudtrail:UpdateTrail",
            "cloudtrail:StopLogging"
          ],
          "Resource": "*"
        }
      ]
    }