π AWS S3 Bucket Policy is not set to deny HTTP requests π’
- Contextual name: π Bucket Policy is not set to deny HTTP requests π’
- ID:
/ce/ca/aws/s3/bucket-policy-deny-http-requests
- Located in: π AWS S3
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
- Internal
dec-x-d5fbfc40
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-d5fbfc40 | 1 |
Logicβ
- π§ prod.logic.yaml π’
- π AWS S3 Bucket
- π AWS S3 Bucket - object.extracts.yaml
- π§ͺ test-data.json
Descriptionβ
Descriptionβ
At the Amazon S3 bucket level, you can configure permissions through a bucket policy making the objects accessible only through HTTPS.
Rationaleβ
By default, Amazon S3 allows both HTTP and HTTPS requests. To achieve only allowing access to Amazon S3 objects through HTTPS you also have to explicitly deny access to HTTP requests. Bucket policies that allow HTTPS requests without explicitly denying HTTP requests will not comply with this recommendation.
Auditβ
To allow access to HTTPS, you can use a bucket policy with the effect
allow
and a condition that checks for the key"aws:SecureTransport": "true"
. This means that HTTPS requests are allowed, but it does not deny HTTP requests. To explicitly deny HTTP access, ensure that there is also a bucket policy with the effectdeny
that contains the key"aws:SecureTransport": "false"
. You may also require TLS by setting a policy to deny any version lower than the one you wish to require, using the conditionNumericLessThan
and the key"s3:TlsVersion": "1.2"
.... see more
Remediationβ
Remediationβ
From Consoleβ
- Login to AWS Management Console and open the Amazon S3 console using https://console.aws.amazon.com/s3/
- Select the Check box next to the Bucket.
- Click on
Permissions
.- Click
Bucket Policy
.- Add either of the following to the existing policy, filling in the required information:
{
"Sid": "<optional>",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::<bucket_name>/*",
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
}
}
}or
{
"Sid": "<optional>",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::<bucket_name>",
"arn:aws:s3:::<bucket_name>/*"
],
"Condition": {
"NumericLessThan": {
"s3:TlsVersion": "1.2"
}
}
}
Save
.- Repeat for all the buckets in your AWS account that contain sensitive data.
From Console using AWS Policy Generatorβ
- Repeat steps 1-4 above.
- Click on
Policy Generator
at the bottom of the Bucket Policy Editor.... see more