AWS Introduction
AWS Pricing
AWS Threats
AWS Misconfigurations
- Getting Started with AWS Audit
- Permissions required for Misconfigurations Detection
- API Gateway Audit
- Cloudformation Audit
- CloudFront Audit
- CloudTrail Audit
- Cloudwatch Audit
- DynamoDB Audit
- EC2 Audit
- Elastic Search Audit
- ELB Audit
- IAM Audit
- KMS Audit
- Kubernetes Audit
- Lambda Audit
- RDS Audit
- Redshift Audit
- Route53 Audit
- S3 Audit
- Security Groups Audit
- SES Audit
- SNS Audit
- IAM Deep Dive
- App Sync Audit
- Code Build Audit
- Open Search Audit
- Shield Audit
- SQS Audit
S3 Bucket Should Not Allow READ_ACP Access For Authenticated Users
More Info:
AWS S3 buckets should not allow READ_ACP access to AWS authenticated users using ACLs in order to protect against unauthorized access.
Risk Level
Medium
Address
Security
Compliance Standards
CBP, PCIDSS, NIST
Triage and Remediation
Remediation
Here are the step by step instructions to remediate the S3 Bucket misconfiguration for AWS using AWS Console:
-
Log in to your AWS Management Console.
-
Go to the S3 service dashboard.
-
Select the bucket that you want to remediate.
-
Click on the “Permissions” tab.
-
Scroll down to the “Access Control List (ACL)” section.
-
Click on the “Edit” button next to the “Authenticated Users” group.
-
Uncheck the “Read” permission for the “Access Control Policy (ACP)“.
-
Click on the “Save” button to apply the changes.
-
Verify that the “Read” permission for the “Access Control Policy (ACP)” is no longer enabled for the “Authenticated Users” group.
-
Repeat the above steps for any other S3 buckets that may have this misconfiguration.
By following these steps, you will have successfully remediated the S3 Bucket misconfiguration of not allowing READ_ACP access for authenticated users in AWS.
To remediate the issue of S3 bucket allowing READ_ACP access for authenticated users in AWS using AWS CLI, follow these steps:
- Open the AWS CLI on your local machine and run the following command to list all the S3 buckets in your AWS account:
aws s3 ls
-
Identify the S3 bucket that has READ_ACP access for authenticated users.
-
Run the following command to revoke READ_ACP access for authenticated users:
aws s3api put-bucket-acl --bucket <bucket-name> --grant-read-acp uri=http://acs.amazonaws.com/groups/global/AuthenticatedUsers --acl private
Note: Replace <bucket-name>
with the name of the S3 bucket that needs to be remediated.
- Verify that the remediation is successful by running the following command:
aws s3api get-bucket-acl --bucket <bucket-name>
Note: Replace <bucket-name>
with the name of the S3 bucket that was remediated.
This command should return the updated ACL of the S3 bucket, which should now have private access for READ_ACP.
To remediate the misconfiguration “S3 Bucket Should Not Allow READ_ACP Access For Authenticated Users” in AWS using Python, you can follow the below steps:
-
Open the AWS Management Console and navigate to the S3 service.
-
Select the S3 bucket that you want to remediate.
-
Click on the Permissions tab and select the Access control list (ACL) option.
-
Under the “Grantee” column, search for the “Authenticated Users” group.
-
In the “Permission” column, deselect the “READ_ACP” option for the “Authenticated Users” group.
-
Click on the Save button to apply the changes.
To automate this process using Python, you can use the boto3 library, which is the AWS SDK for Python. Below is the code snippet to remediate the misconfiguration using Python:
import boto3
s3 = boto3.resource('s3')
bucket_name = 'your_bucket_name'
bucket_acl = s3.BucketAcl(bucket_name)
# Revoke READ_ACP permission for Authenticated Users group
response = bucket_acl.put(
AccessControlPolicy={
'Grants': [
{
'Grantee': {
'Type': 'Group',
'URI': 'http://acs.amazonaws.com/groups/global/AuthenticatedUsers'
},
'Permission': 'WRITE_ACP'
}
],
'Owner': {
'DisplayName': 'Your Name',
'ID': 'your_aws_account_id'
}
}
)
print(response)
Note: Replace the bucket_name
variable with the name of your S3 bucket. Also, make sure that you have the necessary AWS credentials configured to run this script.