Issues setting up Governance Rules in Defender for Cloud

Glenn Boyce 0 Reputation points
2024-08-16T05:02:15.19+00:00

Good Afternoon All,

We have recently implemented Defender for Cloud and we are looking to set up Governance Rules to send remediation tasks to Subscription owners.

To be honest we haven't got far..................When we try and create a rule we don't get by the "General Details" tab. The scope fails to load, it sits there with a spinning wheel but never actually displays anything.

Has anyone come across this issue? We have about 800 GCP projects in our GCP environment, I'm wondering if it is timing out trying to load them all into the scope list.

chrome_gJFGwCYGCM

Microsoft Security | Microsoft Defender | Microsoft Defender for Cloud
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2024-08-19T15:16:23.8733333+00:00

    Hi @Glenn Boyce , yes this is most likely being caused by the number of projects you have. A way to work around this issue is to use Azure Resource Graph to query for the GCP projects and then use the results of the query to create a custom scope for the Governance Rule. This will allow you to select a smaller subset of projects to include in the scope and avoid the timeout issue.

    Try using the following query in Azure Resource Graph:

    resources
    | where type == "microsoft.resources/subscriptions/providers/Microsoft.Compute/virtualMachines"
    | extend projectId = tostring(split(split(id, "/")[4], "-")[0])
    | summarize by projectId
    

    This will return a list of GCP project IDs that have virtual machines deployed in them. You can modify the query to include other resource types as needed.

    Once you have the list of project IDs, you can create a custom scope for the Governance Rule that includes only the projects in the list. This should hopefully allow you to avoid the timeout issue.

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James

    1 person found this answer helpful.
    0 comments No comments

  2. Glenn Boyce Admin Account 0 Reputation points
    2024-08-27T00:53:59.2466667+00:00

    Thanks James much appreciated!!!

    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.