Cis Azure Database 6.9
DevOps & Securitycis-azure-database-6.9Cis Azure Database 6.9 is an Agent Skill for devops & security published in the CyberStrikeus/CyberStrike repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Ensure server parameter 'log_connections' is set to 'ON' for PostgreSQL servers
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/CyberStrikeus/CyberStrike/blob/HEAD/.cyberstrike/skill/CIS_benchmarks/Cloud_Providers/Microsoft_Azure/CIS_Microsoft_Azure_Database_Services_Benchmark_v2.0.0/cis-azure-database-6.9/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/cis-azure-database-6-9, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
6.9 Ensure server parameter 'log_connections' is set to 'ON' for PostgreSQL servers (Automated)
Profile Applicability
- Level 1
Description
Enable log_connections on PostgreSQL servers.
Rationale
Enabling log_connections helps PostgreSQL Database to log attempted connection to the server, as well as successful completion of client authentication. Log data can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.
Impact
None documented.
Audit Procedure
Audit from Azure Portal
- Login to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for PostgreSQL servers. - For each server, under
Settings, clickServer parameters. - In the filter bar, type
log_connections. - Ensure that
log_connectionsis set toON.
Audit from Azure CLI
Ensure the below command returns a Value of on:
az postgres flexible-server parameter show --resource-group <resourceGroup> --server-name <serverName> --name log_connections
Audit from PowerShell
Ensure the below command returns a Value of on:
Get-AzPostgreSqlFlexibleServerConfiguration -ResourceGroupName <resourceGroup> -ServerName <serverName> -Name log_connections
Audit from Azure Policy
Policy ID: 086709ac-11b5-478d-a893-9567a16d2ae3
Name: 'Log connections should be enabled for PostgreSQL flexible servers'
Expected Result
The log_connections server parameter should be set to ON.
Remediation
Remediate from Azure Portal
- Login to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for PostgreSQL servers. - For each server, under
Settings, clickServer parameters. - In the filter bar, type
log_connections. - Set
log_connectionstoON. - Click
Save.
Remediate from Azure CLI
Use the below command to update log_connections configuration:
az postgres flexible-server parameter set --resource-group <resourceGroupName> --server-name <serverName> --name log_connections --value on
Remediate from PowerShell
Use the below command to update log_connections configuration:
Update-AzPostgreSqlFlexibleServerConfiguration -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -Name log_connections -Value on
Default Value
By default, log_connections is disabled (set to off).
References
- https://docs.microsoft.com/en-us/rest/api/postgresql/configurations/listbyserver
- https://docs.microsoft.com/en-us/azure/postgresql/howto-configure-server-parameters-using-portal
- https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-logging-threat-detection#lt-3-enable-logging-for-security-investigation
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/get-azpostgresqlconfiguration
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/update-azpostgresqlconfiguration
Profile
- Level 1