Enable the PostgreSQL server parameter log_duration to record statement execution durations. Without duration logging, slow queries and malicious long-running activity can go undetected, hindering timely detection and forensic investigation.
In Ansible tasks using the azure.azcollection.azure_rm_postgresqlconfiguration or azure_rm_postgresqlconfiguration module, the parameter entry with name: log_duration must have value: 'ON'. Tasks missing the value property or with a value other than ON (case-insensitive) are flagged.
Secure Ansible task example:
- name:Enable log_duration for PostgreSQL serverazure.azcollection.azure_rm_postgresqlconfiguration:resource_group:myResourceGroupserver_name:myPostgresServername:log_durationvalue:"ON"