CIS Google Cloud Platform Foundation Benchmark v1.2.0/Cloud SQL Database Services - MySQL Database/53 of 83
6.1.3Ensure that the 'local_infile' database flag for a Cloud SQL Mysql instance is set to 'off'
Control family: Cloud SQL Database Services - MySQL Database
Control description
It is recommended to set the `local_infile` database flag for a Cloud SQL MySQL instance to `off`.
How to implement
ResponsibilityCustomerYou configure and operate this in your own cloud accounts.
The local_infile option lets a client ask the server to load a file from the client's own machine. A malicious or compromised server can abuse it to read files from clients, and a hijacked client can use it to push data in. Turning it off removes the feature where nobody needs it.
Before you start
The same on every cloud, before the steps in the tabs.
- Record in the MySQL configuration standard that local_infile is off, so every new instance starts with it.
- Ask application owners whether any import job loads local files, and agree another way to load data first.
Evidence
- The MySQL configuration standard
Not applicable. This benchmark covers Google Cloud only.
Not applicable. This benchmark covers Google Cloud only.
On Google Cloud the tasks set the flag on each MySQL instance in Cloud SQL, then watch for instances without it with Security Command Center.
Task 1Set local_infile to off on each MySQL instance
- Sign in to the Google Cloud console at console.cloud.google.com and open SQL.
- Choose the MySQL instance and select Edit.
- Expand Database flags (shown as Flags on some instances) and choose Add a database flag, or find the flag if it is already listed.
- Choose local_infile and set it to off, then choose Done.
- Choose Save; if the console says the change restarts the instance, schedule it for a quiet period first.
- Check it: the instance Overview lists local_infile with the value off under Database flags.
Task 2Keep it checked with the Security Health Analytics finding SQL_LOCAL_INFILE
- Open Security Command Center > Findings for the organization (Security Health Analytics runs on the Premium tier for most detectors).
- In the query editor, filter on category SQL_LOCAL_INFILE with state ACTIVE, and select Apply.
- Open each finding, read the resource and the explanation it gives, and set the flag on the instance it names.
- Check it: after the next Security Health Analytics scan, no active SQL_LOCAL_INFILE finding remains.
Evidence
- The Overview of each MySQL instance, listing local_infile set to off under Database flags
- Security Command Center, with no active SQL_LOCAL_INFILE finding
Console steps as of 5 November 2026. Not every step has been confirmed in a live console yet, and menus and labels can move between releases, so look for the nearest match if one has changed.