Check ID:
Provider: Azure
Service:
Severity: MEDIUM
Categories:
Resource type:
postgresql_flexible_server_log_disconnections_onProvider: Azure
Service:
postgresqlSeverity: MEDIUM
Categories:
loggingResource type:
microsoft.dbforpostgresql/flexibleserversWhat this check verifies
Azure Database for PostgreSQL Flexible Server uses thelog_disconnections setting to record when client sessions end and how long they lasted.
Risk
Without disconnection logs, session timelines and user activity are opaque, weakening auditability and forensics. Abuse such as stolen credentials, short-lived access, or hijacked sessions can go unnoticed, enabling data exfiltration and privilege misuse, impacting confidentiality and integrity.Recommendation
Enablelog_disconnections on all Flexible Servers. Complement with log_connections and appropriate duration/statement logging, centralize and retain logs, and alert on abnormal connect/disconnect patterns. Restrict log access. This enforces accountability, supports defense in depth, and speeds incident response.
Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
az postgres flexible-server parameter set —resource-group <RESOURCE_GROUP> —server-name <SERVER_NAME> —name log_disconnections —value on
References
- https://learn.microsoft.com/en-us/azure/postgresql/security/security-audit?tabs=portal
- https://learn.microsoft.com/en-us/azure/postgresql/single-server/how-to-configure-server-parameters-using-portal
Where this check fires
This check runs on every scheduled scan against your Azure account. Findings appear at Cloud Security → Findings filterable byCheck ID = postgresql_flexible_server_log_disconnections_on. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to Azure checks