Other Articles

MySQL Flexible Server – Enable Audit Logs

This check ensures that audit logging is enabled for Azure Database for MySQL Flexible Servers. Audit logs help track database activities, monitor administrative operations, and detect unauthorized access or suspicious behavior.

Check Details

  • Resource: Azure Database for MySQL Flexible Server
  • Check: Ensure Audit Logs Are Enabled
  • Risk: If audit logging is not enabled, critical database activities such as login attempts, configuration changes, and data modifications may not be recorded, making it difficult to investigate security incidents or meet compliance requirements.

Remediation via Azure Portal

  1. Log in to the Azure Portal. Azure Portal dashboard
  2. Navigate to Azure Database for MySQL Flexible Servers and select the affected server. Azure MySQL Flexible Servers list
  3. In the left-hand menu, select Server parameters under Settings. MySQL server parameters
  4. Search for the parameter audit_log_enabled.
  5. Ensure audit_log_enabled is set to ON. MySQL server Audit log parameters
  6. Click Save to apply the configuration changes.

Remediation via Azure CLI

  1. Open Azure Cloud Shell or a local terminal with Azure CLI installed. Azure Cloud Shell
  2. Check the current audit log configuration:

    az mysql flexible-server parameter show \
     --resource-group <resource-group> \
     --server-name <mysql-server-name> \
     --name audit_log_enabled
    
  3. Enable audit logging:

    az mysql flexible-server parameter set \
     --resource-group <resource-group> \
     --server-name <mysql-server-name> \
     --name audit_log_enabled \
     --value ON
    
  4. Verify that audit logging is enabled:

    az mysql flexible-server parameter show \
     --resource-group <resource-group> \
     --server-name <mysql-server-name> \
     --name audit_log_enabled \
     --query value
    

Replace <resource-group> and <mysql-server-name> with your actual values. The output should confirm that the value is set to ON.