More Info:

Ensure that the local_infile database flag for a Cloud SQL Mysql instance is set to off.

Risk Level

Medium

Address

Security

Compliance Standards

CISGCP, CBP

Triage and Remediation

Remediation

To remediate the MySQL Local Infile Flag Should Be Disabled misconfiguration for GCP using GCP console, follow these steps:

  1. Open the GCP Console and navigate to the Cloud SQL instances page.

  2. Select the instance for which you want to remediate the misconfiguration.

  3. Click on the “Edit” button at the top of the instance details page.

  4. Scroll down to the “Flags” section and click on the “Add item” button.

  5. In the “Name” field, enter “local_infile” (without quotes).

  6. In the “Value” field, enter “0” (without quotes).

  7. Click on the “Save” button at the bottom of the page to save the changes.

  8. Wait for the instance to restart with the new configuration.

  9. Verify that the MySQL Local Infile Flag is disabled by running the following command in the Cloud Shell:

    gcloud sql instances describe [INSTANCE_NAME] --format="get(settings.mysqlFlags)"

    Replace [INSTANCE_NAME] with the name of your instance.

    The output should show the “local_infile” flag with a value of “0”.

That’s it! You have successfully remediated the MySQL Local Infile Flag Should Be Disabled misconfiguration for GCP using GCP console.