Getting Data In

Message Trace Ingestion Failing with 403 Forbidden Error

NightOwl2212
Observer

Hello,

I'm currently onboarding Microsoft Office 365 logs into Splunk using the Splunk Add-on for Microsoft Office 365 (Version 6.1.1).

All configured inputs are working as expected, except for Message Trace, which fails to ingest data and generates the following errors:

Skipping Ingestion because Message trace service principal is not provisioned.

403 Client Error: Forbidden for URL:
hxxps[://]graph[.]microsoft[.]com/v1[.]0/servicePrincipals

I have already configured and granted the required API permissions:

  • Microsoft Graph API (Application Permission): ExchangeMessageTrace.Read.All

  • Office 365 Exchange Online API (Application Permission): ReportingWebService.Read.All

However, the issue persists.

My questions:

  1. Has anyone encountered this issue with version 6.1.1 of the Splunk Add-on for Microsoft Office 365?

  2. Are there any additional API permissions, admin consent requirements, or service principal configurations needed beyond the permissions mentioned above?

  3. Is there a specific reason why the add-on fails to provision the Message Trace service principal and returns a 403 Forbidden response?

Any suggestions or guidance would be greatly appreciated.

Thanks in advance!

Labels (1)
0 Karma

SteelSPLke8
Splunk Employee
Splunk Employee

Hi @tscroggins  

Following your instructions, I created the O365 Message Trace input.

Initially, the input was showing the following error:

Skipping ingestion because Message Trace service principal is not provisioned.

After adding the following setting under the tenant configuration:

is_messagetrace_service_principal_provisioned = 1

the above error message disappeared. However, the input is still failing, even after granting the permissions you previously suggested.

Current error:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for URL:
https://graph.microsoft.com/v1.0/admin/exchange/tracing/messageTraces?$filter=receivedDateTime%20ge%202026-10-07T07:05:42.000Z%20and%20receivedDateTime%20le%202026-10-07T08:05:41.999Z&$top=5000

Could you please advise on any additional Microsoft Graph API permissions or Exchange Online roles that may be required for the Message Trace API? 

0 Karma

tscroggins
SplunkTrust
SplunkTrust

Hi @SteelSPLke8,

The fixes are mutually exclusive.

Either:

A. Grant the application identifier the permissions necessary to list and create servicePrincipals. The add-on will check if the servicePrincipal exists and create the servicePrincipal if it does not exist.

or

B. Provision the servicePrincipal outside Splunk using curl, PowerShell, or another tool and grant the application identifier the permissions necessary to list servicePrincipals. The add-on will check if the servicePrincipal exists and skip the create step.

or

C. Provision the servicePrincipal outside Splunk and set is_messagetrace_service_principal_provisioned = 1. The add-on will skip both the list and create steps.

All of the above are from my reading of the code. If I missed something, we can take another look.

0 Karma

tscroggins
SplunkTrust
SplunkTrust

Hi @NightOwl2212,

The endpoint permissions are documented at https://learn.microsoft.com/en-us/graph/api/serviceprincipal-list and https://learn.microsoft.com/en-us/graph/api/serviceprincipal-post-serviceprincipals.

For applications, it looks like Application.Read.All is required to list (GET) servicePrincipals, Application.ReadWrite.OwnedBy is required to create (POST) servicePrincipals.

You'll need both privileges if you want the add-on to provision a servicePrincipal on your behalf. You'll need Application.Read.All if an administrator has already provisioned a servicePrincipal for your application identifier.

Spunk documents "Message trace prerequisites" at https://splunk.github.io/splunk-add-on-for-microsoft-office-365/ConfigureAppinAzureAD/:

For Message Trace, also complete the Microsoft Graph prerequisites documented in exchangeMessageTrace prerequisites at https://learn.microsoft.com/en-us/graph/api/resources/exchangemessagetrace?view=graph-rest-1.0#prere.... The add-on can attempt prerequisites automatically when Application.ReadWrite.All is granted. If you do not want to grant that permission to the add-on app, complete those prerequisites manually.

However, I would use the least privileged guidance by having an administrator provision the application and then grant Application.Read.All to the application itself to allow the provisioning check to succeed.

When everything is working correctly, the add-on should log "Message Trace service principal is already provisioned."

 

0 Karma

tscroggins
SplunkTrust
SplunkTrust

Hi @NightOwl2212,

Alternatively, if you know the servicePrincipal has been provisioned, and you don't want to grant Application.Read.All to your application identifier, you can force the add-on to bypass the checks by adding the is_messagetrace_service_principal_provisioned setting to your splunk_ta_o365_tenants.conf tenant stanza:

# $SPUNK_HOME/etc/apps/splunk_ta_o365/local/splunk_ta_o365_tenants

[<my_tenant>]
# ...
is_messagetrace_service_principal_provisioned = 1

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Kubernetes Alerts That Work Out of the Box with AutoDetect detectors in Splunk ...

A deployment rolls out slowly, one pod sits not ready for a few minutes, and whoever is on call gets an alert ...

Observability at Your Fingertips Directly From Splunk Platform—for Free

At .conf, we announced our roadmap to bring observability foundations to Splunk Platform. Bringing metrics and ...