PostgreSQL instances must have the log_min_messages flag set to a valid verbosity level. This ensures critical database events are recorded for detection and forensic analysis, while avoiding overly verbose debug logs that can expose sensitive information.
For Ansible Google Cloud SQL resources using the google.cloud.gcp_sql_instance (or gcp_sql_instance) module, ensure settings.database_flags contains an entry with name: "log_min_messages" and value set to one of the following: fatal, panic, log, error, warning, notice, info, debug1, debug2, debug3, debug4, or debug5. Resources missing this entry or using a value outside the allowed set are flagged.
Secure configuration example:
- name:Create Cloud SQL instance with secure logginggoogle.cloud.gcp_sql_instance:name:my-sql-instancesettings:database_flags:- name:log_min_messagesvalue:warning