Use Tanium Connect to Send Microsoft Office 365 Emails using Modern Authentication
Overview
This article walks through the configuration required in the Tanium console and Azure to allow users to send emails from their Tanium instance using Office 365 using modern authentication.
To see a video demo of this process refer to the video demo at the end of the article.
Prerequisites to Create Email Profiles within Tanium for Office 365
On-Prem Tanium Solution Requirements
-
Platform – 7.4.6.1114+, 7.5.5+
-
RDB - 1.0.84+
-
SUS - 1.0.192+
-
Email – 1.0+
-
Connect - 5.16+
-
Secrets - 1.0.118+
Network Requirements
If necessary, add a firewall/proxy exclusion for the Tanium instance to allow communication with Microsoft. Tanium Connect supports the following destination in the initial release of the Office 365 Email destination. For additional destinations, please contact support.
-
Host: graph.microsoft.com for Port: 443
-
Host: login.microsoftonline.com for Port: 443
-
Host: outlook.office.com for Port: 443 (When sending data over 3MB)
-
Host: outlook.office365.com for Port: 443 (When sending data over 3MB)
Tanium Cloud users can create their own exclusions within their Cloud Management Portal. See Configuring network egress allow list rules in the CMP.
Tanium RBAC Permissions
To create Email Profiles within Connect, a Tanium user needs appropriate permissions to modify the Email Destination Settings page. Tanium users need permission to create Connections and to access the Content Set that is used in an Email Profile when creating Connections for the Email (Office 365) Destination.
Azure Requirements
Determine an Azure user that you can use as a service account to send emails. The user needs a mailbox and a valid license assigned within Azure. This user will be the sender of all emails in a Connect Email Profile configuration.
An Azure user/administrator needs permissions to perform the following actions as well as collect the following pieces of data:
-
Can register an application with the Microsoft Identity platform within the Azure portal.
-
Can create and collect a Client Secret for the registered Application.
-
Collect the Tenant ID and Client ID for the registered Application.
-
Collect the Email/Object ID of the user that will be sending emails. (The “From User”)
This article describes how to obtain this data if it is not readily available.
OAuth Email Architecture Diagram
Below is a diagram of the architecture depicting how the Email (Office 365) Destination interacts with the other services involved.
Office 365 Configuration
Registering an Application with the Microsoft Identify Provider
See Register an application with the Microsoft identity platform for prerequisites and steps to register an Application with the Microsoft Identify Provider. Below is an outline on creating and registering an application. This example is used in later steps for reference.
Within Azure Active Directory, under Manage, navigate to App Registrations.
Select New Registration to register a new Application.
Appropriately fill in the fields to register the Application. In this example the Application name is TaniumEmailApp.
Collecting the Tenant ID and Client ID for your Tanium Email Configuration
You can collect the Tenant ID and Client ID from within the Overview tab of the newly registered Application as seen in the example below.
Granting Appropriate Permissions to the Application
With the Application now registered with the Microsoft Identify Provider, the Application needs appropriate permissions assigned to successfully send emails.
Navigate to Registered Apps within the App Registrations tab of Azure Active Directory and select the Application to use.
Select API Permissions from the side bar.
Select Add a permission.
Select Microsoft Graph.
Select Application Permissions.
Select Mail.Send (Send mail as any user). This permission allows emails to be sent.
To send emails greater than 3MB and up to 150MB, assign the Mail.ReadWrite (Read and write mail in all mailboxes) permission. Select Add permissions.
Additional permission restrictions are recommended in Exchange Online mailboxes to limit the user to a Service Account only. Create an application access policy as defined in Limiting application permissions to specific Exchange Online mailboxes.
Select Grant admin consent for MSFT.
Status should now show as Granted for MSFT.
Add a Client Secret
Navigate to Registered Apps within the App Registrations tab of Azure Active Directory and select the Application that has the appropriate permissions added to it.
Click Add a certificate or secret next to Client credentials or select Certificates & secrets in the sidebar to generate the client secret.
Select Client secrets and New client secret.
Enter a name for the secret within the Description field and select Add. When this Client Secret expires, you will need to create a new Client Secret and update it within the corresponding Tanium Email Profile.
Select an appropriate expiration period as determined by your Company’s policy.
After you create the Client Secret, note the data under Value for the Client Secret. This Value is used in the Client Secret field of the Tanium Email Profile configuration.
Determining the Principal Name and ID of a User
Navigate to All Users within Azure and select the appropriate user that will be used to send Email from Tanium Connect.
Either the User principal name (such as Nick.Sxxxx@xxxxx.onmicrosoft.com), or the Object ID (a UUID). Either can be used to populate the From User (Principal Name or ID) field within the Tanium Connect Email Profile configuration.
Creating an Email Profile Walkthrough
To configure an Email profile for OAuth with Office 365 within Connect, select the gear icon in the top right corner of the Connect Overview page.
Click Create Email Profile.
Enter an easily recognizable name for this Email Profile configuration which will be selected later when configuring a Connections Office 365 Destination.
The Tenant ID, Client ID, Client Secret, and From User fields can be populated with the information obtained in earlier steps. Keep in mind that the From User, either a Principal Name or Object ID, will be the email address that recipients see. The selected Content Set allows users that have access to the specified content set to use the associated Email Profile when creating Connections.
Ensure to use the Send a Test Email field and the Send Test Email button to confirm that the email profile configuration is correct. Once a successful test has been performed, you can click Create to finish creating the Email Profile.
Connect Connections can now be created and run using the Email (Office 365) Destination with an Email Profile that has been configured and successfully tested.
Example Connection Configuration for Email(Office 365) - Connection using Reports HTML exports to Office 365 Email
This section can be used as a reference for building a Connection using the Email (Office 365) Destination.
In this example, a Connection is created using the newly created Email Profile. This Connection is configured to send a Reporting Dashboard as an HTML attachment to a list of email addresses.
-
From the Connect Overview page click Create Connection to start creating a new Connection.
-
Within the General Information section of the Connection creation page enter an appropriate name for the Connection as well as a description if needed.
-
Within the left side of the Configuration section of the Connection creation page select Tanium Reporting (Reports and Dashboards) from the Source selection dropdown. Ensure the Export Format dropdown has HTML selected.
-
From the Type dropdown select Dashboard. From the Dashboard dropdown, select the Dashboard that should be sent to the Email destination.
-
On the right side of the Configuration section, select Email (Office 365) from the Destination dropdown.
-
Enter an appropriate name for this specific Destination configuration in the Destination Name field.
-
From the Email Server Profile dropdown, select the newly created Email Profile. After selecting the Email Profile, the From User field should display the Principal Name that was entered when creating the selected Email Profile. This user in the From User field will be the sender of all emails for Connections which use thus Email Profile.
-
Update the Subject field as necessary.
*See Reference: Variables for a list of Connect variables such as , as seen in the screen below.
*See Creating, copying, and using destination templates with Connect 5.9 for details on the usage of New, Existing, and Copy Settings for Destination Templates.
-
Enter the intended email recipients of this Dashboard into the To Addresses, Cc Addresses, and Bcc Addresses fields as appropriate. The entries in these fields should be comma delimited.
-
Select the Attachment checkbox to send the data as a file which will be attached to the email. If the checkbox is not selected the data will be sent in the body of the email.
-
With the Attachment checkbox selected, the Body field is visible. The Body field is a new field that allows users to add content to the body of the email when sending an attachment.
-
Enter a body for this Destination configuration as appropriate. Enter a Filename as well as the extension for the file that will be sent. The Filename Timestamp Format can be configured to help with determining when a specific file was generated.
-
Select a compression method from the Compression Method dropdown if necessary.
-
Populate the Configure Output section of the Connection creation page as necessary.
-
If this Connection should run on a schedule, select Enable Schedule checkbox within the Schedule section of the page. A schedule could be defined to run the Connection daily, weekly, monthly, etc. Once a schedule has been defined, if a schedule is needed, select either Save or Save and Run. Save and Run runs this newly created Connection immediately. When selecting the Save button, the Connection will either wait until the next scheduled interval to run or wait for a manual run depending on if a schedule is defined.