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
  • Tags:
  • Policy Type: COMPLIANCE_POLICY
  • Policy Categories: RELIABILITY, PERFORMANCE

Logic​

Description​

Open File

Description​

Set audit_log_events to include CONNECTION on MySQL flexible servers.

Rationale​

Enabling CONNECTION helps MySQL to log 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 additional costs for log storage. For high-traffic databases, these logs can 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 following command returns a value that includes CONNECTION:

az mysql flexible-server parameter show \
--resource-group {{resource-group-name}} \
--server-name {{server-name}} \

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

Remediation​

Open File

Remediation​

From Azure Portal​

  1. Log in 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 following command to set audit_log_events to CONNECTION:

az mysql flexible-server parameter set \
--resource-group {{resource-group-name}} \
--server-name {{server-name}} \
--name audit_log_events \
--value CONNECTION

From PowerShell​

Use the following command to set audit_log_events to CONNECTION:

... see more

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
πŸ’Ό CIS Azure v3.0.0 β†’ πŸ’Ό 5.3.4 Ensure server parameter 'audit_log_events' has 'CONNECTION' set for MySQL flexible server (Automated)1no data
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Logging and Monitoring Configuration77no data