Microsoft defender for cloud - environment settings - auto provisioning

Yuval Grinberg 96 Reputation points
2022-10-11T09:04:46.07+00:00

Hi all,
When trying to get list of all auto provisioning extensions using REST API (https://learn.microsoft.com/en-us/rest/api/defenderforcloud/auto-provisioning-settings/list?tabs=HTTP) I'm getting only the default one - Log Analytics agent/Azure Output:

"value": [
{
"id": "/subscriptions/blahblahblah/providers/Microsoft.Security/autoProvisioningSettings/default",
"name": "default",
"type": "Microsoft.Security/autoProvisioningSettings",
"properties": {
"autoProvision": "On"
}
}
]
}

Does anyone have an idea how to get the other auto provisioning extensions state?

  • Vulnerability assessment for machines
  • Microsoft Defender for Containers components.

249239-autoprovision.png

Microsoft Defender for Cloud
Microsoft Defender for Cloud
An Azure service that provides threat protection for workloads running in Azure, on-premises, and in other clouds. Previously known as Azure Security Center and Azure Defender.
1,501 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 26,936 Reputation points MVP
    2022-10-16T11:53:39.583+00:00

    Hi,
    This API only has a default one. Basically it is an old API that still exists and works for the Log Analytics agent only but mainly when you enable the options in the screenshot, they are now applied by creating Azure Policy assignments when you set them to On. The created Azure policy assignments take care of installing the needed resources.

    Added: I have now create a blog post on how to do this via Bicep.

    Added:
    As I wrote on my previous answer this is just regular policy assignments so it is policy assignments API.. The policies definitions that are used to assign the policies are:

    Guest Configuration Agent:

    Azure Monitor agent:

    Vulnerability Assessment:

    If you choose "Microsoft threat and vulnerability management" option you will also need to create resource of type Microsoft.Security/serverVulnerabilityAssessmentsSettings with name and kind AzureServersSetting at subscription scope and property selectedProvider set to MdeTvm.

    AKS:

    Below you can see the policy assignments created when you enable those. You can enable and disable to see those policies appear and disappear.

    250864-image.png

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.