π Azure MySQL Flexible Server audit_log_enabled Parameter is not set to ON π’
- Contextual name: π Flexible Server audit_log_enabled Parameter is not set to ON π’
- ID:
/ce/ca/azure/mysql-database/flexible-server-audit-log-enabled-parameter
- Located in: π Azure MySQL Database
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
RELIABILITY
PERFORMANCE
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Enable
audit_log_enabled
onMySQL flexible servers
.Rationaleβ
Enabling
audit_log_enabled
helps MySQL Database to log items such as connection attempts to the server, DDL/DML access, and more. Log data can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.Impactβ
There are further costs incurred for storage of logs. For high traffic databases these logs will be significant. Determine your organization's needs before enabling.
Auditβ
From Azure Portalβ
- Login to Azure Portal using https://portal.azure.com.
- Select
Azure Database for MySQL Servers
.- For each database, under the Settings, click
Server parameters
.- In the filter bar, type
audit_log_enabled
.- Ensure that the
VALUE
foraudit_log_enabled
isON
.From Azure CLIβ
Ensure the below command returns a
value
ofon
:az mysql flexible-server parameter show --resource-group <resourceGroup> --server-name <serverName> --name audit_log_enabled
From PowerShellβ
Ensure the below command returns a
value
ofon
:... see more
Remediationβ
Remediationβ
From Azure Portalβ
Part 1 - Turn on audit logsβ
- Login to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for MySQL flexible servers
.- For each database, under
Settings
, clickServer parameters
.- Set
audit_log_enabled
toON
.- Click
Save
.Part 2 - Capture audit logs (diagnostic settings is for example only, send these logs to the appropriate data sink for your logging needs)β
- Under Monitoring, select
Diagnostic settings
.- Select
+ Add diagnostic setting
.- Provide a diagnostic setting name.
- Under Categories, select
MySQL Audit Logs
.- Specify destination details.
- Click
Save
.It may take up to 10 minutes for the logs to appear in the configured destination.
From Azure CLIβ
Use the below command to enable audit_log_enabled:
az mysql flexible-server parameter set --resource-group <resourceGroup> --server-name <serverName> --name audit_log_enabled --value on
From PowerShellβ
Use the below command to enable audit_log_enabled:
Update-AzMySqlFlexibleServerConfiguration -ResourceGroupName <resourceGroup> -ServerName <serverName> -Name audit_log_enabled -Value on
... [see more](remediation.md)
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ CIS Azure v3.0.0 β πΌ 5.3.3 Ensure server parameter 'audit_log_enabled' is set to 'ON' for MySQL flexible server (Automated) | 1 | |||
πΌ Cloudaware Framework β πΌ Logging and Monitoring Configuration | 49 |