> 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-postgresql-instance-database-flag-log-connections-is-disabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP PostgreSQL instance database flag log\_connections is disabled

### Synopsis

| Field               | Value                                                              |
| ------------------- | ------------------------------------------------------------------ |
| Rule Type           | Detection                                                          |
| Finding Type        | GCP PostgreSQL instance database flag log\_connections is disabled |
| Finding ID          | 60000413                                                           |
| Generates a Finding | This detection rule also generates a finding                       |
| Severity            | Informational                                                      |
| Category            | CONFIGURATION                                                      |
| Cloud Providers     | GCP                                                                |
| Platform Module     | CSPM                                                               |
| Asset Types         | GOOGLE\_CLOUD\_SQL\_DB\_INSTANCE                                   |

### Description

Cloud SQL PostgreSQL instances with the `log_connections` flag disabled pose a significant security risk. Disabling this crucial logging feature hinders the ability to detect and respond to unauthorized access attempts.

The `log_connections` flag within the PostgreSQL instance's configuration controls connection logging. Its disablement prevents recording connection attempts, successful or failed. This lack of logging makes it difficult to identify malicious actors attempting to breach the database, analyze connection patterns, and track down intrusions. Successful attacks may go unnoticed, leading to data breaches and potential financial loss.

A misconfigured `log_connections` setting severely impacts security monitoring and incident response. Without connection logs, detecting suspicious activity, such as brute-force attacks or unauthorized access, becomes nearly impossible. Proactive threat hunting is significantly impaired. Enabling this setting provides invaluable audit trails for forensic analysis and compliance purposes.

To mitigate this risk, ensure the `log_connections` flag is enabled for all Cloud SQL PostgreSQL instances. Regularly review the connection logs for anomalous activity. Implement security information and event management (SIEM) solutions to aggregate and analyze these logs for early threat detection.

### Remediation

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

   NOTE: If the instance is stopped, You need to START the instance first to edit the configurations, then Click on EDIT.
5. Go to the 'Flags' section under 'Customize your instance'
6. To set a flag that has not been set on the instance before, click 'Add FLAG', choose the flag 'log\_connections' from the drop-down menu and set the value as 'on'.
7. If it is already set to 'off' for 'log\_connections', from the drop-down menu set the value as 'on'
8. Click on 'DONE' for the added/edited flag.
9. 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-postgresql-instance-database-flag-log-connections-is-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.
