MEDIUM
Source
Trivy
ID
AVD-GCP-0020

Ensure that logging of lock waits is enabled.

Lock waits are often an indication of poor performance and often an indicator of a potential denial of service vulnerability, therefore occurrences should be logged for analysis.

Impact

Issues leading to denial of service may not be identified.

Follow the appropriate remediation steps below to resolve the issue.

Enable lock wait logging.

 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_lock_waits"
 			value = "on"
 		}
 	}
 }