> 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/aws-rds-postgres-cluster-does-not-have-query-logging-enabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS RDS Postgres Cluster does not have query logging enabled

### Synopsis

| Field               | Value                                                        |
| ------------------- | ------------------------------------------------------------ |
| Rule Type           | Detection                                                    |
| Finding Type        | AWS RDS Postgres Cluster does not have query logging enabled |
| Finding ID          | 60000627                                                     |
| Generates a Finding | This detection rule also generates a finding                 |
| Severity            | Informational                                                |
| Category            | CONFIGURATION                                                |
| Cloud Providers     | AWS                                                          |
| Platform Module     | CSPM                                                         |
| Asset Types         | RDS\_DATABASE\_CLUSTER                                       |

### Description

AWS RDS PostgreSQL clusters lacking query logging are susceptible to security breaches and operational issues. Disabling this crucial feature hinders the ability to monitor database activity, identify malicious queries, and troubleshoot performance problems.

The RDS PostgreSQL service allows configuring query logging parameters like 'log\_statement' and 'log\_min\_duration\_statement'. Without these enabled, attacks such as SQL injection may go undetected, and unauthorized data access might remain unnoticed. Troubleshooting becomes significantly more difficult, leading to extended downtime and increased operational costs.

The impact of this misconfiguration includes compromised data integrity, potential data breaches, and difficulty in identifying and responding to security incidents. Enabling query logging provides a detailed audit trail for security monitoring, performance analysis, and regulatory compliance, significantly improving security posture and operational efficiency.

To mitigate this risk, ensure 'log\_statement' and 'log\_min\_duration\_statement' are appropriately configured for all RDS PostgreSQL clusters. Regularly review the logs for suspicious activity and implement a robust security information and event management (SIEM) system to correlate log data and detect threats effectively.

### Remediation

To modify the custom DB cluster parameter group to enable query logging, follow the below steps:

1. Sign in to the AWS Management Console and open the Amazon RDS console.
2. In the navigation pane, choose 'Parameter groups'.
3. In the list, choose the above-created parameter group that you want to modify.
4. For Parameter group actions, choose 'Edit'.
5. Change the value of the 'log\_min\_duration\_statement parameter' to any value other than -1 you want to modify.
6. Change the value of 'log\_statement' according to the requirements.
7. Choose 'Save Changes'.
8. Reboot the primary (writer) DB instance in the cluster to apply the changes to it.
9. Then reboot the reader DB instances to apply the changes to them.

Please create a custom parameter group if the cluster has only the default parameter group using the following steps:

1. Sign in to the AWS Management Console and open the Amazon RDS console.
2. In the navigation pane, choose 'Parameter groups'.
3. Choose 'Create parameter group'. The Create parameter group window appears.
4. In the Parameter group family list, select a 'DB parameter group family'.
5. In the Type list, select 'DB cluster parameter group'.
6. In the Group name box, enter the name of the new DB cluster parameter group.
7. In the Description box, enter a description for the new DB cluster parameter group.
8. Choose 'Create'.

To modify an RDS cluster to use the custom parameter group, follow the below steps:

1. Sign in to the AWS Management Console and open the Amazon RDS console.
2. In the navigation pane, choose 'Databases', and then choose the 'DB instance' that you want to modify.
3. Choose 'Modify'. The Modify DB instance page appears.
4. Under 'Additional Configuration', select the above-created cluster parameter group from the DB parameter group dropdown.
5. Choose 'Continue' and check the summary of modifications.
6. (Optional) Choose 'Apply immediately' to apply the changes immediately. Choosing this option can cause downtime in some cases.
7. On the confirmation page, review your changes. If they are correct, choose 'Modify DB instance' to save your changes.


---

# 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/aws-rds-postgres-cluster-does-not-have-query-logging-enabled.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.
