Skip to main content

πŸ“ 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​

Our Metadata​

  • Policy Type: COMPLIANCE_POLICY
  • Policy Category:
    • RELIABILITY
    • PERFORMANCE

Logic​

Description​

Open File

Description​

Set audit_log_enabled to include CONNECTION on MySQL 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​
  1. From Azure Home select the Portal Menu.
  2. Go to Azure Database for MySQL flexible servers.
  3. For each database, under Settings, click Server parameters.
  4. In the filter bar, type audit_log.
  5. Ensure that the VALUE for audit_log_enabled is ON.
  6. Ensure that the VALUE for audit_log_events includes CONNECTION.
From Azure CLI​

Ensure the below command returns a value that includes CONNECTION:

az mysql flexible-server parameter show --resource-group <resourceGroup> --server-name <serverName> --name audit_log_events

... [see more](description.md)

Remediation​

Open File

Remediation​

From Azure Portal​

  1. Login to Azure Portal using https://portal.azure.com.
  2. Go to Azure Database for MySQL flexible servers.
  3. For each database, under Settings, click Server parameters.
  4. In the filter bar, type audit_log.
  5. Set audit_log_enabled to ON.
  6. In the drop-down next to audit_log_events, check CONNECTION.
  7. Click Save.
  8. Under Monitoring, select Diagnostic settings.
  9. Select + Add diagnostic setting.
  10. Provide a diagnostic setting name.
  11. Under Categories, select MySQL Audit Logs.
  12. Specify destination details.
  13. 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 to CONNECTION:

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 to CONNECTION:

Update-AzMySqlFlexibleServerConfiguration -ResourceGroupName <resourceGroup> -ServerName <serverName> -Name audit_log_events -Value CONNECTION

... [see more](remediation.md)

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlags
πŸ’Ό 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 Configuration49