Skip to main content

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

Low

Address

Operational Maturity, Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

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:
  1. Open the Azure Portal and navigate to the resource group that contains the security policy you want to monitor.
  2. Click on “Activity Log” in the left-hand menu.
  3. Click on “Alerts” in the Activity Log blade.
  4. Click on ”+ New alert rule” to create a new alert rule.
  5. In the “Create alert rule” blade, select the “Activity Log” option under “Resource” and select the appropriate subscription from the drop-down menu.
  6. Under “Condition”, select “Signal logic” and then select “Activity log”.
  7. In the “Activity log” blade, select “Event category” and then select “Administrative”.
  8. Under “Event types”, select “Write” and then select “Microsoft.Network/networkSecurityGroups/write”.
  9. Under “Filter”, select “Add filter” and then select “Resource ID”.
  10. Enter the resource ID of the security policy you want to monitor.
  11. Under “Actions”, select “Add action group” and then select “Create action group”.
  12. In the “Create action group” blade, enter a name for the action group and select the appropriate subscription, resource group, and region.
  13. Under “Actions”, select “Add action” and then select “Email/SMS/Push/Voice”.
  14. Enter the email address of the person or group who should receive alerts.
  15. Click on “Create” to create the alert rule.
By following the above steps, you will be able to create an activity log alert for the create or update security policy in Azure.

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 <alert-name>, <resource-group-name> and <action-group-id> with the appropriate values.Step 4: Verify the Activity Log Alert using the below command:
Note: Replace <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.
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:
  1. Install the Azure SDK for Python using the following command:
  1. Authenticate to Azure using the Azure SDK for Python. You can use the following code to authenticate using a Service Principal:
  1. 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:
  1. 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:
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.
This change does not force replacement of existing workloads; it only adds a new alert and action group. After terraform apply, terraform plan should show azurerm_monitor_activity_log_alert.security_policy_create_update (and azurerm_monitor_action_group.security_alerts if new) as + create with the criteria operation_name = "Microsoft.Security/policies/write".

Additional Reading: