The Microsoft Graph API is a RESTful web API that enables you to access Microsoft Cloud service resources.
This document provides information about the Microsoft Graph API connector, which facilitates automated interactions using Microsoft Graph API. Add the Microsoft Graph API connector as a step in FortiSOAR™ playbooks and perform automated operations such as retrieving a list of all risky users from Microsoft Graph API, searching for messages based on Subject delivered to the user within the organization using Microsoft Graph API, or deleting a specific message from the specific user's mailbox in Azure.
Connector Version: 2.1.0
Authored By: Fortinet
Certified: Yes
FortiSOAR™ Version Tested on: 7.50.4015
Microsoft Graph API Version Tested on: v1
Following enhancements have been made to the Microsoft Graph API Connector in version 2.1.0:
Get Access Token.Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.
You can also use the yum command as a root user to install the connector:
yum install cyops-connector-microsoft-graph
For the procedure to configure a connector, click here
In FortiSOAR™, on the Connectors page, click the Microsoft Graph API connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:
| Parameter | Description |
|---|---|
| Server URL | Specify the service-based URI to connect and perform automated operations. |
| Tenant ID | Specify the ID of the tenant assigned to you by the Azure application registration portal. |
| Client ID | Specify the Unique Application ID of the Azure Active Directory application to create an authentication token required to access the API. For information on getting authentication tokens, see the Getting Authentication Tokens section. |
| Client Secret | (Not available for Certificate Based Authentication) Specify the Unique Client Secret of the Azure Active Directory application that is used to create an authentication token required to access the API. For information on how to get the secret key, see https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp. |
| Get Access Token | Select the method using to get authentication tokens used to access the security graph APIs. You can choose from following options:
|
| Verify SSL | Specifies whether the SSL certificate for the server is to be verified. By default, this option is set to True. |
The following automated operations can be included in playbooks and you can also use the annotations to access operations:
| Function | Description | Annotation and Category |
|---|---|---|
| Get Risky Users List | Retrieves a list of all risky users from Microsoft Graph API. | get_risky_users_list Investigation |
| Get Risky User Details | Retrieve details for a specific risky user from Microsoft Graph API based on the user ID you have specified. | get_risky_user_details Investigation |
| Get All Security Alerts | Retrieves a list of alerts from Microsoft Graph API based on the input parameters you have specified. | get_all_security_alerts Investigation |
| Get Security Alert | Retrieves details of a specific alert from Microsoft Graph API based on the alert ID you have specified. | get_security_alert Investigation |
| Update Security Alert | Updates a specific alert using Microsoft Graph API based on the alert ID, vendor name, provider name, and other input parameters you have specified. | update_security_alert Investigation |
| Get Groups | Retrieves a list of groups from Microsoft Graph API. | get_groups Investigation |
| Get Users Within A Group | Retrieves a list of users within a specific group from Microsoft Graph API based on the group ID you have specified. | get_group_users Investigation |
| Search Message in Users Mailbox | Searches for messages in a user's mailbox within an organization based on the Subject and user list you have specified. | search_message Investigation |
| Delete Message | Deletes a specific message from the specific user's mailbox in Azure based on the user ID and message ID you have specified. | del_message Investigation |
| Delete Message Bulk | Deletes messages from multiple users mailboxes in Azure based on the comma-separated list of users you have specified. | del_message_bulk Investigation |
| Revoke User Session | Invalidates all the refresh tokens issued to applications for a user. | revoke_user_sessions Remediation |
| Get All Named Locations | Retrieves a list of named location from Azure based on display name, sort order, and other input parameters that you have specified. | get_all_named_locations Investigation |
| Block New IP Ranges | Blocks IPv4 and IPv6 address ranges in specified NamedLocation in Azure. | block_new_ips Containment |
| Unblock IP Ranges | Unblocks IPv4 and IPv6 address ranges in specified NamedLocation in Azure. | unblock_new_ips Remediation |
| Create IP Named Location | Creates a new IP named location in Azure based on specified input parameter. | create_ip_range_location Investigation |
None.
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"id": "",
"isDeleted": "",
"isProcessing": "",
"riskLevel": "",
"riskState": "",
"riskDetail": "",
"riskLastUpdatedDateTime": "",
"userDisplayName": "",
"userPrincipalName": ""
}
]
}
| Parameter | Description |
|---|---|
| Risky User ID | Specify the ID of the risky user whose details you want to retrieve from Microsoft Graph API. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"id": "",
"isDeleted": "",
"isProcessing": "",
"riskLevel": "",
"riskState": "",
"riskDetail": "",
"riskLastUpdatedDateTime": "",
"userDisplayName": "",
"userPrincipalName": ""
}
Note: All the input parameters are optional. However, if you do not specify any parameter, then no filter criterion is applied, and an unfiltered list (of endpoints) is returned.
| Parameter | Description |
|---|---|
| Vendor | Specify the name of the product vendor that provided the alert you want to retrieve using Microsoft Graph API. For example, Microsoft |
| Provider | Specify the security product that provided the alert you want to retrieve using Microsoft Graph API. For example, Cloud Application Security |
| Severity | Select the alert severity, set by the vendor or provider, to retrieve alerts using Microsoft Graph API. You can choose from the following options:
|
| Search From | Select the date and time of alert triggering event(s) to retrieve using Microsoft Graph API. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"id": "",
"azureTenantId": "",
"azureSubscriptionId": "",
"riskScore": "",
"tags": [],
"activityGroupName": "",
"assignedTo": "",
"category": "",
"closedDateTime": "",
"comments": [],
"confidence": "",
"createdDateTime": "",
"description": "",
"detectionIds": [],
"eventDateTime": "",
"feedback": "",
"incidentIds": [],
"lastEventDateTime": "",
"lastModifiedDateTime": "",
"recommendedActions": [],
"severity": "",
"sourceMaterials": [],
"status": "",
"title": "",
"vendorInformation": {
"provider": "",
"providerVersion": "",
"subProvider": "",
"vendor": ""
},
"alertDetections": [],
"cloudAppStates": [],
"fileStates": [],
"hostStates": [],
"historyStates": [],
"investigationSecurityStates": [],
"malwareStates": [],
"messageSecurityStates": [],
"networkConnections": [],
"processes": [],
"registryKeyStates": [],
"securityResources": [],
"triggers": [],
"userStates": [],
"uriClickSecurityStates": [],
"vulnerabilityStates": []
}
]
}
| Parameter | Description |
|---|---|
| Alert ID | Specify the unique Alert ID to retrieve that alert from Microsoft Graph API. The alert ID is generated by the provider when an alert is created in Azure. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"id": "",
"azureTenantId": "",
"azureSubscriptionId": "",
"riskScore": "",
"tags": [],
"activityGroupName": "",
"assignedTo": "",
"category": "",
"closedDateTime": "",
"comments": [],
"confidence": "",
"createdDateTime": "",
"description": "",
"detectionIds": [],
"eventDateTime": "",
"feedback": "",
"incidentIds": [],
"lastEventDateTime": "",
"lastModifiedDateTime": "",
"recommendedActions": [],
"severity": "",
"sourceMaterials": [],
"status": "",
"title": "",
"vendorInformation": {
"provider": "",
"providerVersion": "",
"subProvider": "",
"vendor": ""
},
"alertDetections": [],
"cloudAppStates": [],
"fileStates": [],
"hostStates": [
{
"fqdn": "",
"isAzureAdJoined": "",
"isAzureAdRegistered": "",
"isHybridAzureDomainJoined": "",
"netBiosName": "",
"os": "",
"privateIpAddress": "",
"publicIpAddress": "",
"riskScore": ""
}
],
"historyStates": [],
"investigationSecurityStates": [],
"malwareStates": [],
"messageSecurityStates": [],
"networkConnections": [],
"processes": [],
"registryKeyStates": [],
"securityResources": [],
"triggers": [],
"userStates": [],
"uriClickSecurityStates": [],
"vulnerabilityStates": []
}
| Parameter | Description |
|---|---|
| Alert ID | Specify the unique alert ID to update that alert through Microsoft Graph API. The alert ID is generated by the provider when an alert is created in Azure. |
| Provider | Specify the provider of product or service in Azure to update in the specific alert in Azure. For example, WindowsDefenderATP. |
| Vendor | Specify the name of the vendor to update in the specific alert in Azure. For example, Microsoft. |
| Assigned To | (Optional) Specify the name of the analyst to whom you want to assign the specific alert that you want to update for triage, investigation, or remediation in Azure. |
| Feedback | (Optional) Select the analyst feedback on the alert that you want to update in the specific alert in Azure. You can choose from the following options: Unknown, True Positive, False Positive, or Benign Positive. |
| Comments | (Optional) Select the analyst comments that you want to update in the specific alert in Azure. You can choose between Closed in MCAS or Closed in IPS. |
| Status | (Optional) Select the status (life cycle status) that you want to update in the specific alert in Azure. You can choose from the following options: Unknown, New Alert, In Progress, or Resolved. |
| Tags | (Optional) Specify the JSON array of strings that store user-definable labels that can be applied to the alert that you want to update in Azure. These tags serve as filter conditions, and you can specify multiple tags using comma-based separators. |
| Provider Version | (Optional) Specify the version of the provider or sub-provider, if it exists, that generated the alert that you want to update in Azure. |
| Subprovider | (Optional) Specify the name of the sub-provider under the aggregating provider in Azure for the alert t that you want to update in Azure. For example, WindowsDefenderATP.SmartScreen |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"id": "",
"azureTenantId": "",
"azureSubscriptionId": "",
"riskScore": "",
"tags": [],
"activityGroupName": "",
"assignedTo": "",
"category": "",
"closedDateTime": "",
"comments": [],
"confidence": "",
"createdDateTime": "",
"description": "",
"detectionIds": [],
"eventDateTime": "",
"feedback": "",
"incidentIds": [],
"lastEventDateTime": "",
"lastModifiedDateTime": "",
"recommendedActions": [],
"severity": "",
"sourceMaterials": [],
"status": "",
"title": "",
"vendorInformation": {
"provider": "",
"providerVersion": "",
"subProvider": "",
"vendor": ""
},
"alertDetections": [],
"cloudAppStates": [],
"fileStates": [],
"hostStates": [
{
"fqdn": "",
"isAzureAdJoined": "",
"isAzureAdRegistered": "",
"isHybridAzureDomainJoined": "",
"netBiosName": "",
"os": "",
"privateIpAddress": "",
"publicIpAddress": "",
"riskScore": ""
}
],
"historyStates": [],
"investigationSecurityStates": [],
"malwareStates": [],
"messageSecurityStates": [],
"networkConnections": [],
"processes": [],
"registryKeyStates": [],
"securityResources": [],
"triggers": [],
"userStates": [],
"uriClickSecurityStates": [],
"vulnerabilityStates": []
}
None.
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"id": "",
"deletedDateTime": "",
"classification": "",
"createdDateTime": "",
"creationOptions": [],
"description": "",
"displayName": "",
"expirationDateTime": "",
"groupTypes": [],
"isAssignableToRole": "",
"mail": "",
"mailEnabled": "",
"mailNickname": "",
"membershipRule": "",
"membershipRuleProcessingState": "",
"onPremisesDomainName": "",
"onPremisesLastSyncDateTime": "",
"onPremisesNetBiosName": "",
"onPremisesSamAccountName": "",
"onPremisesSecurityIdentifier": "",
"onPremisesSyncEnabled": "",
"preferredDataLocation": "",
"preferredLanguage": "",
"proxyAddresses": [],
"renewedDateTime": "",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [],
"securityEnabled": "",
"securityIdentifier": "",
"theme": "",
"visibility": "",
"onPremisesProvisioningErrors": []
}
]
}
| Parameter | Description |
|---|---|
| Group ID | Specify an ID of the group whose users you want to retrieve from Microsoft Graph. Note: To get the Group ID use the Get Groups operation. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"@odata.type": "",
"id": "",
"businessPhones": [],
"displayName": "",
"givenName": "",
"jobTitle": "",
"mail": "",
"mobilePhone": "",
"officeLocation": "",
"preferredLanguage": "",
"surname": "",
"userPrincipalName": ""
}
]
}
| Parameter | Description |
|---|---|
| Subject | Specify a subject based on which you want to search messages in Azure. |
| User List | Specify a comma-separated list of user IDs based on which you want to search messages in Azure. |
| Page Size | (Optional) Number of messages you want to retrieve per user in this request. Default page size is 10. Page size should be between 1 to 1000 |
| Offset | (Optional) Number of messages you want to skip for each in this request. |
The output contains the following populated JSON schema:
{
"Message_Found_List": [
{
"@odata.context": "",
"value": [
{
"@odata.etag": "",
"id": "",
"createdDateTime": "",
"lastModifiedDateTime": "",
"changeKey": "",
"categories": [],
"receivedDateTime": "",
"sentDateTime": "",
"hasAttachments": "",
"internetMessageId": "",
"subject": "",
"bodyPreview": "",
"importance": "",
"parentFolderId": "",
"conversationId": "",
"conversationIndex": "",
"isDeliveryReceiptRequested": "",
"isReadReceiptRequested": "",
"isRead": "",
"isDraft": "",
"webLink": "",
"inferenceClassification": "",
"body": {
"contentType": "",
"content": ""
},
"sender": {
"emailAddress": {
"name": "",
"address": ""
}
},
"from": {
"emailAddress": {
"name": "",
"address": ""
}
},
"toRecipients": [
{
"emailAddress": {
"name": "",
"address": ""
}
}
],
"ccRecipients": [],
"bccRecipients": [],
"replyTo": [],
"flag": {
"flagStatus": ""
}
}
],
"user_id": ""
}
],
"Message_Not_Found_List": [
{
"@odata.context": "",
"value": [],
"user_id": ""
}
],
"Run_Time": "",
"Total_Users_Processed": ""
}
| Parameter | Description |
|---|---|
| User ID | Specify the ID of the user based on which you want to delete the specific message from Azure. |
| Message ID | Specify the ID of the message that you want to delete from Azure. |
The output contains the following populated JSON schema:
{
"status_code": ""
}
| Parameter | Description |
|---|---|
| User List | Specify a comma-separated list of users' mailboxes, which is a list of JSON objects, based on which you want to delete bulk messages in Azure. The format of the list is as follows:
[
{
'user_id':"",
'message_id':""
},
{
'user_id':"",
'message_id':""
}
]
|
The output contains the following populated JSON schema:
{
"Error_List": [
{
"error_msg": "",
"user_id": {
"user_id": "",
"message_id": ""
}
}
],
"Message_Deleted_List": [
{
"msg_deleted": "",
"user_id": {
"user_id": "",
"message_id": ""
}
}
],
"Run_Time": "",
"Total_Users_Processed": ""
}
| Parameter | Description |
|---|---|
| User ID or PrincipalName | Specify the User ID or PrincipalName of the user whose refresh tokens you want to invalidate (revoke) from Microsoft Graph API. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": ""
}
| Parameter | Description |
|---|---|
| Display Name | Specify the display name of the named location to retrieve from Azure. |
| Required Fields | (Optional) Specify filters properties (columns) to retrieve only specified fields in response from Azure. You can choose one or more from ID, Display Name, Created Date Time and Modified Date Time |
| Order By | (Optional) Select the sort order criterion to sort the results. Select the sorting order in Sort Order field. You can choose from following options:
|
| Sort Order | (Conditional - This field appears after selecting an order criterion in Order By field) Specify the sort order from the following options:
|
| Count | Select to retrieve the total count of named locations matched in Azure. By default it is set to false. |
| Size | (Optional) Specify the number of named locations to retrieve in this request. |
| Offset | (Optional) Specify the number of named locations you want to skip in this request. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": false,
"ipRanges": [
{
"@odata.type": "",
"cidrAddress": ""
}
]
}
]
}
| Parameter | Description |
|---|---|
| IP Named Location's UUID | Specify the unique Named Location ID for which you want block the IP addresses. |
| IPv4 Ranges | Specify IP address ranges in IPv4 CIDR format (1.2.3.4/32) to be blocked in the specified named location. You can specify multiple IPv4 ranges as comma-separated values. e.g. 10.10.10.10/14, 10.10.10.10/13, 10.10.10.10/09 |
| IPv6 Ranges | Specify IP address ranges in allowable IPv6 format, defined in IETF RFC5962, to be blocked in the specified named location. You can specify multiple IPv6 ranges as comma-separated values. e.g. 2001:db8::/43, 2001:db8::/47 |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": "",
"ipRanges": [
{
"@odata.type": "",
"cidrAddress": ""
}
]
}
| Parameter | Description |
|---|---|
| IP Named Location's UUID | Specify the unique named location ID for which you want unblock the IP addresses. |
| IPv4 Ranges | Specify IP address ranges in IPv4 CIDR format (1.2.3.4/32) to be unblocked in the specified named location. You can specify multiple IPv4 ranges as comma-separated values. For example: 10.10.10.10/14, 10.10.10.10/13, 10.10.10.10/09 |
| IPv6 Ranges | Specify IP address ranges in IPv6 format, as defined in IETF RFC5962, to be unblocked in the specified named location. You can specify multiple IPv6 ranges as comma-separated values. For example: 2001:db8::/43, 2001:db8::/47 |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": "",
"ipRanges": [
{
"@odata.type": "",
"cidrAddress": ""
}
]
}
| Parameter | Description |
|---|---|
| Display Name | Specify the display name of the named location to create in Azure. |
| Is Trusted | Select if the IP Range is trusted. |
| IPv4 Ranges | Specify IP address ranges in IPv4 CIDR format (1.2.3.4/32) to be added in the specified named location. You can specify multiple IPv4 ranges as comma-separated values. For example: 10.10.10.10/14, 10.10.10.10/13, 10.10.10.10/09 |
| IPv6 Ranges | Specify IP address ranges in IPv6 format, as defined in IETF RFC5962, to be added in the specified named location. You can specify multiple IPv6 ranges as comma-separated values. For example: 2001:db8::/43, 2001:db8::/47 |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": "",
"ipRanges": []
}
The Sample - Microsoft Graph API - 2.1.0 playbook collection comes bundled with the Microsoft Graph API connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the Microsoft Graph API connector.
Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.
You can get authentication tokens to access the graph APIs using two methods:
TENANT_ID, CLIENT_ID, and REDIRECT_URI with your tenant ID, client ID, and the following redirect URL:https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/authorize?response_type=code&scope=offline_access https://graph.microsoft.com/.default&client_id=CLIENT_ID&redirect_uri=REDIRECT_URIREDIRECT_URI?code=AUTH_CODE&session_state=SESSION_STATEAUTH_CODE (without the code= prefix) and paste it in your instance configuration in the Authorization Code parameter.Directory.Read.AllDirectory.ReadWrite.AllGroupMember.Read.AllGroup.Read.AllGroup.ReadWrite.AllIdentityRiskyUser.Read.AllMail.ReadBasic.AllMail.ReadMail.ReadWriteSecurityEvents.Read.AllSecurityEvents.ReadWrite.All Policy.Read.AllPolicy.ReadWrite.ConditionalAccess of type ApplicationTo call the Microsoft Graph API, to perform any action, you must be assigned specific permissions as defined in this section. To learn more, including how to choose permissions, see Microsoft Graph's permissions reference.
| Action Name | Permission Type | Permissions (from least to most privileged) |
|---|---|---|
| Get Risky Users List | Delegated | IdentityRiskyUser.Read.All |
| Application | IdentityRiskyUser.Read.All |
|
| Get Risky User Details | Delegated | IdentityRiskyUser.Read.All |
| Application | IdentityRiskyUser.Read.All |
|
| Get All Security Alerts | Delegated | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
| Application | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
|
| Get Security Alert | Delegated | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
| Application | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
|
| Update Security Alert | Delegated | SecurityEvents.ReadWrite.All |
| Application | SecurityEvents.ReadWrite.All |
|
| Get Groups | Delegated | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
| Application | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
|
| Get Users Within A Group | Delegated | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
| Application | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
|
| Search Messages in Users mailbox | Delegated | Mail.ReadWrite |
| Application | Mail.ReadWrite |
|
| Delete Message | Delegated | Mail.ReadWrite |
| Application | Mail.ReadWrite |
|
| Delete Messages Bulk | Delegated | Mail.ReadWrite |
| Application | Mail.ReadWrite |
|
| Revoke user session | Delegated | User.ReadWrite.All, Directory.ReadWrite.All |
| Application | User.ReadWrite.All, Directory.ReadWrite.All |
|
| Get All Named Locations | Delegated | Policy.Read.All |
| Application | Policy.Read.All |
|
| Block IP Ranges | Delegated | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
| Application | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
|
| Unblock IP ranges | Delegated | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
| Application | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
|
| Create IP Named Location | Delegated | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
| Application | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
The Microsoft Graph API is a RESTful web API that enables you to access Microsoft Cloud service resources.
This document provides information about the Microsoft Graph API connector, which facilitates automated interactions using Microsoft Graph API. Add the Microsoft Graph API connector as a step in FortiSOAR™ playbooks and perform automated operations such as retrieving a list of all risky users from Microsoft Graph API, searching for messages based on Subject delivered to the user within the organization using Microsoft Graph API, or deleting a specific message from the specific user's mailbox in Azure.
Connector Version: 2.1.0
Authored By: Fortinet
Certified: Yes
FortiSOAR™ Version Tested on: 7.50.4015
Microsoft Graph API Version Tested on: v1
Following enhancements have been made to the Microsoft Graph API Connector in version 2.1.0:
Get Access Token.Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.
You can also use the yum command as a root user to install the connector:
yum install cyops-connector-microsoft-graph
For the procedure to configure a connector, click here
In FortiSOAR™, on the Connectors page, click the Microsoft Graph API connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:
| Parameter | Description |
|---|---|
| Server URL | Specify the service-based URI to connect and perform automated operations. |
| Tenant ID | Specify the ID of the tenant assigned to you by the Azure application registration portal. |
| Client ID | Specify the Unique Application ID of the Azure Active Directory application to create an authentication token required to access the API. For information on getting authentication tokens, see the Getting Authentication Tokens section. |
| Client Secret | (Not available for Certificate Based Authentication) Specify the Unique Client Secret of the Azure Active Directory application that is used to create an authentication token required to access the API. For information on how to get the secret key, see https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp. |
| Get Access Token | Select the method using to get authentication tokens used to access the security graph APIs. You can choose from following options:
|
| Verify SSL | Specifies whether the SSL certificate for the server is to be verified. By default, this option is set to True. |
The following automated operations can be included in playbooks and you can also use the annotations to access operations:
| Function | Description | Annotation and Category |
|---|---|---|
| Get Risky Users List | Retrieves a list of all risky users from Microsoft Graph API. | get_risky_users_list Investigation |
| Get Risky User Details | Retrieve details for a specific risky user from Microsoft Graph API based on the user ID you have specified. | get_risky_user_details Investigation |
| Get All Security Alerts | Retrieves a list of alerts from Microsoft Graph API based on the input parameters you have specified. | get_all_security_alerts Investigation |
| Get Security Alert | Retrieves details of a specific alert from Microsoft Graph API based on the alert ID you have specified. | get_security_alert Investigation |
| Update Security Alert | Updates a specific alert using Microsoft Graph API based on the alert ID, vendor name, provider name, and other input parameters you have specified. | update_security_alert Investigation |
| Get Groups | Retrieves a list of groups from Microsoft Graph API. | get_groups Investigation |
| Get Users Within A Group | Retrieves a list of users within a specific group from Microsoft Graph API based on the group ID you have specified. | get_group_users Investigation |
| Search Message in Users Mailbox | Searches for messages in a user's mailbox within an organization based on the Subject and user list you have specified. | search_message Investigation |
| Delete Message | Deletes a specific message from the specific user's mailbox in Azure based on the user ID and message ID you have specified. | del_message Investigation |
| Delete Message Bulk | Deletes messages from multiple users mailboxes in Azure based on the comma-separated list of users you have specified. | del_message_bulk Investigation |
| Revoke User Session | Invalidates all the refresh tokens issued to applications for a user. | revoke_user_sessions Remediation |
| Get All Named Locations | Retrieves a list of named location from Azure based on display name, sort order, and other input parameters that you have specified. | get_all_named_locations Investigation |
| Block New IP Ranges | Blocks IPv4 and IPv6 address ranges in specified NamedLocation in Azure. | block_new_ips Containment |
| Unblock IP Ranges | Unblocks IPv4 and IPv6 address ranges in specified NamedLocation in Azure. | unblock_new_ips Remediation |
| Create IP Named Location | Creates a new IP named location in Azure based on specified input parameter. | create_ip_range_location Investigation |
None.
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"id": "",
"isDeleted": "",
"isProcessing": "",
"riskLevel": "",
"riskState": "",
"riskDetail": "",
"riskLastUpdatedDateTime": "",
"userDisplayName": "",
"userPrincipalName": ""
}
]
}
| Parameter | Description |
|---|---|
| Risky User ID | Specify the ID of the risky user whose details you want to retrieve from Microsoft Graph API. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"id": "",
"isDeleted": "",
"isProcessing": "",
"riskLevel": "",
"riskState": "",
"riskDetail": "",
"riskLastUpdatedDateTime": "",
"userDisplayName": "",
"userPrincipalName": ""
}
Note: All the input parameters are optional. However, if you do not specify any parameter, then no filter criterion is applied, and an unfiltered list (of endpoints) is returned.
| Parameter | Description |
|---|---|
| Vendor | Specify the name of the product vendor that provided the alert you want to retrieve using Microsoft Graph API. For example, Microsoft |
| Provider | Specify the security product that provided the alert you want to retrieve using Microsoft Graph API. For example, Cloud Application Security |
| Severity | Select the alert severity, set by the vendor or provider, to retrieve alerts using Microsoft Graph API. You can choose from the following options:
|
| Search From | Select the date and time of alert triggering event(s) to retrieve using Microsoft Graph API. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"id": "",
"azureTenantId": "",
"azureSubscriptionId": "",
"riskScore": "",
"tags": [],
"activityGroupName": "",
"assignedTo": "",
"category": "",
"closedDateTime": "",
"comments": [],
"confidence": "",
"createdDateTime": "",
"description": "",
"detectionIds": [],
"eventDateTime": "",
"feedback": "",
"incidentIds": [],
"lastEventDateTime": "",
"lastModifiedDateTime": "",
"recommendedActions": [],
"severity": "",
"sourceMaterials": [],
"status": "",
"title": "",
"vendorInformation": {
"provider": "",
"providerVersion": "",
"subProvider": "",
"vendor": ""
},
"alertDetections": [],
"cloudAppStates": [],
"fileStates": [],
"hostStates": [],
"historyStates": [],
"investigationSecurityStates": [],
"malwareStates": [],
"messageSecurityStates": [],
"networkConnections": [],
"processes": [],
"registryKeyStates": [],
"securityResources": [],
"triggers": [],
"userStates": [],
"uriClickSecurityStates": [],
"vulnerabilityStates": []
}
]
}
| Parameter | Description |
|---|---|
| Alert ID | Specify the unique Alert ID to retrieve that alert from Microsoft Graph API. The alert ID is generated by the provider when an alert is created in Azure. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"id": "",
"azureTenantId": "",
"azureSubscriptionId": "",
"riskScore": "",
"tags": [],
"activityGroupName": "",
"assignedTo": "",
"category": "",
"closedDateTime": "",
"comments": [],
"confidence": "",
"createdDateTime": "",
"description": "",
"detectionIds": [],
"eventDateTime": "",
"feedback": "",
"incidentIds": [],
"lastEventDateTime": "",
"lastModifiedDateTime": "",
"recommendedActions": [],
"severity": "",
"sourceMaterials": [],
"status": "",
"title": "",
"vendorInformation": {
"provider": "",
"providerVersion": "",
"subProvider": "",
"vendor": ""
},
"alertDetections": [],
"cloudAppStates": [],
"fileStates": [],
"hostStates": [
{
"fqdn": "",
"isAzureAdJoined": "",
"isAzureAdRegistered": "",
"isHybridAzureDomainJoined": "",
"netBiosName": "",
"os": "",
"privateIpAddress": "",
"publicIpAddress": "",
"riskScore": ""
}
],
"historyStates": [],
"investigationSecurityStates": [],
"malwareStates": [],
"messageSecurityStates": [],
"networkConnections": [],
"processes": [],
"registryKeyStates": [],
"securityResources": [],
"triggers": [],
"userStates": [],
"uriClickSecurityStates": [],
"vulnerabilityStates": []
}
| Parameter | Description |
|---|---|
| Alert ID | Specify the unique alert ID to update that alert through Microsoft Graph API. The alert ID is generated by the provider when an alert is created in Azure. |
| Provider | Specify the provider of product or service in Azure to update in the specific alert in Azure. For example, WindowsDefenderATP. |
| Vendor | Specify the name of the vendor to update in the specific alert in Azure. For example, Microsoft. |
| Assigned To | (Optional) Specify the name of the analyst to whom you want to assign the specific alert that you want to update for triage, investigation, or remediation in Azure. |
| Feedback | (Optional) Select the analyst feedback on the alert that you want to update in the specific alert in Azure. You can choose from the following options: Unknown, True Positive, False Positive, or Benign Positive. |
| Comments | (Optional) Select the analyst comments that you want to update in the specific alert in Azure. You can choose between Closed in MCAS or Closed in IPS. |
| Status | (Optional) Select the status (life cycle status) that you want to update in the specific alert in Azure. You can choose from the following options: Unknown, New Alert, In Progress, or Resolved. |
| Tags | (Optional) Specify the JSON array of strings that store user-definable labels that can be applied to the alert that you want to update in Azure. These tags serve as filter conditions, and you can specify multiple tags using comma-based separators. |
| Provider Version | (Optional) Specify the version of the provider or sub-provider, if it exists, that generated the alert that you want to update in Azure. |
| Subprovider | (Optional) Specify the name of the sub-provider under the aggregating provider in Azure for the alert t that you want to update in Azure. For example, WindowsDefenderATP.SmartScreen |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"id": "",
"azureTenantId": "",
"azureSubscriptionId": "",
"riskScore": "",
"tags": [],
"activityGroupName": "",
"assignedTo": "",
"category": "",
"closedDateTime": "",
"comments": [],
"confidence": "",
"createdDateTime": "",
"description": "",
"detectionIds": [],
"eventDateTime": "",
"feedback": "",
"incidentIds": [],
"lastEventDateTime": "",
"lastModifiedDateTime": "",
"recommendedActions": [],
"severity": "",
"sourceMaterials": [],
"status": "",
"title": "",
"vendorInformation": {
"provider": "",
"providerVersion": "",
"subProvider": "",
"vendor": ""
},
"alertDetections": [],
"cloudAppStates": [],
"fileStates": [],
"hostStates": [
{
"fqdn": "",
"isAzureAdJoined": "",
"isAzureAdRegistered": "",
"isHybridAzureDomainJoined": "",
"netBiosName": "",
"os": "",
"privateIpAddress": "",
"publicIpAddress": "",
"riskScore": ""
}
],
"historyStates": [],
"investigationSecurityStates": [],
"malwareStates": [],
"messageSecurityStates": [],
"networkConnections": [],
"processes": [],
"registryKeyStates": [],
"securityResources": [],
"triggers": [],
"userStates": [],
"uriClickSecurityStates": [],
"vulnerabilityStates": []
}
None.
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"id": "",
"deletedDateTime": "",
"classification": "",
"createdDateTime": "",
"creationOptions": [],
"description": "",
"displayName": "",
"expirationDateTime": "",
"groupTypes": [],
"isAssignableToRole": "",
"mail": "",
"mailEnabled": "",
"mailNickname": "",
"membershipRule": "",
"membershipRuleProcessingState": "",
"onPremisesDomainName": "",
"onPremisesLastSyncDateTime": "",
"onPremisesNetBiosName": "",
"onPremisesSamAccountName": "",
"onPremisesSecurityIdentifier": "",
"onPremisesSyncEnabled": "",
"preferredDataLocation": "",
"preferredLanguage": "",
"proxyAddresses": [],
"renewedDateTime": "",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [],
"securityEnabled": "",
"securityIdentifier": "",
"theme": "",
"visibility": "",
"onPremisesProvisioningErrors": []
}
]
}
| Parameter | Description |
|---|---|
| Group ID | Specify an ID of the group whose users you want to retrieve from Microsoft Graph. Note: To get the Group ID use the Get Groups operation. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"@odata.type": "",
"id": "",
"businessPhones": [],
"displayName": "",
"givenName": "",
"jobTitle": "",
"mail": "",
"mobilePhone": "",
"officeLocation": "",
"preferredLanguage": "",
"surname": "",
"userPrincipalName": ""
}
]
}
| Parameter | Description |
|---|---|
| Subject | Specify a subject based on which you want to search messages in Azure. |
| User List | Specify a comma-separated list of user IDs based on which you want to search messages in Azure. |
| Page Size | (Optional) Number of messages you want to retrieve per user in this request. Default page size is 10. Page size should be between 1 to 1000 |
| Offset | (Optional) Number of messages you want to skip for each in this request. |
The output contains the following populated JSON schema:
{
"Message_Found_List": [
{
"@odata.context": "",
"value": [
{
"@odata.etag": "",
"id": "",
"createdDateTime": "",
"lastModifiedDateTime": "",
"changeKey": "",
"categories": [],
"receivedDateTime": "",
"sentDateTime": "",
"hasAttachments": "",
"internetMessageId": "",
"subject": "",
"bodyPreview": "",
"importance": "",
"parentFolderId": "",
"conversationId": "",
"conversationIndex": "",
"isDeliveryReceiptRequested": "",
"isReadReceiptRequested": "",
"isRead": "",
"isDraft": "",
"webLink": "",
"inferenceClassification": "",
"body": {
"contentType": "",
"content": ""
},
"sender": {
"emailAddress": {
"name": "",
"address": ""
}
},
"from": {
"emailAddress": {
"name": "",
"address": ""
}
},
"toRecipients": [
{
"emailAddress": {
"name": "",
"address": ""
}
}
],
"ccRecipients": [],
"bccRecipients": [],
"replyTo": [],
"flag": {
"flagStatus": ""
}
}
],
"user_id": ""
}
],
"Message_Not_Found_List": [
{
"@odata.context": "",
"value": [],
"user_id": ""
}
],
"Run_Time": "",
"Total_Users_Processed": ""
}
| Parameter | Description |
|---|---|
| User ID | Specify the ID of the user based on which you want to delete the specific message from Azure. |
| Message ID | Specify the ID of the message that you want to delete from Azure. |
The output contains the following populated JSON schema:
{
"status_code": ""
}
| Parameter | Description |
|---|---|
| User List | Specify a comma-separated list of users' mailboxes, which is a list of JSON objects, based on which you want to delete bulk messages in Azure. The format of the list is as follows:
[
{
'user_id':"",
'message_id':""
},
{
'user_id':"",
'message_id':""
}
]
|
The output contains the following populated JSON schema:
{
"Error_List": [
{
"error_msg": "",
"user_id": {
"user_id": "",
"message_id": ""
}
}
],
"Message_Deleted_List": [
{
"msg_deleted": "",
"user_id": {
"user_id": "",
"message_id": ""
}
}
],
"Run_Time": "",
"Total_Users_Processed": ""
}
| Parameter | Description |
|---|---|
| User ID or PrincipalName | Specify the User ID or PrincipalName of the user whose refresh tokens you want to invalidate (revoke) from Microsoft Graph API. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": ""
}
| Parameter | Description |
|---|---|
| Display Name | Specify the display name of the named location to retrieve from Azure. |
| Required Fields | (Optional) Specify filters properties (columns) to retrieve only specified fields in response from Azure. You can choose one or more from ID, Display Name, Created Date Time and Modified Date Time |
| Order By | (Optional) Select the sort order criterion to sort the results. Select the sorting order in Sort Order field. You can choose from following options:
|
| Sort Order | (Conditional - This field appears after selecting an order criterion in Order By field) Specify the sort order from the following options:
|
| Count | Select to retrieve the total count of named locations matched in Azure. By default it is set to false. |
| Size | (Optional) Specify the number of named locations to retrieve in this request. |
| Offset | (Optional) Specify the number of named locations you want to skip in this request. |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"value": [
{
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": false,
"ipRanges": [
{
"@odata.type": "",
"cidrAddress": ""
}
]
}
]
}
| Parameter | Description |
|---|---|
| IP Named Location's UUID | Specify the unique Named Location ID for which you want block the IP addresses. |
| IPv4 Ranges | Specify IP address ranges in IPv4 CIDR format (1.2.3.4/32) to be blocked in the specified named location. You can specify multiple IPv4 ranges as comma-separated values. e.g. 10.10.10.10/14, 10.10.10.10/13, 10.10.10.10/09 |
| IPv6 Ranges | Specify IP address ranges in allowable IPv6 format, defined in IETF RFC5962, to be blocked in the specified named location. You can specify multiple IPv6 ranges as comma-separated values. e.g. 2001:db8::/43, 2001:db8::/47 |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": "",
"ipRanges": [
{
"@odata.type": "",
"cidrAddress": ""
}
]
}
| Parameter | Description |
|---|---|
| IP Named Location's UUID | Specify the unique named location ID for which you want unblock the IP addresses. |
| IPv4 Ranges | Specify IP address ranges in IPv4 CIDR format (1.2.3.4/32) to be unblocked in the specified named location. You can specify multiple IPv4 ranges as comma-separated values. For example: 10.10.10.10/14, 10.10.10.10/13, 10.10.10.10/09 |
| IPv6 Ranges | Specify IP address ranges in IPv6 format, as defined in IETF RFC5962, to be unblocked in the specified named location. You can specify multiple IPv6 ranges as comma-separated values. For example: 2001:db8::/43, 2001:db8::/47 |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": "",
"ipRanges": [
{
"@odata.type": "",
"cidrAddress": ""
}
]
}
| Parameter | Description |
|---|---|
| Display Name | Specify the display name of the named location to create in Azure. |
| Is Trusted | Select if the IP Range is trusted. |
| IPv4 Ranges | Specify IP address ranges in IPv4 CIDR format (1.2.3.4/32) to be added in the specified named location. You can specify multiple IPv4 ranges as comma-separated values. For example: 10.10.10.10/14, 10.10.10.10/13, 10.10.10.10/09 |
| IPv6 Ranges | Specify IP address ranges in IPv6 format, as defined in IETF RFC5962, to be added in the specified named location. You can specify multiple IPv6 ranges as comma-separated values. For example: 2001:db8::/43, 2001:db8::/47 |
The output contains the following populated JSON schema:
{
"@odata.context": "",
"@odata.type": "",
"id": "",
"displayName": "",
"modifiedDateTime": "",
"createdDateTime": "",
"isTrusted": "",
"ipRanges": []
}
The Sample - Microsoft Graph API - 2.1.0 playbook collection comes bundled with the Microsoft Graph API connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the Microsoft Graph API connector.
Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.
You can get authentication tokens to access the graph APIs using two methods:
TENANT_ID, CLIENT_ID, and REDIRECT_URI with your tenant ID, client ID, and the following redirect URL:https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/authorize?response_type=code&scope=offline_access https://graph.microsoft.com/.default&client_id=CLIENT_ID&redirect_uri=REDIRECT_URIREDIRECT_URI?code=AUTH_CODE&session_state=SESSION_STATEAUTH_CODE (without the code= prefix) and paste it in your instance configuration in the Authorization Code parameter.Directory.Read.AllDirectory.ReadWrite.AllGroupMember.Read.AllGroup.Read.AllGroup.ReadWrite.AllIdentityRiskyUser.Read.AllMail.ReadBasic.AllMail.ReadMail.ReadWriteSecurityEvents.Read.AllSecurityEvents.ReadWrite.All Policy.Read.AllPolicy.ReadWrite.ConditionalAccess of type ApplicationTo call the Microsoft Graph API, to perform any action, you must be assigned specific permissions as defined in this section. To learn more, including how to choose permissions, see Microsoft Graph's permissions reference.
| Action Name | Permission Type | Permissions (from least to most privileged) |
|---|---|---|
| Get Risky Users List | Delegated | IdentityRiskyUser.Read.All |
| Application | IdentityRiskyUser.Read.All |
|
| Get Risky User Details | Delegated | IdentityRiskyUser.Read.All |
| Application | IdentityRiskyUser.Read.All |
|
| Get All Security Alerts | Delegated | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
| Application | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
|
| Get Security Alert | Delegated | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
| Application | SecurityEvents.Read.All, SecurityEvents.ReadWrite.All |
|
| Update Security Alert | Delegated | SecurityEvents.ReadWrite.All |
| Application | SecurityEvents.ReadWrite.All |
|
| Get Groups | Delegated | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
| Application | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
|
| Get Users Within A Group | Delegated | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
| Application | GroupMember.Read.All, Group.Read.All, Directory.Read.All, Group.ReadWrite.All, Directory.ReadWrite.All |
|
| Search Messages in Users mailbox | Delegated | Mail.ReadWrite |
| Application | Mail.ReadWrite |
|
| Delete Message | Delegated | Mail.ReadWrite |
| Application | Mail.ReadWrite |
|
| Delete Messages Bulk | Delegated | Mail.ReadWrite |
| Application | Mail.ReadWrite |
|
| Revoke user session | Delegated | User.ReadWrite.All, Directory.ReadWrite.All |
| Application | User.ReadWrite.All, Directory.ReadWrite.All |
|
| Get All Named Locations | Delegated | Policy.Read.All |
| Application | Policy.Read.All |
|
| Block IP Ranges | Delegated | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
| Application | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
|
| Unblock IP ranges | Delegated | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
| Application | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
|
| Create IP Named Location | Delegated | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |
| Application | Policy.Read.All and Policy.ReadWrite.ConditionalAccess |