More Info:
Monitoring for ‘Create’ or ‘Update Security Policy’ events gives insight into changes to security policy and may reduce the time it takes to detect suspicious activity.Risk Level
LowAddress
Security, Operational MaturityCompliance Standards
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Security Policy” in Azure using the Azure console, follow the below steps:
- Open the Azure Portal and navigate to the resource group that contains the security policy you want to monitor.
- Click on “Activity Log” in the left-hand menu.
- Click on “Alerts” in the Activity Log blade.
- Click on ”+ New alert rule” to create a new alert rule.
- In the “Create alert rule” blade, select the “Activity Log” option under “Resource” and select the appropriate subscription from the drop-down menu.
- Under “Condition”, select “Signal logic” and then select “Activity log”.
- In the “Activity log” blade, select “Event category” and then select “Administrative”.
- Under “Event types”, select “Write” and then select “Microsoft.Network/networkSecurityGroups/write”.
- Under “Filter”, select “Add filter” and then select “Resource ID”.
- Enter the resource ID of the security policy you want to monitor.
- Under “Actions”, select “Add action group” and then select “Create action group”.
- In the “Create action group” blade, enter a name for the action group and select the appropriate subscription, resource group, and region.
- Under “Actions”, select “Add action” and then select “Email/SMS/Push/Voice”.
- Enter the email address of the person or group who should receive alerts.
- Click on “Create” to create the alert rule.
Using CLI
Using CLI
To remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Security Policy” in Azure using Azure CLI, follow the below steps:Step 1: Open Azure CLI and login to your Azure account using the below command:Step 2: Once you are logged in, set the default subscription where your resources are deployed using the below command:Step 3: Create an Activity Log Alert using the below command:Note: Replace Note: Replace
<alert-name>, <resource-group-name> and <action-group-id> with the appropriate values.Step 4: Verify the Activity Log Alert using the below command:<alert-name> and <resource-group-name> with the appropriate values.Step 5: If the output of the above command shows the details of the Activity Log Alert, then the remediation is successful.By following the above steps, you can remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Security Policy” in Azure using Azure CLI.Using Python
Using Python
To remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Security Policy” in Azure using Python, you can follow the below steps:By following the above steps, you can remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Security Policy” in Azure using Python.
- Install the Azure SDK for Python using the following command:
- Authenticate to Azure using the Azure SDK for Python. You can use the following code to authenticate using a Service Principal:
- Use the Azure SDK for Python to check if an Activity Log Alert exists for Create or Update Security Policy. You can use the following code to check if the alert exists:
- If the alert does not exist, use the Azure SDK for Python to create the Activity Log Alert. You can use the following code to create the alert:

