View a markdown version of this page

AWSSupportRemediator-BlockS3BucketPublicAccess - Amazon Systems Manager Automation Runbook Reference
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWSSupportRemediator-BlockS3BucketPublicAccess

Description

Disables all public access for the specified Amazon Simple Storage Service (Amazon S3) bucket.

This automation remediates findings identified by Amazon Well-Architected Agent. It remediates findings from Amazon Trusted Advisor check Amazon S3 Bucket Permissions and Amazon Security Hub CSPM controls S3 general purpose buckets should block public read access, S3 general purpose buckets should block public write access, and S3 general purpose buckets should block public access.

If the Amazon S3 bucket does not exist or all public access is already disabled, the automation completes successfully without making changes.

Some buckets might intentionally allow public access, in which case running this runbook might cause availability issues.

Important considerations
  • You are responsible for reviewing automation actions before they run.

  • This automation might cause stack drift if the resource is part of an Amazon CloudFormation stack.

  • Access to AWSSupportRemediator-* runbooks requires an active Business Support+, Enterprise Support, or Unified Operations Support plan. For more information, see Compare Amazon Web Services Support Plans on the Amazon website.

Document type

Automation

Owner

Amazon

Platforms

Linux, macOS, Windows

Parameters

  • AutomationAssumeRole

    Type: String

    Description: (Optional) The Amazon Resource Name (ARN) of the Amazon Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook.

  • BucketName

    Type: AWS::S3::Bucket::Name

    Description: (Required) The name of the Amazon S3 bucket for which to disable public access.

Required IAM permissions

The AutomationAssumeRole parameter requires the following actions to use the runbook successfully.

  • s3:GetBucketPublicAccessBlock

  • s3:PutBucketPublicAccessBlock

Document Steps
  1. validateInput - Validates that the Amazon S3 bucket exists and checks the current public access block configuration.

  2. branchOnChangeRequired - Branches on whether public access block configuration changes are required.

  3. blockS3PublicAccess - Applies public access block configuration to disable all public access for the Amazon S3 bucket.

Outputs
  • validateInput.ChangeRequired: Whether a change is required.

  • validateInput.ValidationMessage: The reason if no change is required.

  • validateInput.PublicAccessBlockConfiguration: Initial public access block configuration of the Amazon S3 bucket before execution.