Skip to content

Files

Latest commit

 

History

History
43 lines (34 loc) · 866 Bytes

google-sql-pg-log-lock-waits.md

File metadata and controls

43 lines (34 loc) · 866 Bytes

Pattern: Disabled lock wait logging for Google PostgreSQL

Issue: -

Description

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.

Resolution: Enable lock wait logging.

Examples

Example of incorrect code:

resource "google_sql_database_instance" "db" {
	name             = "db"
	database_version = "POSTGRES_12"
	region           = "us-central1"
	settings {
		database_flags {
			name  = "log_lock_waits"
			value = "off"
		}
	}
}

Example of correct code:

resource "google_sql_database_instance" "db" {
	name             = "db"
	database_version = "POSTGRES_12"
	region           = "us-central1"
	settings {
		database_flags {
			name  = "log_lock_waits"
			value = "on"
		}
	}
}