Book Image

Microsoft Defender for Cloud Cookbook

By : Sasha Kranjac
Book Image

Microsoft Defender for Cloud Cookbook

By: Sasha Kranjac

Overview of this book

Microsoft Defender for Cloud is a multi-cloud and hybrid cloud security posture management solution that enables security administrators to build cyber defense for their Azure and non-Azure resources by providing both recommendations and security protection capabilities. This book will start with a foundational overview of Microsoft Defender for Cloud and its core capabilities. Then, the reader is taken on a journey from enabling the service, selecting the correct tier, and configuring the data collection, to working on remediation. Next, we will continue with hands-on guidance on how to implement several security features of Microsoft Defender for Cloud, finishing with monitoring and maintenance-related topics, gaining visibility in advanced threat protection in distributed infrastructure and preventing security failures through automation. By the end of this book, you will know how to get a view of your security posture and where to optimize security protection in your environment as well as the ins and outs of Microsoft Defender for Cloud.
Table of Contents (12 chapters)

Getting a secure score using Azure Resource Graph

Azure Resource Graph is a service in Azure that is capable of querying resources at scale across subscriptions and exploring Azure resources, including the ability to apply complex filtering, grouping, and sorting by resource properties.

In this recipe, you will learn how to use Azure Resource Graph to query resources for the Azure secure score feature.

Getting ready

Open a web browser and navigate to https://portal.azure.com.

How to do it...

To filter, group, and sort security recommendations in Microsoft Defender for Cloud, take the following steps:

  1. In the Azure portal, open Resource Graph Explorer.
  2. On the left menu, under the Scope menu, choose a scope for the queries: Tenant, Management Group, or Subscription.
  3. In the right pane, under the Query 1 tab, type the following Kusto query:
    SecurityResources 
    | where type == 'microsoft.security/securescores' 
    | extend current = properties.score...