More Info:
Monitoring for ‘Create’ or ‘Update Network Security Group’ events gives insight into network access changes and may reduce the time it takes to detect suspicious activity.Risk Level
LowAddress
Security, Operational MaturityCompliance Standards
CISAZURE, CBP, SOC2, ISO27001, HIPAA, HITRUST, NISTCSFTriage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Network Security Group” for AZURE using AZURE console, please follow the below steps:
- Log in to the Azure portal (https://portal.azure.com/).
- Click on the “Activity log” option in the left-hand side menu.
- Click on the “Alerts” option in the left-hand side menu.
- Click on the “New alert rule” button.
- In the “Create alert rule” page, under the “Scope” section, select the subscription, resource group, or resource for which you want to create an alert.
- Under the “Condition” section, click on the “Add condition” button.
- In the “Add condition” page, select “Activity log” as the signal type.
- Under the “Filter” section, select “Resource provider” as the field and “Microsoft.Network” as the value.
- Under the “Operation” section, select “Create or Update Network Security Group” as the value.
- Under the “Threshold” section, set the frequency and threshold values according to your requirements.
- Under the “Actions” section, select the action you want to perform when the alert is triggered. You can send an email, a text message, or a webhook notification.
- Click on the “Create alert rule” button to create the alert.
Using CLI
Using CLI
To remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Network Security Group” in Azure using Azure CLI, you can follow these step-by-step instructions:
- Open the Azure CLI on your local machine or in the Azure portal.
-
Run the following command to create an activity log alert for network security group creation or update:
Replace
<alert_name>with a name for your alert and<alert_description>with a description of the alert. Replace<action_group_name>with the name of an existing action group that will receive notifications when the alert is triggered. -
Verify that the alert was created successfully by running the following command:
This command should display the details of the alert you just created.
- Repeat these steps for each network security group in your Azure environment to ensure that an activity log alert exists for all network security group creation or updates.
Using Python
Using Python
To remediate the misconfiguration “Ensure Activity Log Alert exists for Create or Update Network Security Group” in Azure using Python, you can use the Azure SDK for Python. Here are the steps to remediate the misconfiguration:Step 1: Install the Azure SDK for Python by running the following command in your terminal:Step 2: Authenticate to Azure by creating a Service Principal and obtaining the credentials. You can follow the steps mentioned in the Azure documentation to create a Service Principal.Step 3: Use the following Python code to create an Activity Log Alert for Create or Update Network Security Group:In the above code, replace the values for
subscription_id, resource_group_name, network_security_group_name, alert_rule_name, action_group_name, webhook_receiver_url, and email_receiver_address with your own values.This code creates an Activity Log Alert for the Create or Update operation on the specified Network Security Group. The Alert Rule sends notifications to the specified email address and webhook receiver URL, and also adds the specified Action Group to the Alert Rule.
