MEDIUM
Source
Trivy
ID
AVD-GCP-0014

Temporary file logging should be enabled for all temporary files.

Temporary files are not logged by default. To log all temporary files, a value of 0 should set in the log_temp_files flag - as all files greater in size than the number of bytes set in this flag will be logged.

Impact

Follow the appropriate remediation steps below to resolve the issue.

Enable temporary file logging for all files

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
resource "google_sql_database_instance" "db" {
  name             = "db"
  database_version = "POSTGRES_12"
  region           = "us-central1"
  settings {
    database_flags {
      name  = "log_temp_files"
      value = "0"
    }
  }
}