Microsoft Graph

Prev Next

70c9349-microsoft

💡Before you start

To complete these steps you’ll need an Azure admin user.

Overview

The Microsoft Graph API provides a single endpoint to access data and interact with Microsoft 365 services like Azure Active Directory, Teams, Outlook, and OneDrive. It uses RESTful calls to manage resources such as users, groups, messages, and files. The API simplifies integration with Microsoft services, enabling developers to build applications that work across the Microsoft ecosystem.

Supported data types

Activity Logs

Table namemicrosoft_graph_activity_logs

Microsoft Graph Activity Logs provide a centralized, programmatic means to access activity data across Microsoft 365 services, including Azure Active Directory, Microsoft Teams, SharePoint, and other key applications. By leveraging the Microsoft Graph API, organizations can integrate these logs into their security and monitoring systems, enabling comprehensive insights into system activities and user interactions.

By integrating Microsoft Graph Activity Logs, organizations can gain deeper visibility into their Microsoft 365 environments, enhancing security incident detection, streamlining compliance reporting, and ensuring a comprehensive view of activity across services.

Send data to Hunters

Hunters supports the ingestion of Microsoft Graph Activity logs via an Event Hub or via an intermediary AWS S3 bucket.

Event Hub connection

STEP 1: Set up Azure Event Hub

Before setting up the connection on the Hunters platform, you'll need to set up and create an Azure Event Hub.

Follow this guide to complete the set up.

STEP 2: Route logs to the Event Hub

  1. From the Azure portal home screen, open the side menu and click Monitor.
    Entra ID - Monitor

  2. Now click Activity log.
    Entra ID.Monitor.Activity Log

  3. Click Export Activity Logs.
    Entra ID.Monitor.Activity Log.Export The Diagnostic Settings page opens.

  4. Click Add Diagnostic setting.
    Entra ID.Monitor.Activity Log.Export.Add diagnostic

  5. Under Logs, check all of the boxes.

  6. Under Destination details, check the Stream to an Event Hub option.

  7. Fill in the requested details and give the diagnostic setting a name.

    Activity log.Diagnostic Settings. Event Hub

  8. Click Save.

STEP 3: Set up the connection on Hunters

💡Before you start

To complete this process you will need the information gathered when following this guide.

To connect logs to Hunters:

  1. Open the Hunters platform and navigate to Data > Data Sources.
    Data sources1

  2. Click ADD DATA SOURCES.
    Add data source4

  3. Locate the Microsoft panel and click Connect.
    The Add Data Flows window opens.

  4. Fill in the required Azure application details, as gathered here under STEP 2.
    Connect Azure logs on Hunters

  5. Under the Data Types section, activate the data types you want to connect.

  6. For each activated data type, fill in the required information, as gathered here:

    1. Under STEP 1 - Subscription ID

    2. Under STEP 3 - Resource group name and Event Hub namespace and

    3. Under STEP 4 - Event Hub name.

  7. OPTIONAL: Under the Consumer group field you can specify a specific Azure Event Hub consumer group, or leave this field empty to use the default consumer group.

  8. Click Test Connection to make sure everything was set up correctly.

  9. Once the connection is established, click Submit.

AWS S3 connection

STEP 1: Route logs to Azure Blob Storage

Before setting up the connection on the Hunters platform, you'll need to make sure your Azure logs are routed to your Azure Storage and then to an AWS S3 bucket.  

💡Note

You’ll need to create an Azure Storage Account before starting this process.

Follow this guide to configure the receiving of Microsoft Graph activity logs. This process consists of the following steps:

  1. Create an Azure Storage account

  2. Set up routing your logs to the storage account using diagnostic settings

⚠️Attention

When setting up diagnostic settings, under Destination details, select Archive to a storage account, and provide the details of your Azure Storage account.

STEP 2: Route logs from Azure Blob Storage to AWS S3

Use AWS DataSync, or any other tool at your disposal, to route logs from your Azure Blob storage to an AWS S3 bucket.

STEP 3: Finalize the connection on Hunters

Once the export is completed and the logs are collected to S3, follow the steps in this section.

Log samples

Logs are expected in JSON format.

{
  "time": "2024-11-05T02:00:49.4487014Z",
  "resourceId": "/TENANTS/asd-as-das-dasdasdasd/PROVIDERS/MICROSOFT.AADIAM",
  "operationName": "Microsoft Graph Activity",
  "operationVersion": "beta",
  "category": "MicrosoftGraphActivityLogs",
  "resultSignature": "200",
  "durationMs": "531549",
  "callerIpAddress": "1.2.3.4",
  "correlationId": "12412412-412412gaweg2354-23g523-g523g",
  "level": "Informational",
  "location": "East US",
  "properties": {
    "__UDI_RequiredFields_TenantId": "asd-as-das-dasdasdasd",
    "__UDI_RequiredFields_UniqueId": "123123-123123-12312312-231",
    "__UDI_RequiredFields_EventTime": 638663688490000000,
    "__UDI_RequiredFields_RegionScope": "NA",
    "timeGenerated": "2024-11-05T02:00:49.4487014Z",
    "location": "East US",
    "requestId": "12412412-412412gaweg2354-23g523-g523g",
    "operationId": "12412412-412412gaweg2354-23g523-g523g",
    "clientRequestId": "12412412-412412gaweg2354-23g523-g523g",
    "apiVersion": "beta",
    "requestMethod": "GET",
    "responseStatusCode": 200,
    "tenantId": "asd-as-das-dasdasdasd",
    "durationMs": 531549,
    "responseSizeBytes": 3059,
    "signInActivityId": "8bs8tv1gYU-d3tXQjaw_AA",
    "roles": "roles",
    "appId": "g124g124g12-412g412g412h3456h-54j6745j7-45j7",
    "UserPrincipalObjectID": "f3g24g5-23h5h3476h45-jdre7j5-7j4",
    "scopes": "",
    "identityProvider": "https://sts.windows.net/asd-as-das-dasdasdasd/",
    "clientAuthMethod": "2",
    "wids": "12412g-1234h456j45j7-45j745j745",
    "C_Idtyp": "app",
    "C_Iat": "1730689475",
    "ipAddress": "1.2.3.4",
    "userAgent": "",
    "requestUri": "https://graph.microsoft.com/beta/users/kfr89348awjf90a28fgjw34fg",
    "atContentP": "",
    "atContentH": "",
    "servicePrincipalId": "f3g24g5-23h5h3476h45-jdre7j5-7j4",
    "tokenIssuedAt": "2024-11-04T03:04:35.0000000Z"
  },
  "tenantId": "asd-as-das-dasdasdasd"
}