Description
Allowing Principal: "*" to use s3:PutObject can give unintended callers upload access. Other Put actions control bucket or object settings. Effective permissions depend on the action, resource, conditions, explicit denies and Block Public Access.
Potential impact
Uploads can increase storage costs or processing load. Uploading to an existing key changes what applications serve or process. In a versioning-enabled bucket, S3 retains the previous version and makes the new one current.
Remediation
- Remove unnecessary public write grants. Give each upload role or account only the required actions on its object paths. Restrict configuration changes to the administrators that need them.
- Review conditions, other policies and Block Public Access together. Add upload monitoring or file inspection where needed.
Examples
The excerpts omit the bucket definition referenced by DOC-EXAMPLE-BUCKET. A deployable policy also needs the correct bucket or object ARNs for its actions.
Incomplete upload grant
Resources:
SampleBucketPolicy3:
Type: "AWS::S3::BucketPolicy"
Properties:
Bucket: !Ref DOC-EXAMPLE-BUCKET
PolicyDocument:
Statement:
- Action: "PutObject"
Effect: Allow
Resource: "*"
Principal: "*"
PutObject is missing the required s3: prefix. Before granting upload access, narrow the principal and the object paths.
Explicit denial of object uploads
Resources:
SampleBucketPolicy1:
Type: "AWS::S3::BucketPolicy"
Properties:
Bucket: !Ref DOC-EXAMPLE-BUCKET
PolicyDocument:
Statement:
- Action:
- "s3:PutObject"
Effect: Deny
Resource: "*"
Principal: "*"
In a valid policy, an explicit deny of s3:PutObject for every principal can block legitimate uploads. Other Put actions require a separate review.