Skip to main content

Microsoft Azure Security Center recommendations are

More Info:

Ensure that Microsoft Azure Security Center recommendations are examined and resolved.

Risk Level

High

Address

Operational Maturity, Security

Compliance Standards

  • Cloudanix Best Practice
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework

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.

Using CLI

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 CLI

If 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 account

Login to your Azure account using the below command in Azure CLI:

az login

Step 3: Enable Azure Security Center

If you haven't already enabled Azure Security Center, you can follow the below command to enable it:

az security pricing create --name default --tier standard

Step 4: Check Azure Security Center recommendations

To check the Azure Security Center recommendations, you can use the below command:

az security recommendation list --resource-group <resource-group-name> --security-solution-name "Azure Security Center"

Note: Replace <resource-group-name> with the name of your resource group.

Step 5: Remediate the recommendations

To remediate the recommendations, you can use the below command:

az security recommendation update --ids <recommendation-id> --status "remediated"

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.

Using Python

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:
pip install azure-mgmt-resource
pip install azure-mgmt-security
  1. Authenticate with Azure using the Azure CLI:
az login
  1. Import the required modules and authenticate with Azure using the Azure SDK for Python:
from azure.identity import AzureCliCredential
from azure.mgmt.security import SecurityCenter

credential = AzureCliCredential()
security_center_client = SecurityCenter(
credential=credential,
subscription_id='<subscription_id>'
)
  1. Get the list of recommendations from Azure Security Center:
recommendations = security_center_client.recommendations.list()
  1. Iterate through the recommendations and remediate them:
for recommendation in recommendations:
if recommendation.status == 'Active':
remediation = security_center_client.remediations.begin_create(
recommendation_id=recommendation.id,
properties={}
)
print(f'Remediation created: {remediation.id}')

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.

Using Terraform

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.