Microsoft office 365
Microsoft Office 365 is a cloud-based productivity suite offering email, collaboration, and business applications for organizations of all sizes.
Microsoft Office 365 is a leading cloud-based productivity and collaboration platform, offering email, document management, and compliance solutions for organizations of all sizes. The Swimlane Turbine connector enables seamless integration with Office 365, allowing users to automate the retrieval of audit logs, manage content subscriptions, and generate message trace reports without writing code. By leveraging this connector, security teams can streamline compliance monitoring, accelerate incident investigations, and orchestrate real-time responses to security events directly within Swimlane Turbine. This integration empowers organizations to enhance visibility, reduce manual effort, and ensure proactive security and compliance across their Office 365 environment.
Prerequisites
Before you can use the Microsoft Office 365 connector, ensure you have the following prerequisites:
- OAuth2 Refresh Token authentication for accounts with Multi-Factor Authentication (MFA) enabled, requiring:
- URL: The endpoint for Microsoft Office 365 API access.
- Client ID: The application/client identifier registered in Azure AD.
- Client Secret: The secret key associated with your Azure AD application.
- Refresh Token: A valid refresh token for obtaining new access tokens.
- OAuth2 Client Credentials authentication, requiring:
- URL: The endpoint for Microsoft Office 365 API access.
- Client ID: The application/client identifier registered in Azure AD.
- Client Secret: The secret key associated with your Azure AD application.
- Token URL: The OAuth2 token endpoint for acquiring access tokens.
- Scopes: The permissions required for the connector to access Office 365 resources.
Asset Setup
Client Credential Flow Authentication
Authentication uses Azure application OAuth2. You will need an admin account in Azure to create the application.
Recommended Application Permissions (feel free use custom permissions if you only use certain actions):
- ReportingWebService.Read
In order to set up the asset, you need the following:
- Azure Application Client ID
- Azure Application Client Secret
- Azure Tenant ID
Steps to create the Azure app:
- Go to the App Registration page in the Azure portal.
- Click New Registration.
- Enter a name for your new application and choose Accounts in this organizational directory only, then click Register at the bottom.
- Navigate to the API permissions tab on the left navigation menu.
- Select Add a permission.
- Select APIs my organization uses.
- Search Office 365 Exchange Online, then mark all the permissions you need for the actions you are using (See suggested permissions at the top of the asset setup section).
- Click the Add permissions button at the bottom of the page.
- Select Grant admin consent for your organization, then your permissions should look as below.
- Navigate to the Certificates & secrets tab and select New client secret.
- Fill out the description and expiration, then click the Add button at the bottom.
- The Value of the secret you just created is the Client Secret needed for the Swimlane asset.
- Navigate to the Overview tab on the left menu.
- The Client ID and Tenant ID needed in the asset are shown on this page.
Assign Roles to the Application
Global Reader and Security Reader are required for the application to get Trace Report
Steps to assign roles to the Azure app:
- Go the Azure Active Directory Page.
- Click on Roles and Administrators tab on the left side of Azure Active Directory Page.
- Search for Global Reader in the filter search bar and select the Global Reader role by clicking on its text. Make sure not to click the checkbox next to it and click only on the role's name with the checkbox unmarked.
- Click on the Add Assignments tab for the Global Reader.
- Opens the Add Assignments page click on the text below Select member(s) and search for your application. Select it and click Add then click on the Next button on the bottom left after that it will go to Setting tab.
- Select Active for Assignment type and enter the description explaining why this role should be added.
- Click on Roles and administrators | All roles at the top of the page to view the complete list of roles.
- Modify your filter selection to Security Reader and click on the text representing Security Reader. Ensure you do not select the checkbox next to Security Reader instead, click directly on the text with the checkbox unselected.
- Similarly follow the steps from 4 to 6.
Authentication
The connector can be authenticated in one of two ways:
- Oauth 2.0 client credentials flow, which requires a Client ID, Client Secret and Token URL. For more information, click here
- Oauth 2.0 refresh token grant, which requires a 'Refresh Token', 'Client ID' and 'Client Secret'. Use this auth with accounts which have MFA enabled. To generate a refresh token please follow the instructions below.
- In step 3 of the above-mentioned setup instructions, please provide a 'Redirect URI' and select the platform as 'Web', before clicking on 'Register' at the the bottom.
- Proceed with the remaining steps to generate 'Client ID' and 'Client Secret'.
- The Swimlane team will provide a Python script and instructions on how to use the script to generate the Refresh Token.
Capabilities
This Connector provides the following capabilities:
- List Available Content
- List Current Subscriptions
- Message Trace Report
- Retrieve Content
- Start Subscription
- Stop Subscription
Notes
- For the Refresh Token Auth, The generated refresh token will have 90 days as the default expiry value unless it is reduced by your organization. You need to update the asset after the refresh token expires.
- For more information on Microsoft Office 365 is found at: Microsoft Office 365 Documentation
- Link to Message Trace Report API
Configurations
MS Office 365 Oauth 2.0 Client Credentials
Authenticates using oauth 2.0 client credentials
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
url | A URL to the target host. | string | Required |
token_url | Must start with https://login.microsoftonline.com/ and then continue with the tenant_id, and then be prepended with /oauth2/v2.0/token | string | Required |
client_id | The client ID | string | Required |
client_secret | The client secret. | string | Required |
scope | Permission scopes for this action. | array | Required |
verify_ssl | Verify SSL certificate | boolean | Optional |
http_proxy | A proxy to route requests through. | string | Optional |
MS Office 365 Refresh Token Grant
Authenticates using refresh token. Use this authentication for accounts with MFA enabled.
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
url | A URL to the target host. | string | Required |
cl_id | The client ID. | string | Required |
cl_secret | The client secret. | string | Required |
refresh_token | Refresh Token. | string | Required |
verify_ssl | Verify SSL certificate | boolean | Optional |
http_proxy | A proxy to route requests through. | string | Optional |
Actions
List Available Content
Retrieve a list of available content by specified type and publisher from Microsoft Office 365 using ContentType and PublisherIdentifier.
Endpoint
- URL: /subscriptions/content
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.ContentType | string | Required | Indicates the content type. Must be a valid content type. |
parameters.PublisherIdentifier | string | Required | The tenant GUID of the vendor coding against the API. This is not the application GUID or the GUID of the customer using the application, but the GUID of the company writing the code. |
parameters.startTime | string | Optional | Optional datetimes (UTC) indicating the time range of content to return, based on when the content became available. |
parameters.endTime | string | Optional | Optional datetimes (UTC) indicating the time range of content to return, based on when the content became available. |
Input Example
{"parameters":{"ContentType":"Audit.SharePoint","PublisherIdentifier":"46b472a7-c68e-4adf-8ade-3db49497518e","startTime":"2015-05-23","endTime":"2015-05-30"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
Output Example
{"status_code":200,"response_headers":{"Cache-Control":"no-cache, no-store","Content-Length":"788","Content-Type":"application/json;odata=verbose;charset=utf-8","Server":"Microsoft-IIS/10.0","request-id":"2cf9be82-5112-b143-24d7-fe3e1df355d7","X-CalculatedBETarget":"DM4PR14MB4896.namprd14.PROD.OUTLOOK.COM","X-BackEndHttpStatus":"200","X-RUM-Validated":"1","X-RUM-NotUpdateQueriedPath":"1","X-RUM-NotUpdateQueriedDbCopy":"1","x-ms-appId":"95d971d3-07b0-4eda-9e7e-c72ffae8ede2","Restrict-Access-Confi...
List Current Subscriptions
Retrieve current Microsoft Office 365 subscriptions and related webhooks by specifying the PublisherIdentifier.
Endpoint
- URL: /subscriptions/list
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.PublisherIdentifier | string | Required | Tenant GUID of the Vendor. |
Input Example
{"parameters":{"PublisherIdentifier":"46b472a7-c68e-4adf-8ade-3db49497518e"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
contentType | string | Type of the resource |
status | string | Status value |
webhook | object | Output field: webhook |
webhook.status | string | Status value |
webhook.address | string | Output field: webhook.address |
webhook.authId | string | Unique identifier |
webhook.expiration | object | Output field: webhook.expiration |
Output Example
{"status_code":200,"response_headers":{"Cache-Control":"no-cache, no-store","Content-Length":788,"Content-Type":"application/json;odata=verbose;charset=utf-8","Server":"Microsoft-IIS/10.0","request-id":"2cf9be82-5112-b143-24d7-fe3e1df355d7","X-CalculatedBETarget":"DM4PR14MB4896.namprd14.PROD.OUTLOOK.COM","X-BackEndHttpStatus":"200","X-RUM-Validated":"1","X-RUM-NotUpdateQueriedPath":"1","X-RUM-NotUpdateQueriedDbCopy":"1","x-ms-appId":"95d971d3-07b0-4eda-9e7e-c72ffae8ede2","Restrict-Access-Confirm...
Message Trace Report
Generate a summary report on email message processing to provide insights into mail flow and delivery within Microsoft Office 365.
Endpoint
- URL: /ecp/reportingwebservice/reporting.svc/MessageTrace
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.$format | string | Optional | Parameters for the Message Trace Report action |
parameters.$orderby | string | Optional | Parameters for the Message Trace Report action |
parameters.$select | string | Optional | Parameters for the Message Trace Report action |
parameters.$filter | string | Optional | Parameters for the Message Trace Report action |
Input Example
{"parameters":{"$format":"json","$orderby":"Received desc","$select":"MessageId","$filter":"MessageTraceId eq (guid'98b131b3-267a-4366-c6e8-08dcb5d09c09')"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
d | object | Output field: d |
d.results | array | Result of the operation |
d.results.__metadata | object | Response data |
d.results.__metadata.id | string | Response data |
d.results.__metadata.uri | string | Response data |
d.results.__metadata.type | string | Response data |
d.results.Organization | string | Result of the operation |
d.results.MessageId | string | Unique identifier |
d.results.Received | string | Result of the operation |
d.results.SenderAddress | string | Result of the operation |
d.results.RecipientAddress | string | Result of the operation |
d.results.Subject | string | Result of the operation |
d.results.Status | string | Status value |
d.results.ToIP | object | Result of the operation |
d.results.FromIP | string | Result of the operation |
d.results.Size | number | Result of the operation |
d.results.MessageTraceId | string | Unique identifier |
d.results.StartDate | string | Result of the operation |
d.results.EndDate | string | Result of the operation |
d.results.Index | number | Result of the operation |
Output Example
{"status_code":200,"response_headers":{"Cache-Control":"no-cache, no-store","Content-Length":"788","Content-Type":"application/json;odata=verbose;charset=utf-8","Server":"Microsoft-IIS/10.0","request-id":"2cf9be82-5112-b143-24d7-fe3e1df355d7","X-CalculatedBETarget":"DM4PR14MB4896.namprd14.PROD.OUTLOOK.COM","X-BackEndHttpStatus":"200","X-RUM-Validated":"1","X-RUM-NotUpdateQueriedPath":"1","X-RUM-NotUpdateQueriedDbCopy":"1","x-ms-appId":"95d971d3-07b0-4eda-9e7e-c72ffae8ede2","Restrict-Access-Confi...
Retrieve Content
Retrieve a content blob from Microsoft Office 365 using organization and content IDs, returning the data in JSON format.
Endpoint
- URL: api/v1.0/{{organizationId}}/activity/feed/audit/{{contentId}}
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.organizationId | string | Required | The Organization ID. |
path_parameters.contentId | string | Required | An opaque string that uniquely identifies the content. |
Input Example
{"path_parameters":{"organizationId":"41463f53-8812-40f4-890f-865bf6e35190","contentId":"492638008028$492638008028$f28ab78ad40140608012736e373933ebspo2015043022$4a81a7c326fc4aed89c62e6039ab833b$04"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
Output Example
{"status_code":200,"response_headers":{"Cache-Control":"no-cache, no-store","Content-Length":"788","Content-Type":"application/json;odata=verbose;charset=utf-8","Server":"Microsoft-IIS/10.0","request-id":"2cf9be82-5112-b143-24d7-fe3e1df355d7","X-CalculatedBETarget":"DM4PR14MB4896.namprd14.PROD.OUTLOOK.COM","X-BackEndHttpStatus":"200","X-RUM-Validated":"1","X-RUM-NotUpdateQueriedPath":"1","X-RUM-NotUpdateQueriedDbCopy":"1","x-ms-appId":"95d971d3-07b0-4eda-9e7e-c72ffae8ede2","Restrict-Access-Confi...
Start Subscription
Initiate a subscription to a specified content type in Microsoft Office 365 using the required contentType and PublisherIdentifier parameters.
Endpoint
- URL: /subscriptions/start
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.contentType | string | Required | Must be a valid Content Type. |
parameters.PublisherIdentifier | string | Required | Tenant GUID of the Vendor Coding. |
webhook | object | Optional | Webhook Properties for Notifications. |
webhook.address | string | Optional | HTTPS Endpoint for receiving Notifications. |
webhook.authId | string | Optional | string that will be included as the WebHook-AuthID header in notifications sent to the webhook as a means of identifying and authorizing the source of the request to the webhook. |
webhook.expiration | string | Optional | Datetime after which Notifications stop. |
Input Example
{"parameters":{"contentType":"Audit.SharePoint","PublisherIdentifier":"46b472a7-c68e-4adf-8ade-3db49497518e"},"json_body":{"webhook":{"address":"https://webhook.myapp.com/o365/","authId":"o365activityapinotification","expiration":""}}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
contentType | string | Type of the resource |
status | string | Status value |
webhook | object | Output field: webhook |
webhook.status | string | Status value |
webhook.address | string | Output field: webhook.address |
webhook.authId | string | Unique identifier |
webhook.expiration | object | Output field: webhook.expiration |
Output Example
{"status_code":200,"response_headers":{"Cache-Control":"no-cache, no-store","Content-Length":788,"Content-Type":"application/json;odata=verbose;charset=utf-8","Server":"Microsoft-IIS/10.0","request-id":"2cf9be82-5112-b143-24d7-fe3e1df355d7","X-CalculatedBETarget":"DM4PR14MB4896.namprd14.PROD.OUTLOOK.COM","X-BackEndHttpStatus":"200","X-RUM-Validated":"1","X-RUM-NotUpdateQueriedPath":"1","X-RUM-NotUpdateQueriedDbCopy":"1","x-ms-appId":"95d971d3-07b0-4eda-9e7e-c72ffae8ede2","Restrict-Access-Confirm...
Stop Subscription
Terminate an active subscription for a specified content type in Microsoft Office 365 using PublisherIdentifier and contentType.
Endpoint
- URL: /subscriptions/stop
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.PublisherIdentifier | string | Required | Tenant GUID of the Vendor Coding. |
parameters.contentType | string | Required | Must be a valid Content Type. |
Input Example
{"parameters":{"PublisherIdentifier":"46b472a7-c68e-4adf-8ade-3db49497518e","contentType":"Audit.SharePoint"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
Output Example
{"status_code":200,"response_headers":{"Cache-Control":"no-cache, no-store","Content-Length":788,"Content-Type":"application/json;odata=verbose;charset=utf-8","Server":"Microsoft-IIS/10.0","request-id":"2cf9be82-5112-b143-24d7-fe3e1df355d7","X-CalculatedBETarget":"DM4PR14MB4896.namprd14.PROD.OUTLOOK.COM","X-BackEndHttpStatus":"200","X-RUM-Validated":"1","X-RUM-NotUpdateQueriedPath":"1","X-RUM-NotUpdateQueriedDbCopy":"1","x-ms-appId":"95d971d3-07b0-4eda-9e7e-c72ffae8ede2","Restrict-Access-Confirm...
Response Headers
Header | Description | Example |
|---|---|---|
Alt-Svc | HTTP response header: Alt-Svc | h3=:443;ma=2592000,h3-29=:443;ma=2592000 |
Cache-Control | Directives for caching mechanisms | no-cache, no-store |
Content-Length | The length of the response body in bytes | 788 |
Content-Type | The media type of the resource | application/json;odata=verbose;charset=utf-8 |
DataServiceVersion | HTTP response header: DataServiceVersion | 2.0; |
Date | The date and time at which the message was originated | Tue, 06 Aug 2024 10: 35: 53 GMT |
request-id | HTTP response header: request-id | 2cf9be82-5112-b143-24d7-fe3e1df355d7 |
Restrict-Access-Confirm | HTTP response header: Restrict-Access-Confirm | 1 |
Server | Information about the software used by the origin server | Microsoft-IIS/10.0 |
X-AspNet-Version | HTTP response header: X-AspNet-Version | 4.0.30319 |
X-BackEndHttpStatus | HTTP response header: X-BackEndHttpStatus | 200 |
X-BEServer | HTTP response header: X-BEServer | DM4PR14MB4896 |
X-CalculatedBETarget | HTTP response header: X-CalculatedBETarget | DM4PR14MB4896.namprd14.PROD.OUTLOOK.COM |
X-Content-Type-Options | HTTP response header: X-Content-Type-Options | nosniff |
X-DiagInfo | HTTP response header: X-DiagInfo | DM4PR14MB4896 |
X-FEEFZInfo | HTTP response header: X-FEEFZInfo | MAA |
X-FEProxyInfo | HTTP response header: X-FEProxyInfo | MA1PR01CA0171.INDPRD01.PROD.OUTLOOK.COM |
X-FEServer | HTTP response header: X-FEServer | MA1PR01CA0171 |
X-FirstHopCafeEFZ | HTTP response header: X-FirstHopCafeEFZ | MAA |
x-ms-appId | HTTP response header: x-ms-appId | 95d971d3-07b0-4eda-9e7e-c72ffae8ede2 |
X-Powered-By | HTTP response header: X-Powered-By | ASP.NET |
X-Proxy-BackendServerStatus | HTTP response header: X-Proxy-BackendServerStatus | 200 |
X-Proxy-RoutingCorrectness | HTTP response header: X-Proxy-RoutingCorrectness | 1 |
X-RUM-NotUpdateQueriedDbCopy | HTTP response header: X-RUM-NotUpdateQueriedDbCopy | 1 |
X-RUM-NotUpdateQueriedPath | HTTP response header: X-RUM-NotUpdateQueriedPath | 1 |
X-RUM-Validated | HTTP response header: X-RUM-Validated | 1 |
X-RWS-Version | HTTP response header: X-RWS-Version | 2013-V1 |
X-UA-Compatible | HTTP response header: X-UA-Compatible | IE=10 |