More Info:
Ensure that GCP Cloud Monitoring uses HTTPS only for checking the health of backend resources.Risk Level
MediumAddress
SecurityCompliance Standards
CBPTriage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration “Cloud Monitoring Should Use HTTPS For Backend Resource Health Check” for GCP using GCP console, please follow the below steps:
- Login to your GCP console.
- Go to the Cloud Monitoring page.
- In the left navigation menu, select “Uptime Checks”.
- Select the uptime check that needs to be remediated.
- Click on the “Edit” button.
- In the “Check Request” section, select “HTTPS” as the protocol.
- In the “Check Request” section, enter the URL of the backend resource.
- In the “Check Request” section, select the appropriate HTTP method.
- In the “Advanced Settings” section, select “Require valid SSL certificate” checkbox.
- Click on the “Save” button to save the changes.
Using CLI
Using CLI
To remediate the misconfiguration “Cloud Monitoring Should Use HTTPS For Backend Resource Health Check” for GCP using GCP CLI, follow the below steps:Replace [HEALTH_CHECK_NAME] with the name of the health check you want to update.This will display the details of the health check, including the use of HTTPS.By following these steps, you can remediate the misconfiguration “Cloud Monitoring Should Use HTTPS For Backend Resource Health Check” for GCP using GCP CLI.
- Open the Cloud Shell in the GCP console.
- Run the following command to set the default project:
- Run the following command to update the health check configuration:
- Verify the updated configuration by running the following command:
Using Python
Using Python
To remediate the misconfiguration “Cloud Monitoring Should Use HTTPS For Backend Resource Health Check” in GCP using Python, follow these steps:
- Import the required libraries for interacting with GCP using Python. For example, you can use the
google-authandgoogle-api-python-clientlibraries.
- Set up the authentication credentials using a service account key file. You can create a service account with the required permissions for the Cloud Monitoring API in the GCP console and download the key file.
- Create a client object for the Cloud Monitoring API using the
buildfunction and the appropriate API version.
- Get the list of backend services in the project using the
listmethod of thebackendServicesresource.
- For each backend service, check if the health check protocol is set to HTTPS. If not, update the backend service using the
updatemethod of thebackendServicesresource.
- Save the Python script and run it using a Python interpreter.

