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 enviroment 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-Controls CIS-Google HIPAA ISO-27001 NIST-800-53 SOC-2
  • Snyk ID SNYK-CC-00353
  • credit Snyk 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"
    }
  }
}