CloudWatch Protection Policy

    Policy Description

    What this SCP does

    This Service Control Policy (SCP) prevents deletion of critical CloudWatch logs and alarms, ensuring your monitoring and alerting infrastructure remains intact. This provides protection against accidental or malicious deletion of monitoring resources.

    The policy explicitly denies the deletion of CloudWatch log groups, log streams, and alarms. This ensures that important monitoring data and alert configurations cannot be removed, preserving operational visibility and compliance capabilities.

    Validation Strategy

    How to test this SCP works

    To validate this SCP, create test log groups, log streams, and alarms, then attempt to delete them:

    • Valid test: Create CloudWatch log groups, log streams, and alarms (should succeed)
    • Invalid test: Delete a log group (should be denied)
    • Invalid test: Delete a log stream (should be denied)
    • Invalid test: Delete a CloudWatch alarm (should be denied)

    We expect resource creation to succeed, while any deletion operations should be denied with an AccessDenied error, confirming that the SCP is protecting these monitoring resources.

    SCP Policy & Validation Scenarios

    SCP Policy & Validation Scenarios

    {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Sid": "DenyCloudWatchTampering",
            "Effect": "Deny",
            "Action": [
              "logs:DeleteLogGroup",
              "logs:DeleteLogStream",
              "cloudwatch:DeleteAlarms"
            ],
            "Resource": "*"
          }
        ]
      }