Microsoft Graph
LAST UPDATED: 05/30/2024
Overview
Microsoft Graph is a RESTful web API that enables you to access Microsoft Cloud service resources.
D3 SOAR is providing REST operations to function with Microsoft Graph.
Microsoft Graph is available for use in:
Known Limitations
Command | Limitation |
Get User and Manager Info | This request might have replication delays for users that were recently created, updated, or deleted. |
Send Email | This request might have replication delays for users that were recently created, updated, or deleted. |
Connection
To connect to Microsoft Graph from D3 SOAR, please follow this part to collect the required information below:
Parameter | Description | Example |
Application ID | The application ID (client ID) to authenticate the API connection. | 9dK-***e31-***-f8a |
Auth URL | The auth URL to authenticate the API connection. This is a fixed default value. No input action is required. | |
Graph URL | The Microsoft Graph URL. This is a fixed default value. No input action is required. | |
Secret | The client secret to authenticate the API connection. | 8lE***~uc-6B~***-vbh |
Tenant ID | The tenant ID to authenticate the API connection. | f6Y***-***-***-***eJd |
Permission Requirements
Each endpoint in the Microsoft Graph API requires a certain permission scope. The following are required scopes for the commands in this integration:
Command | Required Permission |
Get ATP Security Alerts | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
Get User and Manager Info | User.Read.All, User.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All |
Send Email | User.Read.All, User.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All, Mail.Send |
Test Connection | N/A |
Configuring Microsoft Graph to Work with D3 SOAR
Log in to the Azure Portal (https://portal.azure.com/).
Navigate to the top search bar, then search and select App registrations.
If you already have created apps, you can use one of them. Skip to step 5 to obtain the Client ID & Tenant ID. If you do not have an app, click + New registration to create one.
Register the application.
Enter an application Name.
For Supported account types, select Accounts in this organizational directory only (<Your Directory Name> only - Single tenant).
Click Register.
In the App Overview tab, copy and save the Application(client) ID and Directory(tenant) ID. They will be required to build the integration connection in D3 SOAR. Navigate to Client credentials, then click Add a certificate or secret.
Click + New Client Secret. Enter a Description for the client secret, and select a client secret expiry period using the Expires dropdown menu. Click Add. Note: The client ID will not be able to access the API resources after the client secret expires. You must renew the client secret to keep the client ID active.
Copy and save the Secret Value. It will be required to build the integration connection in D3 SOAR connection. Note: The created Client Secret can only be viewed once. Store it in a secure location before leaving the page.
Configure the API permissions. Click API permissions on the left navigation menu, then + Add a permission. Select Microsoft Graph, then search and select the required Application permissions. After selecting the required permissions, click Add permissions. See Permission Requirements for the required permissions for each command in this integration.
Some permissions may need to be granted admin consent for your directory (d3uat in the sample screenshot) to use. Ensure Grant admin consent for <Your Directory> is checked.
You may see Not granted for <Your Directory> in the status column. Those are the ungranted permissions you want to use. After successfully granting permissions, a green checkmark will appear under the permission status column for the corresponding permissions. If your login account does not have admin privileges, ask your admin to grant consent.
Configuring D3 SOAR to Work with Microsoft Graph
Log in to D3 SOAR.
Find the Microsoft Graph integration.
Navigate to Configuration on the top header menu.
Click on the Integration icon on the left sidebar.
Type Microsoft Graph in the search box to find the integration, then click it to select it.
Click + Connection, on the right side of the Connections section. A new connection window will appear.
Configure the following fields to create a connection to Microsoft Graph.
Connection Name: The desired name for the connection.
Site: Specifies the site to use the integration connection. Use the drop-down menu to select the site. The Share to Internal Sites option enables all sites defined as internal sites to use the connection. Selecting a specific site will only enable that site to use the connection.
Recipient site for events from connections Shared to Internal Sites: This field appears if you selected Share to Internal Sites for Site to let you select the internal site to deploy the integration connection.
Agent Name (Optional): Specifies the proxy agent required to build the connection. Use the dropdown menu to select the proxy agent from a list of previously configured proxy agents.
Description (Optional): Add your desired description for the connection.
Configure User Permissions: Defines which users have access to the connection.
Active: Check the tick box to ensure the connection is available for use.
System: This section contains the parameters defined specifically for the integration. These parameters must be configured to create the integration connection.
1. Input your saved Application ID. See step 5 of Configuring Microsoft Graph to Work with D3 SOAR.
2. Input your saved Secret. See step 6 of Configuring Microsoft Graph to Work with D3 SOAR.
3. Input your saved Tenant ID. See step 5 of Configuring Microsoft Graph to Work with D3 SOAR.Connection Health Check: Updates the connection status you have created. A connection health check is done by scheduling the Test Connection command of this integration. This can only be done when the connection is active.
To set up a connection health check, check the Connection Health Check tickbox. You can customize the interval (minutes) for scheduling the health check. An email notification can be set up after a specified number of failed connection attempts.Enable Password Vault: An optional feature that allows users to take the stored credentials from their own password vault. Please refer to the password vault connection guide if needed.
Test the connection.
Click Test Connection to verify the account credentials and network connection. If the Test Connection Passed alert window appears, the test connection is successful. You will see Passed with a green checkmark appear beside the Test Connection button. If the test connection fails, please check your connection parameters and try again.
Click OK to close the alert window.
Click + Add to create and add the configured connection.
Commands
Microsoft Graph includes the following executable commands for users to set up schedules or create playbook workflows. With the Test Command, you can execute these commands independently for playbook troubleshooting.
Integration API Note
For more information about the Microsoft Graph API, please refer to the Microsoft Graph API reference.
Reader Note
Certain permissions are required for each command. Please refer to the Permission Requirements and Configuring Microsoft Graph to Work with D3 SOAR for details.
Get ATP Security Alerts
Retrieve details of the specified alerts from the Microsoft Graph API .
Input
Input Parameter | Required /Optional | Description | Example |
Alert IDs | Required | The IDs of the alerts to retrieve corresponding details. | ["***************************************"] |
Output
Error Handling
If the Return Data is Partially Successful or Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Get ATP Security Alerts failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the Microsoft Graph portal. Refer to the HTTP Status Code Registry for details. | Status Code: 404. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: Alert ID Not Found. |
Error Sample Data Get ATP Security Alerts failed. Status Code: 404. Message: Alert ID Not Found. |
Get User and Manager Info
Retrieves details of the specified users and managers from the Microsoft Graph API.
Input
Input Parameter | Required /Optional | Description | Example |
User Array | Optional | The array of user and manager email addresses and/or nicknames to return corresponding information. | [ "username" ] |
Output
Error Handling
If the Return Data is Partially Successful or Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Get User and Manager Info failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the Microsoft Graph portal. Refer to the HTTP Status Code Registry for details. | Status Code: 404. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: User Array Not Found. |
Error Sample Data Get User and Manager Info failed. Status Code: 404. Message: User Array Not Found. |
Send Email
Sends an email using the Microsoft Graph API.
Reader Note
From Address is a required parameter to run this command.
The Azure account used to build the integration connection must have access to the input email address. To check which emails that your account has access to, log in to the Azure portal using the same account configured for the integration connection. Navigate to Users, to view a list of available email addresses.
Input
Input Parameter | Required /Optional | Description | Example |
From Address | Required | The sender’s email address. | *****@*****.com |
To Addresses | Required | A comma-separated list of recipient email addresses. | [ "*****@*****.com", "*****@*****.com" ] |
CC Addresses | Optional | A comma-separated list of email addresses to send a carbon copy of the email to. | [ "*****@*****.com", "*****@*****.com" ] |
Bcc Addresses | Optional | A comma-separated list of email addresses to send a blind carbon copy of the email to. | [ "*****@*****.com", "*****@*****.com" ] |
Reply Addresses | Optional | A comma-separated list of email addresses to use when replying. | [ "*****@*****.com", "*****@*****.com" ] |
Subject | Required | The subject of the email. | Subject of the email |
Text Body | Optional | The contents of the email body in text format. Note: At least one of the Text Body or HTML Body parameters must be defined in order to run this command. | Sample Data Dear Support Team, My name is ABC and I am an analyst working for the XXX Company. We have received a notification that User1 had suspicious email sending patterns detected on their mailbox: Sender: Sender Email Address Email Subject: Email Subject Recipient: Recipients Email Addresses This email has now been deleted from the recipient's mailbox for their safety. Can you please confirm with Sender if they are aware of the above email being sent from their mailbox? If not, please get in contact with our team (Cybersecurity@abc.com) ASAP. Thank you. Best Regards, Cyber Security Team cybersecurity@abc.com |
HTML Body | Optional | The contents of the email body in HTML format. Note: At least one of the Text Body or HTML Body parameters must be defined in order to run this command. | <!DOCTYPE html> <html> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>Email Body</title> </head> <body> <p>A Test Email using HTML as Email Body<p> </body> </html> |
Save To Sent Items | Optional | The option to save the message to Sent Items. The default value is Yes. | Yes |
Output
Error Handling
If the Return Data is Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Send Email failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the Microsoft Graph portal. Refer to the HTTP Status Code Registry for details. | Status Code: 400. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: Invalid Email Addresses. |
Error Sample Data Send Email failed. Status Code: 400. Message: Invalid Email Addresses. |
Test Connection
Allows you to perform a health check on an integration connection. You can schedule a periodic health check by selecting Connection Health Check when editing an integration connection.
Input
N/A
Output
Error Handling
If the Return Data is failed, an Error tab will appear in the Test Result window.
The error tab contains the responses from the third-party API calls including Failure Indicator, Status Code, and Message. This can help you locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Test Connection failed. Failed to check the connector. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the Microsoft Graph portal. Refer to the HTTP Status Code Registry for details. | Status Code: 403. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: Application with identifier 'xxx' was not found in the directory xxx. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant. |
Error Sample Data Test Connection failed. Failed to check the connector. Status Code: 403. Message: Application with identifier 'xxx' was not found in the directory xxx. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant. |