Triage and Remediation
Remediation
Using Console
Using Console
To remediate the AuditEvent logging misconfiguration in AZURE using the AZURE console, you can follow the below steps:
- Login to the AZURE portal (https://portal.azure.com/).
- Navigate to the resource group where the affected resource is located.
- Click on the affected resource to open its properties page.
- In the left-hand menu, click on the “Monitoring” option.
- Under the Monitoring section, click on “Diagnostic settings”.
- Click on “Add diagnostic setting” to create a new diagnostic setting.
- In the “Add diagnostic setting” page, provide a name for the diagnostic setting.
- Under the “Logs” section, enable the “AuditEvent” log by selecting it from the list of available logs.
- Choose the destination where you want to send the logs (such as a storage account or event hub).
- Click on “Save” to save the new diagnostic setting.
Using CLI
Using CLI
To remediate the misconfiguration of AuditEvent logging not being enabled in Azure using Azure CLI, follow these steps:
- Open the Azure CLI on your local machine or the Azure Cloud Shell.
-
Run the following command to enable AuditEvent logging:
Replace the placeholders
<DIAGNOSTIC-SETTING-NAME>
,<RESOURCE-ID>
, and<RESOURCE-TYPE>
with the appropriate values. For example, if you want to enable AuditEvent logging for a virtual machine, the command would be: - Once the command is executed successfully, the AuditEvent logging will be enabled for the specified resource.
-
To verify that AuditEvent logging is enabled, run the following command:
This command will display the current diagnostic settings for the specified resource, including whether AuditEvent logging is enabled or not.
Using Python
Using Python
To remediate the AuditEvent logging misconfiguration in Azure using Python, follow these steps:Replace Replace Replace Replace
- Import the necessary modules:
- Set the credentials for the Azure account:
<client-id>
, <client-secret>
, and <tenant-id>
with the corresponding values for your Azure account.- Instantiate the
MonitorManagementClient
:
<subscription-id>
with the ID of the subscription you want to remediate.- Enable AuditEvent logging:
<resource-group-name>
with the name of the resource group containing the alert, <alert-name>
with the name of the alert, <location>
with the location of the alert, <tag-key>
and <tag-value>
with the key and value of any tags you want to add to the alert, and <action-group-id>
with the ID of the action group you want to associate with the alert.- Verify that AuditEvent logging is enabled:
<resource-group-name>
and <alert-name>
with the corresponding values for your alert.If the output is True
, then AuditEvent logging is enabled.