Security Center monitoring agent should be automatically provisioned

Description

When Automatic provisioning of monitoring agent is turned on, Azure Security Center provisions the Microsoft Monitoring Agent on all existing supported Azure virtual machines and any new ones that are created. The Microsoft Monitoring Agent scans for various security-related configurations and events such as system updates, OS vulnerabilities, endpoint protection, and provides alerts.

Remediation Steps

Azure Portal

  • Navigate to Security Center.

  • In the left navigation, select Pricing & settings.

  • Select the relevant subscription and in the left navigation, select Auto provisioning.

  • In the Auto provisioning section:

    • For the Log Analytics agent for Azure VMs, set the status to On.

    • In the Extension deployment configuration blade, select the appropriate workspace.

    • If you are using Windows, select the appropriate additional data to store as necessary.

    • Click Apply.

  • Click Save.

Azure CLI

  • To enable automatic monitoring agent provisioning:

az account get-access-token --query "{subscription:subscription,accessToken:accessToken}" --out tsv | xargs -L1 bash -c 'curl -X PUT -H "Authorization: Bearer $1" -H "Content-Type: application/json" https://management.azure.com/subscriptions/$0/providers/Microsoft.Security/autoProvisioningSettings/default?api-version=2017-08-01-preview -d@"input.json"'
  • In the input.json, enter your subscription ID and valid email addresses.

{ "id": "/subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/autoProvisioningSettings/default", "name": "default", "type": "Microsoft.Security/autoProvisioningSettings", "properties": {"autoProvision": "On" } }