Triage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of Cloud CDN Global Backend Services should have Connection Draining for GCP using GCP console, follow these steps:
- Open the GCP console and select the project where the misconfiguration exists.
- Navigate to the Cloud CDN page in the console.
- Select the name of the CDN that you want to remediate.
- In the left-hand navigation menu, click on “Backend Services.”
- Click on the name of the backend service that you want to remediate.
- In the “Backend Configuration” section, click on “Edit.”
- Scroll down to the “Connection Draining” section and toggle the switch to “On.”
- Set the “Draining Timeout” to the desired value in seconds.
- Click on “Save” to apply the changes.
Using CLI
Using CLI
To remediate the misconfiguration “Cloud CDN Global Backend Services Should Have Connection Draining” for GCP using GCP CLI, follow these steps:Replace [BACKEND_SERVICE_NAME] with the name of the identified global backend service, and [TIMEOUT_IN_SECONDS] with the desired connection draining timeout in seconds. For example:This command will enable connection draining for the identified global backend service with a timeout of 300 seconds (5 minutes).
5. Verify that the connection draining configuration has been applied by running the following command:Replace [BACKEND_SERVICE_NAME] with the name of the identified global backend service. This command should return the connection draining configuration for the identified global backend service.With these steps, you have successfully remediated the misconfiguration “Cloud CDN Global Backend Services Should Have Connection Draining” for GCP using GCP CLI.
- Open the Cloud Shell in the GCP Console.
- Run the following command to list all the backend services in your GCP project:
- Identify the global backend service that you want to remediate.
- Run the following command to enable connection draining for the identified global backend service:
Using Python
Using Python
To remediate the misconfiguration of Cloud CDN Global Backend Services not having connection draining in GCP using Python, follow these steps:By following these steps, you can remediate the misconfiguration of Cloud CDN Global Backend Services not having connection draining in GCP using Python.
- Import the necessary libraries:
- Set up authentication:
- Define the project ID, region, and backend service name:
- Get the current backend service configuration:
- Check if connection draining is enabled:
- Update the backend service configuration:
- Verify that connection draining is enabled: