More Info:

Ensure that GCP CNmaes Have Storage Bucket

Risk Level

High

Address

Security

Compliance Standards

CBP

Triage and Remediation

Remediation

To remediate the misconfiguration of missing CNames for a GCP storage bucket in GCP DNS using the GCP console, follow these steps:

  1. Open the GCP Console (https://console.cloud.google.com) and log in to your GCP account.

  2. Navigate to the Cloud Storage section by clicking on the menu icon in the top-left corner and selecting “Storage” under the “Storage” category.

  3. Select the storage bucket for which you want to add CNames.

  4. In the bucket details page, click on the “Edit website configuration” button located in the top bar.

  5. Scroll down to the “Custom domain” section and click on the “Add a custom domain” button.

  6. In the “Domain name” field, enter the desired domain name or subdomain for your storage bucket. For example, if you want to use “assets.example.com,” enter “assets” in the field.

  7. Click on the “Add” button to add the custom domain.

  8. GCP will validate the domain ownership by providing you with a unique verification token. Copy the token provided.

  9. Open a new tab or window and navigate to your DNS provider’s website.

  10. Sign in to your DNS provider’s console and locate the DNS management section.

  11. Create a new CNAME record for your desired domain or subdomain. In the “Name” or “Host” field, enter the desired domain or subdomain name (e.g., “assets” or “assets.example.com”).

  12. In the “Value” or “Points to” field, enter the storage bucket URL provided by GCP. It should be in the format “c.storage.googleapis.com” followed by your bucket name (e.g., “c.storage.googleapis.com/example-bucket”).

  13. Save the CNAME record.

  14. Return to the GCP console tab and click on the “Verify” button next to the domain you added.

  15. Paste the verification token you copied earlier into the provided field and click on the “Verify” button.

  16. Once the domain ownership is verified, click on the “Save” button to apply the changes.

  17. Wait for DNS propagation to complete, which may take some time (usually a few minutes to a few hours) depending on your DNS provider.

After following these steps, the CNames for your GCP storage bucket will be added and properly configured in GCP DNS using the GCP console.