NOTES FROM THE FIELD:
I have recently been consulting on, what I think is a pretty cool engagement to integrate some Office365 mailbox data into the Splunk reporting platform.
I initially thought about using a .csv export methodology however through trial & error (more error than trial if I’m being honest), and realising that this method still required some manual interaction, I decided to embark on finding a fully automated solution.
The final solution comprises the below components:
- Splunk HTTP event collector
- Splunk hostname
- Token from HTTP event collector config page
- Azure automation account
- Azure Run As Account
- Azure Runbook
- Exchange Online credentials (registered to Azure automation account
I’m not going to run through the creation of the automation account, or required credentials as these had already been created, however there is a great guide to configuring the solution I have used for this customer at https://www.splunk.com/blog/2017/10/05/splunking-microsoft-cloud-data-part-3.html
What the PowerShell script we are using will achieve is the following:
- Connect to Azure and Exchange Online – Azure run as account authentication
- Configure variables for connection to Splunk HTTP event collector
- Collect mailbox data from the Exchange Online environment
- Split the mailbox data into parts for faster processing
- Specify SSL/TLS protocol settings for self-signed cert in test environment
- Create a JSON object to be posted to the Splunk environment
- HTTP POST the data directly to Splunk
The Code:
The final output that can be seen in Splunk looks like the following:
11/13/17 12:28:22.000 PM |
{ [-] AddressBookPolicy: DisplayName: Shane Fisher ForwardingSmtpAddress: GrantSendOnBehalfTo: IsMailboxEnabled: True PrimarySMTPAddress: shane.fisher@xxxxxxxx.com.au ProhibitSendReceiveQuota: 50 GB (53,687,091,200 bytes) Time: 11/13/2017 12:28:22 }Show as raw text· AddressBookPolicy = · DisplayName = Shane Fisher · ForwardingSmtpAddress = · GrantSendOnBehalfTo = · IsMailboxEnabled = True · PrimarySMTPAddress = shane.fisher@xxxxxxxx.com.au · ProhibitSendReceiveQuota = 50 GB (53,687,091,200 bytes) |
I hope this helps some of you out there.
Cheers,
Shane.