How-To: O365 Event Ingest into LogScale via Microsoft Graph (using pre-defined CrowdStream O365 Activity/Services)

Multiple types and sets of information can be pulled from Microsoft depending on the options configured and the permissions granted to the application/assigned user used to access Microsoft data.

You can use one of our integration options like packages to ingest and parse Microsoft data, see Microsoft Corporation for more information.

CrowdStream / Cribl Stream supports receiving multiple types of Microsoft data, depending on which data type and option selected:

  • Office 365 Activity

    The Office 365 Management Activity API facilitates analyzing actions and events on Azure Active Directory, Exchange, and SharePoint, along with global auditing and Data Loss Prevention data.

    For more information, see https://docs.cribl.io/stream/sources-office-365-activity/

    In Azure Active Directory, the application representing your Cribl Stream instance must be granted the following permissions to pull data. Each permission's Type must be Application - Delegated is not sufficient:

    • ActivityFeed.Read — Required for all Content Types except DLP.All.

    • ActivityFeed.ReadDlp — Required for the DLP.All Content Type.

  • Office 365 Services

    The Microsoft Graph service communications API facilitates analyzing the status and history of service incidents on multiple Microsoft cloud services, along with associated incident and Message Center communications. For details, see Microsoft's Overview of the Graph API.

    For more information, see https://docs.cribl.io/stream/sources-office-365-services/

    In Azure Active Directory, the application representing your Cribl Stream instance must be granted the following permissions to pull data. (The permission Type for both must be Application; Delegated is not sufficient:)

    • ServiceHealth.Read.All

    • ServiceMessage.Read.All

  • Office 365 Message Trace

    Not covered in this walkthrough

    This mail-flow metadata can be used to detect and report on malicious activity including bulk emails, spoofed-domain emails, and data exfiltration.

    For more information, see https://docs.cribl.io/stream/sources-office365-msg-trace/

    At a minimum, your Office 365 service account should include a role with Message Tracking and View Only Recipients permissions, assigned to the Office 365 user that will integrate with Cribl Stream. Assign these permissions in the Exchange admin center (https://admin.exchange.microsoft.com).

Overview for Collecting O365 Data into LogScale

Register Microsoft application, generate secret, and add permissions

Note

The Client Secret received from Microsoft Azure AD requires periodic rotation according to the expiration duration that you select.

  1. Add permissions for Microsoft Azure AD

  2. Add permissions for Microsoft Defender for O365

  3. For LogScale use case, kick-off Microsoft Content Subscription (CrowdStream/Cribl pre-req to be done in Microsoft via PowerShell or curl command)

  4. Verify successful data connection via CrowdStream / CriblStream

  5. Verify successful data ingest in LogScale

Step-by-Step Config (example for use with CrowdStream)

Create and Register a new app
  1. Login to portal.azure.com

  2. Select Microsoft Entra ID on the left dropdown

  3. Select App registrations

  4. Click on New registration

  5. Provide a name and leave the rest as default

  6. Click the Register button at the bottom of the page

  7. Navigate to overview and copy the Application (client) ID:

  8. Select Endpoints and copy the OAuth 2.0 token:

Provide the appropriate API permissions
  1. Once it is created, navigate to API permissions

  2. Click on Microsoft Graph

  3. You should see an additional panel to allow for selection of permissions

    Note that there are 2 types of permissions, Delegated and Application.

  4. For the purpose of pulling audit logs, ensure you select Application Permissions

  5. For Microsoft Azure AD permissions, search for audit and you should see it appear.

    Click the Application permissions checkbox (Delegated is not sufficient per Cribl)

    Select the checkbox for AuditLog.Read.All

  6. For Microsoft Defender for O365, repeat the steps above for additional security events such as:

    • SecurityEvents.Read.All

    • SecurityAlert.Read.All

    • SecurityIncident.Read.All

  7. For permissions related to the data collection outlined in CrowdStream docs (across MS Activity, Services, Trace), the following additional permissions can be added:

    Office 365 Activity

    The Office 365 Management Activity API facilitates analyzing actions and events on Azure Active Directory, Exchange, and SharePoint, along with global auditing and Data Loss Prevention data.

    For more information, see https://docs.cribl.io/stream/sources-office-365-activity/

    In Azure Active Directory, the application representing your Cribl Stream instance must be granted the following permissions to pull data. Each permission's Type must be Application - Delegated is not sufficient:

    • ActivityFeed.Read - Required for all Content Types except DLP.All.

    • ActivityFeed.ReadDlp - Required for the DLP.All Content Type.

    Office 365 Services

    • The Microsoft Graph service communications API facilitates analyzing the status and history of service incidents on multiple Microsoft cloud services, along with associated incident and Message Center communications. For details, see Microsoft's Overview of the Graph API.

      For more information, seehttps://docs.cribl.io/stream/sources-office-365-services/

      In Azure Active Directory, the application representing your Cribl Stream instance must be granted the following permissions to pull data. (The permission Type for both must be Application - Delegated is not sufficient:)

      • ServiceHealth.Read.All

      • ServiceMessage.Read.All

  8. Office 365 Message Trace not covered in this walkthrough

    This mail-flow metadata can be used to detect and report on malicious activity including bulk emails, spoofed-domain emails, and data exfiltration.

    For more information, see https://docs.cribl.io/stream/sources-office365-msg-trace/

    At a minimum, your Office 365 service account should include a role with Message Tracking and View Only Recipients permissions, assigned to the Office 365 user that will integrate with Cribl Stream. Assign these permissions in the Exchange admin center (https://admin.exchange.microsoft.com).

    Location for Activity / Services permissions:

    • Under Microsoft Graph (for O365 Services info) - Service options need to be permission type Application - Delegated is not sufficient

      • ServiceHealth.Read.All

      • ServiceMessage.Read.All

      • User.Read

    • Under Office 365 Management APIs (for O365 Activity) - all need to be permission type Application - Delegated is not sufficient

      • ActivityFeed.Read

      • ActivityFeed.ReadDlp

      • ServiceHealth.Read

  9. Click Update permissions button at bottom of the page

  10. You should now have the same setup as below with a status that the permission is Not granted

  11. Select Grant admin consent for Default Directory (your customer/prospect name may show up vs. Default Directory to grant consent

Example Applied Permissions for the App

Depending on the specific data to be collected, permissions for the new app will vary

In this example, permissions across both LogScale XDR pre-reqs as well as Cribl pre-reqs have been combined

Create API key to allow LogScale to access the logs
  1. Navigate to Certificates & Secrets and create a new client secret

  2. Click New client secret

  3. Provide a description and expiry date for the API key

  4. Click the Add button at the bottom of the page

  5. Copy this value (immediately) as you will only see it once

Define / Configure Sources for O365 in CrowdStream

To access the list of O365 Source Options:

  1. Log in to your CrowdStream / Cribl instance

    For example, this can be a CrowdStream instance at a customer / POV, or it can be a Cribl eval instance you signed up for (both behave the same)

  2. From the main CrowdStream / CriblStream page, click on Manage Stream

  3. Click on the Worker Group which will be used

    Typically in a POV / initial setup, the Worker Group will be called default

  4. Click DataSources

  5. In the upper-right of the screen, click in the Filter Sources field and search for 365

    In a net-new setup, three results should display:

For this walk-through, the permissions set earlier in this doc (here) cover Office 365 Services and Office 365 Activity

The same app created in this doc (which has both sets of permissions needed) can be used with two different sources

Creating O365 Activity Source

To configure the O365 Activity Source:

  1. After filtering on 365 for sources, click on the Office 365 Activity tile

  2. In the upper-right of the page, click on "Add Source"

  3. In the General Settings section, fill in the following values for the new source:

    • Input ID

      Can be anything you want - just the name for the source in CrowdStream / CriblStream

      For example: o365_activity_internal_lab

    • Tenant ID

      The Office 365 Azure Microsoft tenant ID for your environment

    • App ID

      The Office 365 Azure Application ID for the newly created Microsoft app

    • Subscription plan

      By default, using Office 365 Enterprise

    • Authentication method

      Leave the default of Manual

    • Client secret

      Include the client secret value (not the Client secret ID) that was created in the earlier setup process (link here)

  4. In the Content Types section at the bottom of the page, click the Enabled slider depending on the types of data to be collected

  5. Click on the Connected Destinations link at the bottom of the left nav panel

  6. Click the QuickConnect option (from the default of Send to Routes)

    For this walkthrough, we're passing data directly from the O365 pull to the LogScale destination:

    1. When prompted about the change, click Yes

    2. Click Save; the Status widget should display

    3. After saving the new change, in the upper-right part of page, click Commit & Deploy to deploy the new configuration

    4. Add a comment for the update

    5. Click Commit and Deploy in the lower-right part of the popup

Enabling Microsoft Subscription to Generate Data the Activity Source Can Access

Note

The App Subscription kick-off is a requirement to start collection of data (O365 Activity) by CrowdStream/CriblStream

From Cribl documentation: https://docs.cribl.io/stream/sources-office-365-activity/#start-subscriptions

  • Content subscriptions (a different concept from the O365 subscription plans) are required in order for Cribl Stream / CrowdStream to be able to begin retrieving O365 data

  • There is a separate subscription required for each Content Type. If you are using an existing Azure-registered application ID that already has subscriptions started, then you can ignore this section. But if you are:

    • Using a newly registered application ID, and therefore never had any subscriptions started, or

    • Reusing an application ID that had subscriptions started, but are currently stopped

  • Then you will need to use this procedure to manually start the necessary subscriptions. Follow either of the two methods below, using (respectively) PowerShell or curl.

For example, the following content subscriptions are called out in the Cribl docs relative to collecting Microsoft Office 365 Activity logs

  • Audit.AzureActiveDirectory

  • Audit.Exchange

  • Audit.SharePoint

  • Audit.General

  • DLP.All

Browse to a Windows host that can call PowerShell commands

From the Cribl page, https://docs.cribl.io/stream/sources-office-365-activity/#start-subscriptions, create and run a PowerShell script file using the provided content that includes the contents / keys for the PowerShell script

On the Windows host:

  1. Browse to the following url: https://docs.cribl.io/stream/sources-office-365-activity/#start-subscriptions

  2. Copy the sample PowerShell script listed in the Using PowerShell section on the page

  3. Open notepad.exe and paste in the sample PowerShell script contents

  4. At the top of the file, replace the following placeholder values for actual values from your environment / newly-created app:

    • $AppID

    • $ClientSecret

    • $TenantID

  5. Save the PowerShell script. For example, as c:\temp\o365_subscriptions.ps1 ( the script must have ps1 as the file extension).

  6. Run the PowerShell script

    From cmd window, type: powershell

    The prompt will update to reflect the change into PowerShell

    Run the script using fully-qualified path

    For example

    powershell
    c:\temp\o365_subscriptions.ps1

    The status changes are displayed in the CMD window as commands are run

Creating O365 Services Source

After filtering on 365 for sources, click on the Office 365 Services tile

  1. In the upper-right of the page, click on Add Source

  2. Fill in the following values for the new source

    • Input ID

      Can be anything you want - just the name for the source in CrowdStream / CriblStream

      For example: o365_services_internal_lab

    • Tenant ID

      The Office 365 Azure Microsoft tenant ID for your environment

    • App ID

      The Office 365 Azure Application ID for the newly created Microsoft app

    • Subscription plan

      By default, using Office 365 Enterprise

    • Authentication method

      Left the default of Manual

    • Client secret

      Include the client secret value (not the Client secret ID) that was created in the earlier setup process (link here)

  3. In the Content Types section at the bottom of the page:

    Click the Enabled slider depending on the types of data to be collected

    Set the Interval time (default = 15 minutes)

  4. Click on the Connected Destinations link at the bottom of the left nav panel

  5. Click the QuickConnect option (from the default of Send to Routes)

    For this walkthrough, we're passing data directly from the O365 pull to the LogScale destination

    When prompted about the change, click Yes

  6. Click Save

    After saving the new change, in the upper-right part of page, click Commit & Deploy to deploy the new configuration

    Add a comment for the update

  7. Click Commit and Deploy in the lower-right part of the popup

O365 Message Trace Source

Because O365 Message Trace requires additional setup permissions (link here), the Message Trace Source is not configured in this example

From the Cribl O365 Message Trace page:

At a minimum, your Office 365 service account should include a role with Message Tracking and View Only Recipients permissions, assigned to the Office 365 user that will integrate with Cribl Stream. Assign these permissions in the Exchange admin center (https://admin.exchange.microsoft.com).

Check the Status of Each Source

From the main CrowdStream / CriblStream page, click on DataSources:

  1. A list of available Push / Pull sources is displayed

  2. To refine down list, click on the Pull filter on left and click on the Configured only slider on the right

  3. Once connections configured, if any connection shows a status issue (red for errors, orange for warnings or indicates you had red, even if green now, green for status good), click on the tile that shows the error condition

    For example, in this case, the Office 365 Services connection is reporting an error

    1. From the row(s) that display, click on the row that shows the error

    2. At the top of the page, click on the Job Inspector link

    3. In the job listings that display, click on any of the rows showing an error

    4. In the top of the page, click on Task Errors

    5. Expand and review any errors listed to determine the root cause of the issue

      For example, in this case, 403 HTTP errors are listed (The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it.)

Define / Configure LogScale Destination in CrowdStream

Step-by-step example of setting up a CrowdStream Destination (with a pointer to LogScale repository) available How-To: How to Configure CrowdStream LogScale Destination.

Connect the CrowdStream O365 Source(s) to a LogScale Destination

Add the New O365 Activity Source to the Source Side

  1. Log in to your CrowdStream / Cribl instance

    For example, this can be a CrowdStream instance at a customer / POV, or it can be a Cribl eval instance you signed up for (both behave the same)

  2. From the main CrowdStream / CriblStream page, click on Manage Stream

  3. Click on the Worker Group which will be used

    Typically in a POV / initial setup, the Worker Group will be called default

  4. Click on the Overview link (upper-left) to see the UI reference to QuickConnect

  5. Click on the Quick Connect widget to display the QuickConnect page

  6. Click on the Add Source box on left

    A list of available Push / Pull sources is displayed

    To refine down list, click on the Pull filter on left and click on the Configured only slider on the right

  7. Click on the Office 365 Services tile, and select Select Existing

  8. Click on the existing configured source (anywhere in the row)

    When prompted about switching to QuickConnect from Routes, click Yes

  9. Click Add Source again and repeat the process with the Office 365 Activity tile

Connect the Entries from the Sources side to the LogScale Destination
  1. Click and hold on the + symbol on the right side of each source, and drag a line over to the CrowdStrike Falcon LogScale entry on the Destination side

  2. When prompted for the type of connection configuration, leave Passthru selected, and click Save

  3. Repeat process for the other O365 source

  4. When all changes complete, in the upper-right corner, click on Commit & Deploy to deploy the changes

    Click Commit and Deploy in the lower-right of the widget

    As changes are being updated to the CrowdStream / CriblStream cluster, the status of the cluster will show as yellow in the upper right of the page

    Once the changes have been committed and applied and all services update, the status of the workers will change to green