Defender for Cloud: Removed default initiative assignment - how to recreate initial assignment?

Wedding, Jan 20 Reputation points
2023-10-23T12:25:36.1533333+00:00

Hi,

We were experimenting with Azure Security Center and during that, we deleted the default initiative assignment, so in Azure portal, it looks like this:

No Policy assignment.

When re-assigning / re-creating a new policy, it is kind of possible to get something assigned again, but unfortunately, it will not create the new assignment in the very same kind of format as the initial assignment. The initial assignment has an assignment ID in the format like this:

/subscriptions/00000000-aaaa-bbbb-cccc-dddddddddddd/providers/microsoft.authorization/policyassignments/securitycenterbuiltin

=> Name property = securitycenterbuiltin (hardcoded)

while a freshly, manually created one will receive an assignment ID like this:

/subscriptions/00000000-aaaa-bbbb-cccc-dddddddddddd/providers/microsoft.authorization/policyassignments/99999310d9840fab23e8888

=> Name property = 99999310d9840fab23e8888 (generated)

Question: How can I get it re-created in a way so that it is the very same as in the original assignment?

Background: We are using IaC approaches and want to avoid manually maintaining this ID/name property per subscription for getting this imported...

Microsoft Security | Microsoft Defender | Microsoft Defender for Cloud
{count} votes

1 answer

Sort by: Most helpful
  1. Wedding, Jan 20 Reputation points
    2023-11-10T12:23:38.5666667+00:00

    Hi,

    so, the initial creation of this default assignment with the name (not display name!) securitycenterbuiltin "seems" to be happening on Tenant level, so out of the control of our single Subscription. Probably managed / configured somewhere - as said, out of our control. And since this String is found in many places in the internet, I doubt it is something, our internal teams is doing...

    Anyway, you can still delete it directly from within the portal for a certain subscription. And after that, it does not get recreated anymore automatically... So we were using the "Assign Policy" button within the portal (see my screenshot from the initial post) allows to pass in the display name attribute only, but not the name attribute...

    As said, it would be really helpful to get this consistently created as we are normally not using the Azure portal for creating resouces, but IaC approaches like Terraform.

    0 comments No comments

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.