The log_checkpoints setting is disabled on PostgreSQL DB Affecting Cloud SQL service in Google


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Logging/ Databases

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-ControlsCIS-GoogleHIPAAISO-27001NIST-800-53SOC-2
  • Snyk IDSNYK-CC-00353
  • creditSnyk Research Team

Description

The PostgreSQL database instance flag 'log_checkpoints' causes checkpoints and restart points to be logged which in turn generates query and error logs. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.

How to fix?

For google_sql_database_instance set the log_checkpoints field to on under settings/database_flags.

To enable the log_checkpoints setting:

Example Configuration

resource "google_sql_database_instance" "example" {

  database_version    = "POSTGRES_11"
  region              = "us-east1"
  deletion_protection = false

  settings {
    tier = "db-f1-micro"

    database_flags {
      name  = "log_checkpoints"
      value = "on"
    }
  }
}