S3 Bucket Public 'READ_ACP' Access

Trend Micro Cloud One™ – Conformity is a continuous assurance tool that provides peace of mind for your cloud infrastructure, delivering over 750 automated best practice checks.

Risk level: Very High (not tolerated)
Rule ID: S3-002

Ensure that the content permissions of your Amazon S3 buckets can't be viewed by anonymous users in order to protect your S3 data against unauthorized access. An Amazon S3 bucket that grants public READ_ACP (VIEW) access can allow everyone on the Internet to examine your Access Control List (ACL) configuration and find permission vulnerabilities.

This rule can help you with the following compliance standards:

This rule can help you work with the AWS Well-Architected Framework

This rule resolution is part of the Cloud Conformity Security & Compliance tool for AWS

Security

Granting public READ_ACP access to your Amazon S3 buckets can enable the unauthorized users to see who controls your S3 objects and how. Malicious users can use this information to find S3 objects with misconfigured permissions and try probing techniques to facilitate access to your Amazon S3 data. To meet security and compliance requirements, avoid granting READ_ACP (VIEW) permissions to the "Everyone (public access)" grantee in production.


Audit

To determine if your Amazon S3 buckets are configured to allow public READ_ACP access, perform the following operations:

Using AWS Console

01 Sign in to the AWS Management Console.

02 Navigate to Amazon S3 console at https://console.aws.amazon.com/s3/.

03 Click on the name (link) of the S3 bucket that you want to examine to access the bucket configuration settings.

04 Select the Permissions tab from the console menu to access the bucket permissions.

05 In the Access control list (ACL) section, check the Access Control List (ACL) configuration settings available for the grantee named Everyone (public access). This grantee is a predefined group that allows anonymous users to access your Amazon S3 resources. If the Everyone (public access) grantee is set to Read in the Bucket ACL column, the content permissions configured for the selected Amazon S3 bucket are publicly exposed, therefore the bucket ACL configuration is not secure.

06 Repeat steps no. 3 – 5 for each Amazon S3 bucket that you want to examine, available in your AWS cloud account.

Using AWS CLI

01 Run list-buckets command (OSX/Linux/UNIX) using custom query filters to list the names of all Amazon S3 buckets available within your AWS cloud account:

aws s3api list-buckets
  --query 'Buckets[*].Name'

02 The command output should return an array with the requested bucket names:

[
  "cc-production-audit-logs",
  "cc-project5-access-logs"
]

03 Run get-bucket-acl command (OSX/Linux/UNIX) using the name of the Amazon S3 bucket that you want to examine as the identifier parameter to describe the Access Control List (ACL) configuration set for the Everyone (public access) grantee, available for the selected S3 bucket:

aws s3api get-bucket-acl
  --bucket cc-production-audit-logs
  --query 'Grants[?(Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers`)]'

04 The command output should return the ACL configuration available for the Everyone (public access) grantee:

[
  {
  "Grantee": {
    "Type": "Group",
    "URI": "http://acs.amazonaws.com/groups/global/AllUsers"
  },
  "Permission": "READ_ACP"
  }
]

If the get-bucket-acl command output returns "READ_ACP" for the "Permission" attribute value, as shown in the example above, the content permissions configured for the selected Amazon S3 bucket are publicly exposed, therefore the bucket ACL configuration is not secure.

05 Repeat steps no. 3 and 4 for each Amazon S3 bucket that you want to examine, available within your AWS cloud account.

Remediation / Resolution

To restrict public READ_ACP access to your Amazon S3 buckets using Access Control Lists (ACLs), perform the following operations:

Note: An S3 bucket can be deemed compliant if implements either "AccessControl": "Private" or sets the "PublicAccessBlockConfiguration" feature options to true. The following CloudFormation template uses both for added security.

Using AWS CloudFormation

01 CloudFormation template (JSON):

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "S3 Bucket Public 'READ_ACP' Access",
  "Resources": {
    "SecureS3Bucket": {
      "Properties": {
        "AccessControl": "Private",
        "BucketName": "cc-production-audit-logs",
        "PublicAccessBlockConfiguration": {
          "BlockPublicAcls": true,
          "IgnorePublicAcls": true,
          "BlockPublicPolicy": true,
          "RestrictPublicBuckets": true
        }
      },
      "Type": "AWS::S3::Bucket"
    }
  }
}

02 CloudFormation template (YAML):

AWSTemplateFormatVersion: '2010-09-09'
Description: S3 Bucket Public 'READ_ACP' Access
Resources:
  SecureS3Bucket:
    Properties:
      AccessControl: Private
      BucketName: cc-production-audit-logs
      PublicAccessBlockConfiguration:
        BlockPublicAcls: true
        IgnorePublicAcls: true
        BlockPublicPolicy: true
        RestrictPublicBuckets: true
    Type: 'AWS::S3::Bucket'

Note: An S3 bucket can be deemed compliant if implements either acl = "private" or sets the "aws_s3_bucket_public_access_block" feature options to true. The following Terraform configuration file uses both for added security.

Using Terraform

01 Terraform configuration file (.tf):

terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "~> 3.27"
    }
  }

  required_version = ">= 0.14.9"
}

provider "aws" {
  profile = "default"
  region = "us-east-1"
}

resource "aws_s3_bucket" "securebucket" {
  bucket = "cc-production-audit-logs"
  acl = "private"
}

resource "aws_s3_bucket_public_access_block" "securebucket" {
  bucket = "cc-production-audit-logs"
  block_public_acls = true
  ignore_public_acls = true
  block_public_policy = true
  restrict_public_buckets = true
}

Using AWS Console

01 Sign in to the AWS Management Console.

02 Navigate to Amazon S3 console at https://console.aws.amazon.com/s3/.

03 Click on the name of the S3 bucket that you want to reconfigure.

04 Select the Permissions tab from the console menu to access the bucket permissions.

05 In the Access control list (ACL) section, choose Edit to modify the Access Control List (ACL) configuration available for the selected S3 bucket.

06 Under Access control list (ACL), deselect the Read permission checkbox available next to the Everyone (public access) grantee, to remove the READ_ACP (VIEW) permissions for anonymous users, from the selected Amazon S3 bucket. Select I understand the effects of these changes on my objects and buckets checkbox for confirmation, then choose Save changes to apply the changes.

07 Repeat steps no. 3 – 6 for each Amazon S3 bucket that allows public READ_ACP access, available in your AWS cloud account.

Using AWS CLI

01 Run get-bucket-acl command (OSX/Linux/UNIX) using the name of the Amazon S3 bucket that you want to reconfigure as the identifier parameter, to deny public/anonymous READ_ACP access to the selected S3 bucket by removing the READ_ACP (VIEW) permissions set for the Everyone (public access) grantee. The following command request uses the PRIVATE canned ACL to remove the READ_ACP (VIEW) permissions for the specified S3 bucket (if successful, the command does not produce an output):

aws s3api put-bucket-acl
  --bucket cc-production-audit-logs
  --acl private

02 Repeat step no. 1 for each Amazon S3 bucket that allows public READ_ACP access, available within your AWS cloud account.

References

Publication date May 12, 2016

Unlock the Remediation Steps


Free 30-day Trial

Automatically audit your configurations with Conformity
and gain access to our cloud security platform.

Confirmity Cloud Platform

No thanks, back to article

You are auditing:

S3 Bucket Public 'READ_ACP' Access

Risk level: Very High