π Azure MySQL Flexible Server audit_log_events Parameter is not set with the CONNECTION event π’
- Contextual name: π Flexible Server audit_log_events Parameter is not set with the CONNECTION event π’
- ID:
/ce/ca/azure/mysql-database/flexible-server-audit-log-events-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β
Set
audit_log_enabled
to includeCONNECTION
onMySQL flexible servers
.Rationaleβ
Enabling
CONNECTION
helps MySQL Database to log items such as successful and failed connection attempts to the server. 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β
- From Azure Home select the Portal Menu.
- Go to
Azure Database for MySQL flexible servers
.- For each database, under
Settings
, clickServer parameters
.- In the filter bar, type
audit_log
.- Ensure that the
VALUE
foraudit_log_enabled
isON
.- Ensure that the
VALUE
foraudit_log_events
includesCONNECTION
.From Azure CLIβ
Ensure the below command returns a
value
that includesCONNECTION
:az mysql flexible-server parameter show --resource-group <resourceGroup> --server-name <serverName> --name audit_log_events
... [see more](description.md)
Remediationβ
Remediationβ
From Azure Portalβ
- Login to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for MySQL flexible servers
.- For each database, under
Settings
, clickServer parameters
.- In the filter bar, type
audit_log
.- Set
audit_log_enabled
toON
.- In the drop-down next to
audit_log_events
, checkCONNECTION
.- Click
Save
.- Under
Monitoring
, selectDiagnostic settings
.- Select
+ Add diagnostic setting
.- Provide a diagnostic setting name.
- Under
Categories
, selectMySQL 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 set
audit_log_events
toCONNECTION
:az mysql flexible-server parameter set --resource-group <resourceGroup> --server-name <serverName> --name audit_log_events --value CONNECTION
From PowerShellβ
Use the below command to set
audit_log_events
toCONNECTION
:Update-AzMySqlFlexibleServerConfiguration -ResourceGroupName <resourceGroup> -ServerName <serverName> -Name audit_log_events -Value CONNECTION
... [see more](remediation.md)
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ CIS Azure v3.0.0 β πΌ 5.3.4 Ensure server parameter 'audit_log_events' has 'CONNECTION' set for MySQL flexible server (Automated) | 1 | |||
πΌ Cloudaware Framework β πΌ Logging and Monitoring Configuration | 49 |