| name | cis-azure-database-5.7 |
| description | Ensure server parameter 'error_server_log_file' is Enabled for MySQL Database Server |
| category | cis-azure-database |
| version | 2.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","mysql","database"] |
| cis_id | 5.7 |
| cis_benchmark | CIS Microsoft Azure Database Services Benchmark v2.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
5.7 Ensure server parameter 'error_server_log_file' is Enabled for MySQL Database Server (Manual)
Profile Applicability
Description
Enable error logs on MySQL flexible servers.
Rationale
With error_server_log_file enabled, MySQL Database will log database errors to a logging solution. These logs assist in producing a forensic trail that can be used for investigation or for detection when paired with a SIEM.
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
Audit from Azure Portal
- Login to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for MySQL Servers.
- For each database, under
Settings, click Server parameters.
- In the row under
Save, select All.
- In the filter bar, type
error_server_log_file.
- Ensure that the
VALUE for error_server_log_file is ON.
Audit from PowerShell
Ensure the below command returns a Value of on:
Get-AzMySqlFlexibleServerConfiguration -ResourceGroupName <resourceGroup> -ServerName <serverName> -Name error_server_log_file
Expected Result
The error_server_log_file server parameter should return a value of ON.
Remediation
Remediate 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, click Server parameters.
- Set
error_server_log_file to ON.
- 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)