LOW
Source
Trivy
ID
AVD-GCP-0021

Ensure that logging of long statements is disabled.

Logging of statements which could contain sensitive data is not advised, therefore this setting should preclude all statements from being logged.

Impact

Sensitive data could be exposed in the database logs.

Follow the appropriate remediation steps below to resolve the issue.

Disable minimum duration statement logging completely

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