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


Severity

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

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-00352
  • creditSnyk 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
    }
  }
}