Skip to main content

More Info:

Ensure that the contained database authentication database flag for Cloud SQL on the SQL Server instance is set to off.

Risk Level

Medium

Address

Security

Compliance Standards

CISGCP, CBP

Triage and Remediation

Remediation

Using Console

To remediate the “Database Authentication Flag Should Be Disabled” misconfiguration for GCP using GCP console, follow these steps:
  1. Open the Google Cloud Console and navigate to the Cloud SQL instances page.
  2. Select the instance you want to remediate.
  3. Click on the Edit button at the top of the page.
  4. Scroll down to the “Authorization” section.
  5. In the “Authorized networks” section, click on the “Add network” button.
  6. Add your IP address or the IP address range that should be authorized to access the instance.
  7. In the “Database flags” section, click on the “Add database flag” button.
  8. Add the flag “skip_grant_tables” and set its value to “on”.
  9. Click on the “Save” button to save the changes.
By following these steps, you have disabled the database authentication flag and added the authorized network to access the instance.

To remediate the “Database Authentication Flag Should Be Disabled” misconfiguration in GCP using GCP CLI, you can follow the below steps:
  1. Open the Cloud Shell in your GCP console.
  2. Run the following command to check the current status of the database authentication flag:
    Replace [INSTANCE_NAME] with the name of your SQL instance.
  3. If the output of the above command contains “requireSsl: true”, it means that the database authentication flag is enabled and needs to be disabled.
  4. Run the following command to disable the database authentication flag:
    Replace [INSTANCE_NAME] with the name of your SQL instance.
  5. Confirm the change by running the following command:
    The output should be “False”, indicating that the database authentication flag has been successfully disabled.
  6. Verify that the change has been applied by checking the authorized networks again:
    The output should not contain “requireSsl: true” anymore.
By following these steps, you should be able to remediate the “Database Authentication Flag Should Be Disabled” misconfiguration in GCP using GCP CLI.
To remediate the misconfiguration “Database Authentication Flag Should be Disabled” in GCP using python, follow the below steps:Step 1: Install the necessary libraries
Step 2: Authenticate to GCP
Step 3: Remediate the misconfiguration
Note: This code assumes that the database authentication flag is stored in GCP Secret Manager. If the flag is stored elsewhere, such as in a configuration file or environment variable, the code will need to be modified accordingly.