PostgreSQL Log Connections Not Set
- Query id: 7b47138f-ec0e-47dc-8516-e7728fe3cc17
- Query name: PostgreSQL Log Connections Not Set
- Platform: Ansible
- Severity: Medium
- Category: Observability
- URL: Github
Description¶
Make sure that for PostgreSQL Database, server parameter 'log_connections' is set to 'ON'
Documentation
Code samples¶
Code samples with security vulnerabilities¶
Postitive test num. 1 - yaml file
---
- name: Update PostgreSQL Server setting
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: off
- name: Update PostgreSQL Server setting2
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: Off
- name: Update PostgreSQL Server setting3
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: OFF
- name: Update PostgreSQL Server setting4
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: "off"
- name: Update PostgreSQL Server setting5
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: "Off"
- name: Update PostgreSQL Server setting6
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: "OFF"
Code samples without security vulnerabilities¶
Negative test num. 1 - yaml file
- name: Update PostgreSQL Server setting
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: on
- name: Update PostgreSQL Server setting2
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: On
- name: Update PostgreSQL Server setting3
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: ON
- name: Update PostgreSQL Server setting4
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: on
- name: Update PostgreSQL Server setting5
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: On
- name: Update PostgreSQL Server setting6
azure.azcollection.azure_rm_postgresqlconfiguration:
resource_group: myResourceGroup
server_name: myServer
name: log_connections
value: ON