More Info:

Ensures Storage bucket policies do not allow global write, delete, or read permissions. Storage buckets can be configured to allow the global principal to access the bucket via the bucket policy. This policy should be restricted only to known users or accounts.

Risk Level

Critical

Address

Security

Compliance Standards

CISGCP, CBP, HIPAA, ISO27001, HITRUST, SOC2, GDPR, NISTCSF, PCIDSS, FedRAMP

Triage and Remediation

Remediation

To remediate the “Bucket Should Not Allow Global Access” misconfiguration for GCP using GCP console, follow these steps:

  1. Go to the GCP console and select the project that contains the bucket with global access.

  2. Navigate to the Cloud Storage section of the console.

  3. Find the bucket that is allowing global access and click on its name to open its details page.

  4. Click on the “Permissions” tab.

  5. Scroll down to the “Public access prevention” section and click on the “Edit” button.

  6. In the “Public access prevention” window, select the “Enforced by Bucket Policy” option.

  7. Click on the “Save” button to apply the changes.

  8. Next, click on the “Bucket Policy” tab.

  9. In the bucket policy editor, enter the following JSON code to deny all public access to the bucket:

{
  "bindings": [
    {
      "members": [
        "allUsers"
      ],
      "role": "roles/storage.objectViewer"
    }
  ],
  "effect": "deny",
  "condition": {
    "bool": {
      "values": [
        true
      ]
    }
  }
}
  1. Click on the “Save” button to apply the policy.

After following these steps, the bucket will no longer allow global access and all public access will be denied.

Additional Reading: