S3 Public Access Prevention

    Policy Description

    What this SCP does

    This Service Control Policy (SCP) prevents S3 buckets from being configured with public access, reducing the risk of accidental data exposure. This is crucial for preventing data breaches through misconfigured storage resources.

    The policy specifically blocks attempts to set a bucket's ACL to 'public-read', which would make the bucket content readable by anyone on the internet. This helps prevent accidental data exposure caused by misconfigured S3 buckets.

    Validation Strategy

    How to test this SCP works

    To validate this SCP, try to create a bucket and then attempt to make it publicly accessible.

    • Valid test: Create an S3 bucket (should succeed)
    • Invalid test: Set the bucket ACL to 'public-read' (should be denied)

    We expect attempts to set public read access to be denied with an AccessDenied error. This confirms that the SCP is preventing public exposure of S3 data.

    SCP Policy & Validation Scenarios

    SCP Policy & Validation Scenarios

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "DenyPublicReadACL",
          "Effect": "Deny",
          "Action": "s3:PutBucketAcl",
          "Resource": "*",
          "Condition": {
            "StringEquals": {
              "s3:x-amz-acl": "public-read"
            }
          }
        }
      ]
    }