Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate this misconfiguration in Azure using Azure console, follow the steps below:
  1. Log in to the Azure portal (https://portal.azure.com/).
  2. Navigate to the Security Center from the left-hand menu.
  3. Click on the Recommendations tab to view all the recommendations.
  4. Select the recommendation that you want to remediate.
  5. Click on the Remediate button to start the remediation process.
  6. Follow the on-screen instructions to complete the remediation process.
Alternatively, you can also perform the remediation process using PowerShell. Here are the steps:
  1. Open PowerShell on your local machine.
  2. Connect to your Azure account using the following command: Connect-AzAccount
  3. Run the following command to get the list of recommendations: Get-AzSecurityRecommendation
  4. Select the recommendation that you want to remediate.
  5. Run the following command to remediate the recommendation: Invoke-AzSecurityRecommendationRemediation -ResourceId <resource-id> -RecommendationId <recommendation-id>
Note: Replace <resource-id> and <recommendation-id> with the actual values for the resource and recommendation that you want to remediate.

To remediate the misconfiguration of ensuring that Microsoft Azure Security Center recommendations are examined and resolved using Azure CLI, you can follow the below steps:Step 1: Install Azure CLIIf you haven’t already installed Azure CLI, you can follow the instructions provided in the Microsoft documentation to install Azure CLI for your operating system.Step 2: Login to your Azure accountLogin to your Azure account using the below command in Azure CLI:
Step 3: Enable Azure Security CenterIf you haven’t already enabled Azure Security Center, you can follow the below command to enable it:
Step 4: Check Azure Security Center recommendationsTo check the Azure Security Center recommendations, you can use the below command:
Note: Replace <resource-group-name> with the name of your resource group.Step 5: Remediate the recommendationsTo remediate the recommendations, you can use the below command:
Note: Replace <recommendation-id> with the ID of the recommendation that you want to remediate.By following these steps, you can remediate the misconfiguration of ensuring that Microsoft Azure Security Center recommendations are examined and resolved using Azure CLI.
To remediate this issue using Python, you can use the Azure SDK for Python. Here are the steps to remediate the misconfiguration:
  1. Install the Azure SDK for Python using pip:
  1. Authenticate with Azure using the Azure CLI:
  1. Import the required modules and authenticate with Azure using the Azure SDK for Python:
  1. Get the list of recommendations from Azure Security Center:
  1. Iterate through the recommendations and remediate them:
This code will create remediation tasks for all active recommendations in Azure Security Center. Once the remediation tasks are completed, the misconfigurations will be remediated.
This finding cannot be remediated via Terraform.“Ensure that Microsoft Azure Security Center recommendations are examined and resolved” is an operational/process control: you must regularly review and act on recommendations generated by Microsoft Defender for Cloud (formerly Security Center), which are computed from runtime state, not a subscription setting Terraform can change.Use the Azure Portal instead:
  1. Go to “Microsoft Defender for Cloud”.
  2. Review “Recommendations” for the target subscription.
  3. For each recommendation, either:
    • Implement the suggested fix (which may itself be configurable via Terraform on the relevant resources), or
    • Mark it as “Resolved” / “Dismiss” (with justification) where appropriate.
No Terraform resource or argument exists to “mark recommendations as examined or resolved,” so terraform plan will show no changes for this control.