ways to better connect 7 your security operations Table of contents

Introduction...... 1 7 scenarios that use the ...... 9 How to use this guide...... 2 Graph Security API

1. Streamline alert life-cycle management...... 9 Microsoft Graph...... 3 2. Automate creation of security incidents...... 9

Microsoft Graph Security API...... 4 3. Automate security response workflows...... 10

Authentication...... 5 4. Unlock additional security insights to inform threat response...... 11 Connect to the API...... 8 5. Use custom threat intelligence in Microsoft security solutions...... 13

6. Proactively manage security risks...... 14

7. Understand security threats targeting the organization and view trends...... 14 1

Introduction

To combat the increasing number of cyberthreats, most ƒƒMultiple schemas. Disparate schemas organizations rely on a diverse portfolio of security for alerts and other entities make solutions: endpoint protection, network firewalls, correlation of security data difficult. Core capabilities identity and access controls, cloud security, and so on. of the Microsoft Graph Security API This defense-in-depth strategy offers many security ƒƒInaccessible context. Critical information advantages, but gaps may still exist between solutions, about users or devices often lives outside ƒƒConnect your and these gaps can hinder the organization’s ability the organization’s security tools. security solutions. to effectively manage vulnerabilities and respond to threats. By sharing security insights and enabling The Microsoft Graph Security API greatly simplifies ƒƒBuild intelligent orchestration across security solutions, organizations integration with Microsoft and third-party security security apps. can gain an advantage over today’s adversaries. solutions. Using one endpoint, one software development ƒƒUnify security kit (SDK), one schema, and one authentication mechanism, management and Despite the benefits of connecting multiple security customers and partners can easily build integrated incident response. tools and workflows, integration challenges such security applications, workflows, and analytics. as the following can add cost and complexity: ƒƒAutomate security workflows. ƒƒ Multiple application programming interfaces ƒƒSimplify reporting (APIs). Different endpoints, authentication and analytics. models, and data sets make integration time- consuming to set up and difficult to maintain. Introduction 2

How to use this guide

This guide provides a comprehensive overview the insights from other security providers, of the Microsoft Graph Security API, including aggregating alerts into their own dashboards, common scenarios, and code samples for and enriching them with contextual information each. The primary audience for this guide is from related entities such as users and hosts. architects, developers, and scripters/tool smiths This guide helps you: from the following types of organizations: ƒƒIT services and system integrators (SIs). SIs help customers integrate their security ƒƒUnderstand Microsoft Graph and the Microsoft ƒƒIndependent software vendors (ISVs). ISVs can tools and workflows, implementing security Graph Security API. integrate their commercial security products and operations programs and processes. services with the Microsoft Graph Security API to ƒƒGet familiar with use gain visibility into security alerts, secure score, and ƒƒEnterprises. Enterprises build custom security apps, cases and scenarios that use the Microsoft contextual data from Microsoft Graph providers integrate security tools and workflows, and develop Graph Security API. and shared threat intelligence. Optionally, ISVs tools and analytics for hunting and detection. can also become providers to the Microsoft Graph ƒƒConnect with additional Security API as peers to Microsoft providers. Partners can integrate their applications with Microsoft documentation, Graph Security API to build connected security solutions. resources, and sample applications and code ƒƒManaged security service providers (MSSPs) or They can also surface their data through the Microsoft to get started quickly. managed service providers (MSPs). MSSPs and MSPs Graph Security API to become a security provider. develop applications to support security management Contact the Microsoft Graph Security team by email at and monitoring services. They can immediately benefit [email protected] if you’re interested from the Microsoft Graph Security API, integrating in onboarding as a Microsoft Graph Security provider. various security solutions, taking advantage of Microsoft Graph 3

Microsoft Graph

Microsoft Graph (graph.microsoft.com) is a collection of the information you need. For example, to get the APIs that together provide a standard unified interface list of important messages for a user, you send a GET and schema for accessing information from Microsoft request of https://graph.microsoft.com/v1.0/ Documentation online services (for example, Azure Active Directory me/messages?$filter=importance eq 'high'. [Azure AD], Office 365, OneDrive, OneNote, Microsoft These APIs are easy to implement; share a common For more information SharePoint, Microsoft Planner, Microsoft Intune, etc.) authentication framework based on OpenID Connect, about Microsoft and third-party vendors (in applicable APIs). This single OAuth 2.0, and a Web Representational State Transfer Graph, see Use the connection point (graph.microsoft.com) is the root for (REST) API with standard JavaScript Object Notation Microsoft Graph API. the other namespaces assigned to the services accessible (JSON) response formats; and support a variety of through the Microsoft Graph API. You can simply add platforms, with easy-to-use SDKs and code samples. additional namespaces and filtering elements to get Microsoft Graph Security API 4

Microsoft Graph Security API

Part of Microsoft Graph, the Microsoft Graph Security and identity, through Secure Score Control Profiles. API integrates with security solutions from Microsoft Scores and profiles are available from each security Frequently asked and partners in a federated model; it can also be used provider that offers them—valuable information that in conjunction with other Microsoft Graph entities to can help guide vulnerability remediation actions The Microsoft Graph gain additional context (for example, Office 365 and based on the suggested actions available in each Security API is not Azure AD). The API has multiple entities, including: profile. By default, 90 days of data is retained. about security for Microsoft Graph. This API provides security ƒƒAlerts from multiple security solutions, each Example Query data across different representing that potentially malicious activity security products running GET https://graph.microsoft.com/v1.0/ in your organization. has been detected within the organization. security/secureScores?$top=1

Example Query No extra cost ƒƒ GET https://graph.microsoft.com/v1.0/ Threat intelligence indicators refer to information security/alerts?$filter=severity eq 'high' about known threats, such as malicious IP addresses, An Azure subscription domains, or URLs. Organizations can send their threat is all you need to use intelligence to targeted Microsoft services to enable the Microsoft Graph ƒƒSecure Score provides information about an custom detections. An action can be specified for each Security API. There is no organization’s security posture, including a numeric indicator (either block, alert, or allow) signaling to the additional cost. Access rating based on elements like the enabled security target solution what action to take on that indicator. to data from third-party service providers may features in your environment and outstanding security require corresponding risks. This score is available at the tenant level as subscriptions with well as at a specific control area, such as device, app, those vendors. Microsoft Graph Security API 5

Example Query Example Query

POST https://graph.microsoft.com/ POST https://graph.microsoft.com/ beta/security/tiIndicators/ beta/security/securityActions Content-type: application/json Content-type: application/json Accessing the API { { "action": "alert", "name": "BlockIp", Access the Microsoft "confidence": 0, "actionReason": "Test", Graph Security API by "description": "MD5 hash on watch while "parameters": [ using the following URL: system vulnerabilities being addressed", { https://graph.microsoft. "expirationDateTime": "2019-03- "name": "IP", 01T21:43:37.5031462+00:00", com/VERSION/security/ "value": "1.2.3.4" ENTITY?$filter=FILTER "externalId": "Test-- } 8586509942679764298MS501", ], ƒƒVERSION is the API "fileHashType": "MD5", "vendorInformation": { version (e.g., v1.0, beta) "fileHashValue": "provider": "Windows Defender ATP", "fe8a8226a4cfd0deffe209069a7e64d908b74de8", ƒƒENTITY is the specific "severity": 0, "vendor": "Microsoft" entity (e.g., alerts) "targetProduct": "Azure Sentinel", } "threatType": "WatchList", } ƒƒFILTER limits the results (e.g., severity eq 'high') "tlpLevel": "green"}

The following is a Authentication complete example: ƒƒSecurity actions provide the ability to perform tasks pertaining to specific alerts, such as The API adopts a standard schema for authentication https://graph.microsoft. com/v1.0/security/ allowing or blocking an IP address and taking based on OpenID Connect, OAuth 2.0, and a Web REST alerts?$filter=severity actions through providers like Microsoft API with standard JSON response formats. Security eq 'high' Defender Advanced Threat Protection (ATP). data accessible through the Microsoft Graph Security API is protected using both permissions and Azure AD roles. Because Microsoft Graph is authenticated to Microsoft Graph Security API 6

your or your customer’s domain through Azure AD, for the application to access the data. Choose only people and applications with the appropriate this option for managed services scenarios or if Authentication permissions can gain access to the security data or take your enterprise has multiple registered tenants. actions on your or your customer’s security data by Authentication is required only once. This behavior using the Microsoft Graph Security API. The Microsoft To access security data by using the enables developers to Graph Security API can be accessed in two ways: Microsoft Graph Security API: build solutions that authenticate once and ƒƒBy an application in Application Only mode, where ƒƒThe application must be registered in Azure AD, make a single API call no user is signed in or the application manages which is the responsibility of the application to access or act on security insights from user access (for example, a security information developer or the Azure AD tenant administrator. multiple sources. and event management [SIEM] system)

ƒƒAt the time of registering the application, ƒƒIn the context of an authenticated specific permissions must be requested. Refer user in User-delegated mode (for to the list of Microsoft Graph permissions example, through Graph Explorer) for deciding appropriate permissions.

While registering your application, choose ƒƒNext, the Azure AD tenant administrator must one of the following for your application: consent to the permissions requested.

ƒƒSingle-tenant application. The application can ƒƒIf users are associated with the application, ISV recommendation access data in its Azure AD tenant only. Choose the Azure AD tenant administrator will need this option for customized solutions that are to add them to the appropriate Security If you are an ISV, scoped to run in your organizational tenant only. Reader role (User-delegated mode). recommend that your customers register the application in their own ƒƒMultitenant application. The same application For more detailed information about security tenant. Your customer can access data from multiple tenants, provided authorization, please see Authorization and can choose to run that the respective tenant administrator consents the Microsoft Graph Security API. in single-tenant or multitenant mode. Microsoft Graph Security API 7

Apps Scenarios Figure 1

Many types of applications Web apps Device Bots etwork Endpoint Threat Client native apps protection protection intelligence can integrate with the Microsoft Graph Security API, including

Background Analytics Automation SIEM log SOAR ITSM Information web applications, bots, processes dashboard tools workflows analytics protection analytics applications, and automation workflow Common libraries, authentication, and authorization engines. Each request from an application integrated with the Microsoft Graph Other Graph services Microsoft Alerts Secure Score Indicators Actions ure Office Security API gets federated Graph SharePoint Intune etc out to the different security products deployed in the organization. The Microsoft Graph Security API Federates queries, aggregates results, applies common schema Microsoft Graph Security API aggregates the results and returns them in a unified format. 365 ATP Azure ATP Azure Security Azure AD Microsoft Cloud Azure Information Microsoft Intune Azure Sentinel Security Defender ATP Center Identity Protection App Security Protection providers Microsoft Graph Security API 8

Connect to the API ƒƒPull data into Power BI reports. Power BI can connect natively to the Microsoft Graph Security API as a data source and pull in security-related information. For The Microsoft Graph Security API does not have a more information about how to connect to the API user interface, but you can access the API through within Power BI, visit the Tech Community; visit the Graph Explorer sample applications and Graph Explorer. In addition, Microsoft Graph Security API in Power BI Desktop for you can connect to the API in the following ways: prerequisites and required permission configuration. Graph Explorer does not support application-level ƒƒWrite code. Build a solution based on the authorization. User- ƒƒConnect using Jupyter Notebooks through Azure Microsoft Graph Security API by relying on the delegated permissions Notebooks. You can use Jupyter Notebooks to access SDKs Microsoft has made available to developers must be granted before Microsoft Graph Security API entities. For notebook on GitHub. These SDKs are available in ASP.NET, users can work with the samples of how you can do this, visit Microsoft Microsoft Graph Security , Java, JavaScript, Angular, PHP, and more. Graph Security API Jupyter Notebook Samples. API. If a user is calling the Samples and other resources can also be found API from Graph Explorer: in the Microsoft Graph Resources library. ƒƒIntegrate with security solutions. Use connectors for ƒƒThe Azure AD tenant SIEM, SOAR, and other security solutions like Splunk administrator must ƒƒConnect using scripts. You can find PowerShell and IBM QRadar to consume alerts through the explicitly grant consent cmdlets on GitHub for use in connecting to the Microsoft Graph Security API. For more information for the requested Microsoft Graph Security API. Examples of how to use permissions to the about using these connectors, see Integrate by those cmdlets can be found in the Tech Community. Graph Explorer using Microsoft Graph Security API connectors. application. ƒƒUse code-free automation tools. Use Microsoft ƒƒUse Microsoft Graph Security–integrated ƒƒThe user must be a Graph Security API connectors for Azure Logic applications. Use solutions that already member of the Security Apps, Microsoft Flow, and PowerApps to build Reader Limited Admin integrate with the Microsoft Graph Security API. code-free workflows that use data from the role in Azure AD (either If you aren’t sure which solutions are currently Microsoft Graph Security API. Examples of Security Reader or integrated with the API, see the Microsoft these workflow in action can be found in the Security Administrator). Graph Security API partnerships page. Tech Community. For more information, see https://aka.ms/graphsecurityconnectors. 7 scenarios that use the Microsoft Graph Security API 9

7 scenarios that use the Microsoft Graph Security API

Countless use cases exist for taking advantage of the data available through the Microsoft Graph Security API. To better illustrate them, some example scenarios are detailed below. Connection options

This guide references the 1. Streamline alert life-cycle management REST queries you can use to perform the tasks within An analyst signs in to a security application integrated such as Azure Security Center, ATP, the example use cases. with the Microsoft Graph Security API and can now view or Palo Alto Networks, grouped by provider. Details However, some code samples and PowerShell high-severity security alerts across security providers, on each alert are available in a consistent format. cmdlets have the REST URL components already Example query—Get high-severity alerts across all providers integrated, providing a detailed use example. GET https://graph.microsoft.com/v1.0/security/alerts?$filter=severity eq 'high' For more information, see the Microsoft Graph Security API 2. Automate creation of security incidents applications and services repository on GitHub.

An analyst receives a list of recent alerts from their security Graph Security API and assigns them for investigation providers through an app integrated with the Microsoft by updating an alert. The incident management system 7 scenarios that use the Microsoft Graph Security API 10

associated with these alerts is also integrated with the in the security provider’s solution are automatically API, so security incidents corresponding to these alerts reflected in the ticketing system: The analyst doesn’t are already in the system. Because both systems are have to sign in and update the tickets with alert integrated with the API, the assignments that were made assignments to keep it in sync with the security provider.

Example query—Update the assigned analyst to an alert

PATCH https://graph.microsoft.com/v1.0/security/alerts/{alert_id} Content-type: application/json { Code-free options "assignedTo": "LoriPenor", "vendorInformation": { You can simplify security automation and reporting "provider": "String", with connectors for Azure "vendor": "String" Logic Apps, Microsoft } Flow, PowerApps, } and Power BI, quickly building playbooks to orchestrate security tasks across solutions—no 3. Automate security response workflows code required. For more information, visit the An alert about a malicious IP address triggers an same IP address. The runbook sends an automated Microsoft Tech Community. automated workflow or runbook in the organization’s email with options and the alert details to the analyst. security automation platform. The workflow, which The analyst can then review the alerts associated calls the Microsoft Graph Security API by using one with the IP address and decide whether to block it. of the many available connectors, correlates the IP Selecting Yes invokes the Microsoft Graph Security address in the alert with other alerts that share the action in the runbook to block the specific IP address. 7 scenarios that use the Microsoft Graph Security API 11

Example query—Get alerts related to anonymous IP addresses

GET /security/alerts?$filter=title eq 'Sign-ins from anonymous IP addresses' Example query—Security action to block a specific IP address: POST /beta/security/securityActions Content-type: application/json { "name": "BlockIp", "actionReason": "Test", "parameters": [ { "name": "IP", "value": "1.2.3.4" } ], "vendorInformation": { "provider": "Windows Defender ATP", "vendor": "Microsoft" } }

4. Unlock additional security insights to inform threat response

An analyst receives an alert from a security provider been compromised by malware running on their device. about a user. They query all security providers through To assess the potential scope, the analyst queries for a list the Microsoft Graph Security API for a complete view of of devices registered to the user and a list of the security all alerts related to this user. Based on the alerts returned, groups of which the user is a member. The analyst can the analyst concludes that the user’s credentials have temporarily block access until the user’s device can be 7 scenarios that use the Microsoft Graph Security API 12

scrubbed and the password reset. The analyst can also query for any alerts related to the same malware to look for other potentially compromised devices and users.

Example query—Get alerts related to a specific user

GET /security/alerts?$filter=userStates/any(a:a/userPrincipalName eq 'enter the user principal name')

Example query—Get the affected user’s registered devices

GET users/[email protected]/registeredDevices?$select=displayName

Example query—Get the risk score for the machine being reviewed

GET /security/hostStates/?$filter=NetBiosName eq 'USWL63813'&$select=riskScore

Example query—Get a list of security groups

GET /users/{id | userPrincipalName}/memberOf

Example query—Get alerts related to trojan malware

GET /security/alerts?$filter=malwareStates/any(a:a/category eq 'trojan') 7 scenarios that use the Microsoft Graph Security API 13

5. Use custom threat intelligence in Microsoft security solutions

The IT director reads about a new type of malware to the IT department can address the vulnerability. The threat which the company could be vulnerable. The team is indicator is sent to integrated Microsoft solutions using actively patching the vulnerabilities that this malware the Microsoft Graph Security API. The Microsoft solution exploits, but the director wants to add the malware’s file can then alert the organization if the file is detected. hash as an indicator, just in case it finds its way in before

Example query—Post threat indicators

POST beta/security/tiIndicators/ Content-type: application/json Documentation { "action": "alert", To learn more about "confidence": 0, the entities available "description": "MD5 hash on watch while system vulnerabilities being addressed", through the API, see "expirationDateTime": "2019-03-01T21:43:37.5031462+00:00", Use the Microsoft "externalId": "CUSTOM-MD5-Indicator", Graph Security API. "fileHashType": "MD5", "fileHashValue": "fe8a8226a4cfd0deffe209069a7e64d908b74de8", "severity": 0, "targetProduct": "Azure Sentinel", "threatType": "WatchList", "tlpLevel": "green"} 7 scenarios that use the Microsoft Graph Security API 14

6. Proactively manage security risks

An IT organization has an initiative to improve its By querying the Microsoft Graph Security API secure score security posture. The IT director wants to know entity, the IT director can quickly retrieve the most recent the Microsoft Secure Score of the environment so summarized Microsoft Secure Score by provider, and then that they can make a plan to improve those scores query the individual secure score control profiles that have (and therefore the company’s security posture) in a high impact to start planning changes to improve the the coming quarter. In addition to the summary overall score. Likewise, the IT directory may want to view by provider, the director wants a breakdown from the individual control profile for high-value devices, like a each individual area that has a high impact. device that belongs to the chief information officer (CIO).

Example query—Get all current secure scores

GET /security/secureScores?$top=1

Example query—Get all secure score control profiles that have a high user impact

GET /security/secureScoreControlProfiles?$filter=userImpact eq 'High'

7. Understand security threats targeting the organization and view trends

A CIO needs information about security-related events in The IT director opens Power BI and connects to the the organization to share with the leadership team in their Microsoft Graph Security API by using the connector to weekly meeting. The CIO asks the IT director to provide start creating reports (Figure 2 on page 15). The first this information in the form of easily consumable graphs graph, Alerts by Security Products, shows the alerts that that can be placed in a Microsoft PowerPoint slide deck. each security product received this week. The second graph, Alerts by Users, shows the users most affected 7 scenarios that use the Microsoft Graph Security API 15

this week and the number of alerts related to each. Finally, Alerts by Category shows the number alerts received for each alert category. The director sees that Unfamiliar Location was the most common category. It takes only a few minutes to retrieve, manipulate, and present this data in Power BI. The IT director then provides these graphs to the CIO for their weekly meeting.

Figure 2

Create reports in Power BI by connecting it to the Microsoft Graph Security API. © 2019 Microsoft Corporation. All rights reserved. This document is for informational purposes only. Microsoft makes no warranties, express or implied, with respect to the information presented here.