More Info:
Enable Network Security Group recommendations for virtual machines.Risk Level
LowAddress
Security, Operational MaturityCompliance Standards
SOC2, HIPAATriage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration “Monitor Network Security Group setting is not enabled” in AZURE using AZURE console, follow the below steps:
- Log in to the AZURE portal (https://portal.azure.com/).
- Navigate to the “Security Center” tab from the left-hand side menu.
- Click on the “Policy” option under the “Security Center” tab.
- Under the Policy tab, click on “Security Policy” and then click on the “Edit” button.
- Scroll down to the “Network Security Groups should be configured to log to storage account” policy and click on it.
- Click on the “Remediation” button and then click on the “Enable” option.
- Click on the “Save” button to save the changes.
Using CLI
Using CLI
To remediate the misconfiguration “Monitor Network Security Group setting is not enabled” for Azure using Azure CLI, follow the below steps:Step 1: Open Azure CLI and login to your Azure account using the command:Step 2: Once you are logged in, set the subscription where your Network Security Group is located using the command:Step 3: Now, enable the Network Security Group flow logs using the below command:Here, replace the This will display the details of the flow log configuration for the specified Network Security Group.By following the above steps, you can remediate the misconfiguration “Monitor Network Security Group setting is not enabled” for Azure using Azure CLI.
<nsg_name> with the name of the Network Security Group that you want to enable flow logs for, <storage_account_id> with the ID of the storage account to which the flow logs should be stored, and <resource_group_name> with the name of the resource group where the Network Security Group is located.Step 4: Once the above command is executed successfully, you can verify the configuration by running the below command:Using Python
Using Python
To remediate the “Monitor Network Security Group setting is not enabled” misconfiguration in Azure using Python, you can use the Azure SDK for Python. Here are the steps to enable the setting:Note: Replace Note: Replace This should output
- Import the necessary libraries:
- Authenticate using the Azure CLI:
- Instantiate the NetworkManagementClient:
subscription_id with your Azure subscription ID.- Get the network security group (NSG) that needs to be remediated:
resource_group_name with the name of the resource group where your NSG is located.- Enable the “Monitor Network Security Group setting” by updating the NSG:
- Verify that the setting has been enabled by checking the NSG’s properties:
True, indicating that the “Monitor Network Security Group setting” has been enabled.Note: Make sure that you have the necessary permissions to perform these actions.
