Ensure that the "cloudsql.enable_pgaudit" database flag is enabled for your Google Cloud PostgreSQL server instances in order to allow for database auditing that is often required to comply with government, financial, and ISO certifications.
This rule resolution is part of the Conformity Security & Compliance tool for GCP.
optimisation
excellence
efficiency
The "cloudsql.enable_pgaudit" flag enables database auditing in PostgreSQL through the open-source pgAudit extension. Once the database flag is turned on, and the pgAudit extension is installed, it provides detailed session and object logging that can help you to achieve regulatory compliance. It also provides auditing capabilities to mitigate threats by monitoring security events on the associated PostgreSQL database instance. By default, the database flag is set to "off" and the pgAudit extension is not enabled for PostgreSQL database instances.
Note 1: Some database flag settings can affect instance availability and/or stability, and eventually remove the PostgreSQL instance from the Google Cloud SQL Service Level Agreement (SLA).
Note 2: This conformity rule assumes that the Data Access Audit logs are enabled for your GCP projects and have sufficient privileges.
Note 3: This conformity rule only checks the cloudsql.enable_pgaudit flag. To fully ensure the compliant status you will also need to manually check the pgAudit extension installation by logging into the PostrgeSQL server (see audit steps).
Audit
To determine if the "cloudsql.enable_pgaudit" flag is enabled for your Google Cloud PostgreSQL database instances, perform the following operations:
Remediation / Resolution
To turn on the "cloudsql.enable_pgaudit" database flag for your Google Cloud PostgreSQL database instances, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- Cloud SQL for PostgreSQL documentation
- Configure database flags
- Audit for PostgreSQL using pgAudit
- Edit instances
- CIS Security Documentation
- Securing Google Cloud Computing Platform
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud sql instances list
- gcloud sql instances describe
- gcloud sql instances patch