> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-mysql-instance-with-local-infile-database-flag-is-not-disabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP MySQL instance with local\_infile database flag is not disabled

### Synopsis

| Field               | Value                                                               |
| ------------------- | ------------------------------------------------------------------- |
| Rule Type           | Detection                                                           |
| Finding Type        | GCP MySQL instance with local\_infile database flag is not disabled |
| Finding ID          | 60000416                                                            |
| Generates a Finding | This detection rule also generates a finding                        |
| Severity            | Medium                                                              |
| Category            | CONFIGURATION                                                       |
| Cloud Providers     | GCP                                                                 |
| Platform Module     | CSPM                                                                |
| Asset Types         | GOOGLE\_CLOUD\_SQL\_DB\_INSTANCE                                    |
| ATT\&CK Tactic      | TA0112 (TA0112)                                                     |
| ATT\&CK Technique   | T1685 (T1685)                                                       |

### Description

MySQL instances with the 'local\_infile' flag enabled are susceptible to data exfiltration attacks. Enabling this flag allows clients to load data from local files, bypassing security controls and potentially compromising sensitive data.

The 'local\_infile' flag in Google Cloud Platform (GCP) MySQL instances controls whether clients can load data from local files using 'LOAD DATA LOCAL INFILE'. Leaving this flag enabled presents a significant security risk. Attackers could exploit this misconfiguration to upload malicious files or extract sensitive data from the database.

A compromised database could lead to data breaches, regulatory fines, and reputational damage. Disabling 'local\_infile' ensures that only data explicitly provided to the database is processed, mitigating the risk of unauthorized data loading and exfiltration.

To remediate this misconfiguration, disable the 'local\_infile' flag for all GCP MySQL instances. Regularly audit database configurations to ensure this setting remains disabled.

### Remediation

**Manual steps:**

Google Cloud SQL DB Instance - Manual remediation steps:

1. Login to GCP Console
2. Navigate to SQL
3. Select the MySQL instance for which you want to enable the database flag from the list
4. Click 'Edit'

   NOTE: If the instance is stopped, You need to START instance first to edit the configurations, then Click on EDIT.
5. Go to the 'Flags' section under 'Configuration options'
6. Click 'Add item', choose the flag 'local\_infile' from the drop-down menu and set the value to 'Off'

   OR

   If 'local\_infile' database flag is already set to 'On', from the drop-down menu set the value to 'Off'
7. Click on 'Save'


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-mysql-instance-with-local-infile-database-flag-is-not-disabled.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
