Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Ensure S3 Bucket Policy Rule

Check the compliance status of setting S3 Bucket Policy to deny HTTP requests.

RuleEnsure S3 Bucket Policy is set to deny HTTP requests
Frameworkcis_v150
Severity
Low

Rule Description:

The rule requires that the S3 bucket policy deny all HTTP requests for cis_v150. This ensures that the bucket is not accessible via insecure HTTP protocols, thereby enforcing secure communication.

Troubleshooting Steps:

  1. 1.
    Validate if the S3 bucket policy exists and has the required deny statement for HTTP requests targeting cis_v150.
  2. 2.
    Check if the HTTP requests are being denied by accessing the bucket resources using HTTP.
  3. 3.
    Review any error messages or logs related to denied HTTP requests.

Necessary Codes:

The necessary code depends on the existing S3 bucket policy. If there is an existing policy, you may need to edit it to include the deny statement for HTTP requests for cis_v150. If there is no existing policy, you will need to create one.

Step-by-step Guide for Remediation:

  1. 1.
    Open the AWS Management Console and navigate to the S3 service.
  2. 2.
    From the list of buckets, select the bucket in question that requires the policy update.
  3. 3.
    Click on the "Permissions" tab and then choose "Bucket Policy."
  4. 4.
    Review the existing bucket policy. If there is no existing policy, proceed to step 6.
  5. 5.
    Edit the existing policy and add the deny statement for HTTP requests targeting cis_v150. The policy JSON should resemble the following:
{
    "Version": "2012-10-17",
    "Id": "DenyHTTPRequestsForCis_V150",
    "Statement": [
        {
            "Sid": "DenyHTTP",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*",
            "Condition": {
                "StringEquals": {
                    "aws:SourceProtocol": "HTTP",
                    "aws:SourceCidrIp": "cis_v150"
                }
            }
        }
    ]
}

Note: Replace "YOUR_BUCKET_NAME" with your actual bucket name.

  1. 1.
    If there is no existing policy, create a new policy that includes the above deny statement. Copy and paste the policy JSON into the bucket policy editor.
  2. 2.
    Save the changes by clicking on the "Save" button.
  3. 3.
    Test whether the bucket policy is working by attempting to access the bucket resources using an HTTP request targeting cis_v150. It should be denied.
  4. 4.
    Monitor the bucket for any denied access attempts or errors related to HTTP requests.
  5. 5.
    If necessary, adjust the policy further or consult AWS support for further assistance.

By following these steps, you can ensure that the S3 bucket policy denies all HTTP requests for cis_v150.

Is your System Free of Underlying Vulnerabilities?
Find Out Now