Skip to content

Files

Latest commit

12c283d · May 6, 2022

History

History
64 lines (43 loc) · 2.71 KB

howto-configure-audit-logs-cli.md

File metadata and controls

64 lines (43 loc) · 2.71 KB
title description author ms.author ms.service ms.topic ms.date ms.custom
Access audit logs - Azure CLI - Azure Database for MariaDB
This article describes how to configure and access the audit logs in Azure Database for MariaDB from the Azure CLI.
savjani
pariks
mariadb
how-to
05/06/2022
devx-track-azurecli
kr2b-contr-experiment

Configure and access Azure Database for MariaDB audit logs in the Azure CLI

You can configure the Azure Database for MariaDB audit logs from the Azure CLI.

[!INCLUDE quickstarts-free-trial-note]

Prerequisites

To complete this guide:

[!INCLUDE azure-cli-prepare-your-environment-no-header.md]

  • This article requires version 2.0 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.

Configure audit logging

Important

It is recommended to only log the event types and users required for your auditing purposes to ensure your server's performance is not heavily impacted.

Enable and configure audit logging using the following steps:

  1. Turn on audit logs by setting the audit_logs_enabled parameter to "ON".

    az mariadb server configuration set --name audit_log_enabled --resource-group myresourcegroup --server mydemoserver --value ON
    
  2. Select the event types to be logged by updating the audit_log_events parameter.

    az mariadb server configuration set --name audit_log_events --resource-group myresourcegroup --server mydemoserver --value "ADMIN,CONNECTION"
    
  3. Add any MariaDB users to be excluded from logging by updating the audit_log_exclude_users parameter. Specify users by providing their MariaDB user name.

    az mariadb server configuration set --name audit_log_exclude_users --resource-group myresourcegroup --server mydemoserver --value "azure_superuser"
    
  4. Add any specific MariaDB users to be included for logging by updating the audit_log_include_users parameter. Specify users by providing their MariaDB user name.

    az mariadb server configuration set --name audit_log_include_users --resource-group myresourcegroup --server mydemoserver --value "sampleuser"
    

Next steps

  • Learn more about audit logs in Azure Database for MariaDB
  • Learn how to configure audit logs in the Azure portal