Temporary file information is not logged Affecting Cloud SQL service in Google


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

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-00352
  • credit Snyk Research Team

Description

The PostgreSQL database instance flag 'log_temp_files' controls logging temporary files and their size when deleted. Setting this flag to 0 causes all temporary files to be logged. If any temporary files are not logged, it may be more difficult to identify potential performance issues due to either poor application coding or deliberate resource starvation attempts.

How to fix?

Set the settings.database_flags.name attribute to "log_temp_files", and settings.database_flags.value attribute to 0.

Example Configuration

resource "google_sql_database_instance" "allowed" {
  name             = "master-instance"
  database_version = "POSTGRES_11"
  region           = "us-central1"

  settings {
    tier = "db-f1-micro"
    database_flags {
      name  = "log_temp_files"
      value = 0
    }
  }
}