Guided Walkthroughs

Configuration Packages

Custom Packages

By Implementation

Service Control PoliciesConfig RulesAuto Remediation RulesConformance PacksAmazon GuardDutyAmazon InspectorAWS Security HubAWS Network FirewallRoute53 Resolver SecurityAmazon MacieS3 Bucket PoliciesCloudWatch Alarms and Event RulesAWS WAFAWS Secrets ManagerAWS Systems ManagerSecurity Groups & NACLsAWS KMSAWS SSOIAM PoliciesVPC Endpoint PoliciesCloudFormation Guard RulesLoad BalancersRDS Event SubscriptionsAWS Resource Access Manager (RAM)

By Service Protected

Reference Guides

Other

S3 Security Controls

S3 Block Public Access (Account-Level)

Configure S3 Block Public Access on the AWS account level (applies to all S3 buckets in all regions). Includes a CloudFormation custom resource to enable this setting.

S3 Block Public Access provides four settings:

  • Block Public ACLs: Prevent any new operations to make buckets or objects public through Bucket or Object ACLs. (existing policies and ACLs for buckets and objects are not modified.)
  • Ignore Public ACLs: Ignore all public ACLs on a bucket and any objects that it contains
  • Block Public Policy: Reject calls to PUT Bucket policy if the specified bucket policy allows public access. (Enabling this setting doesn't affect existing bucket policies)
  • Restrict Public Buckets: Restrict access to a bucket with a public policy to only AWS services and authorized users within the bucket owner's account. 
Items
3
Size
1.6 KB
AWSTemplateFormatVersion: "2010-09-09"
Description: ""
Resources:
  S3BlockPublicAccess:
    Type: "Custom::S3BlockPublicAccess"
    Properties:
      BlockPublicAcls: true
      BlockPublicPolicy: true
      IgnorePublicAcls: true
      RestrictPublicBuckets: true
      ServiceToken:
        Fn::GetAtt:
          - "S3BlockPublicAccessLambda"
          - "Arn"
  S3BlockPublicAccessLambdaRole:
    Type: "AWS::IAM::Role"
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: "Allow"
            Principal:
              Service: "lambda.amazonaws.com"
            Action:
              - "sts:AssumeRole"
      Path: "/"
      ManagedPolicyArns:
        - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
      Policies:
        - PolicyName: "s3inline"
          PolicyDocument:
            Statement:
              - Effect: "Allow"
                Action:
                  - "s3:PutAccountPublicAccessBlock"
                  - "s3:GetAccountPublicAccessBlock"
                Resource: "*"
  S3BlockPublicAccessLambda:
    Type: "AWS::Lambda::Function"
    Properties:
      Code:
        S3Bucket:
          Fn::Sub:
            - "asecure-cloud-cf-aux-${Region}"
            - Region:
                Ref: "AWS::Region"
        S3Key: "s3-block-public-access-lambda.zip"
      Handler: "index.handler"
      MemorySize: 128
      Role:
        Fn::GetAtt:
          - "S3BlockPublicAccessLambdaRole"
          - "Arn"
      Runtime: "nodejs14.x"
      Timeout: 120
Parameters: {}
Metadata: {}
Conditions: {}

Actions



Customize Template

* Required field

Upgrade to Premium for More Features

Guided Walkthroughs
Step-by-step configuration wizards for your environment
Dedicated Security Account
AWS Backup Strategy
VPC Connectivity Setup
Automated Patching
All Guides
Configuration Packages
Pre-built packages for common configuration
Common SCPs
CloudFormation Guard Rules
Auto Remediation Rules
IAM Monitoring & Compliance
All Packages
Automated Assessments
  • 350+ security checks
  • Well-architected reviews
  • Detailed compliance reports
  • Remediation templates
  • Email summaries
  • Learn more