S3 Block Public Access Not Enabled

S3 Block Public Access is not enabled for the account or for buckets, so a mistaken bucket policy or ACL could make data public with nothing to stop it.

SeverityMedium
CVSS 3.15.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N Open in the calculator
CVSS 4.08.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-1188: Initialization of a Resource with an Insecure Default
MITRE ATT&CKT1530 Data from Cloud Storage
CategorySecurity Misconfiguration

Description

S3 Block Public Access is a set of four settings that override bucket policies and access control lists (ACLs) to prevent public access. BlockPublicAcls rejects requests that would add a public ACL; IgnorePublicAcls makes S3 ignore public ACLs already present on a bucket and its objects; BlockPublicPolicy rejects bucket and access point policies that grant public access; and RestrictPublicBuckets limits a bucket with a public policy to AWS service principals and authorised users in the owner's account. The settings can be applied to individual buckets, to a whole account, where they cover every bucket and access point it owns, and across an AWS organisation through an organisation-level S3 policy. Where levels differ, S3 applies the most restrictive combination.

The finding is raised when some or all of the settings are off at account level, so that buckets rely on their own settings and on every bucket policy and ACL being correct. On its own, this exposes nothing, but it removes the guardrail that would stop a bucket becoming public through a misconfigured bucket policy, a public ACL on an uploaded object or a permissive infrastructure template, which are common causes of data exposure in AWS. Since April 2023 new buckets have all four settings enabled by default, but they can be switched off when a bucket is created or later, and buckets created earlier often have none. A bucket that is private today can then become public through a single policy or ACL change, made by mistake or by a deployment template, and where it holds sensitive data, that change would expose it to anyone on the internet without any warning or block. The risk is greater in accounts where many people or pipelines can change bucket policies or upload objects with ACLs.

The settings are reviewed with aws s3control get-public-access-block for the account and aws s3api get-public-access-block for each bucket, or in the S3 console. Prowler, ScoutSuite and Security Hub report accounts and buckets without them.

Remediation

Enable all four Block Public Access settings at account level, and keep them enabled on each bucket:

aws s3control put-public-access-block --account-id "$ACCOUNT_ID" --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
  • Before enabling the settings, identify buckets that legitimately serve public content, using IAM Access Analyzer for S3 or the access column in the S3 console, and move that content behind Amazon CloudFront with origin access control so that the buckets themselves need no public access.
  • In an AWS organisation, attach an S3 policy that blocks all public access at the root or organisational unit level, so that every member account, including new ones, inherits the setting centrally.
  • Restrict the s3:PutAccountPublicAccessBlock and s3:PutBucketPublicAccessBlock permissions to administrators, and consider a service control policy that denies them, so the settings cannot be switched off casually.
  • Disable ACLs on buckets with the S3 Object Ownership setting Bucket owner enforced.

Confirm the fix with aws s3control get-public-access-block showing all four settings as true for the account, and by checking that Security Hub or Prowler no longer report the settings as disabled.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More AWS Findings

Every AWS finding