%3CLINGO-SUB%20id%3D%22lingo-sub-1848968%22%20slang%3D%22en-US%22%3EO365%20%26amp%3B%20AAD%20Multi-Tenant%20Custom%20Connector%20-%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1848968%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EOverview%20%26amp%3B%20Use%20Case%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThanks%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F293879%22%20target%3D%22_blank%22%3E%40Ofer_Shezaf%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Band%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185177%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%40Yaniv%20Shasha%3C%2FA%3E%3CSPAN%3E%26nbsp%3Bfor%20the%20brainstorming%2C%20contributing%20and%20proof%20reading!%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20multi-national%20organization%20having%20multiple%20branches%20with%20different%20identities%20across%20the%20globe%2C%20each%20branch%20have%20it's%20own%20separate%20tenant%20(AAD%20%26amp%3B%20O365)%20logs%20and%20the%20global%20SOC%20team%20are%20looking%20for%20a%20way%20on%20how%20to%20ingest%20these%20logs%20coming%20from%20all%20branches%20to%20their%20main%20parent%20tenant%20via%20Azure%20Sentinel.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20Azure%20Sentinel%20can%E2%80%99t%20natively%20do%20that%20using%20the%20out-of-the%20box%20data%20connectors%20(Office%20365%20%2F%20Azure%20AD)%2C%20we%20cover%20your%20back%20with%20O365%20%26amp%3B%20AAD%20Multi-Tenancy%20custom%20connector%20via%20an%20Azure%20Sentinel%20Playbook%20(Logic%20App)%20that%20invoke%20the%20Office%20365%20Management%20API%20%26amp%3B%20Graph%20API%20to%20read%20from%20multiple%20tenants%20and%20writes%20to%20a%20custom%20table%20in%20Sentinel%2C%20same%20can%20be%20done%20using%20Azure%20Function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EImplementation%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20help%20of%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice%2Foffice-365-management-api%2Foffice-365-management-activity-api-reference%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20365%20Management%20API%3C%2FA%3E%20%26amp%3B%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fazure-ad-auditlog-overview%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Graph%20API%3C%2FA%3E%20we%20can%20invoke%20specific%20content%20types%20cross-tenants%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20border%3D%221%22%20width%3D%2224.964639321074966%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2225%25%22%20height%3D%2230px%22%3EAPI%3C%2FTD%3E%0A%3CTD%20width%3D%2225%25%22%20height%3D%2230px%22%3EContent-Type%20%2F%20Activity%20Log%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2225%25%22%20height%3D%2284px%22%3EOffice%20365%20Management%20API%3C%2FTD%3E%0A%3CTD%20width%3D%2225%25%22%20height%3D%2284px%22%3E%3CSPAN%3EAudit.AzureActiveDirectory%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2230px%22%3EOffice%20365%20Management%20API%3C%2FTD%3E%0A%3CTD%20height%3D%2230px%22%3E%3CSPAN%3EAudit.Exchange%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2230px%22%3EOffice%20365%20Management%20API%3C%2FTD%3E%0A%3CTD%20height%3D%2230px%22%3E%3CSPAN%3EAudit.SharePoint%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%22111px%22%3EOffice%20365%20Management%20API%3C%2FTD%3E%0A%3CTD%20height%3D%22111px%22%3E%3CSPAN%3EAudit.General%20(includes%20all%20other%20workloads%20not%20included%20in%20the%20previous%20content%20types)%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2257px%22%3EOffice%20365%20Management%20API%3C%2FTD%3E%0A%3CTD%20height%3D%2257px%22%3E%3CSPAN%3EDLP.All%20(DLP%20events%20only%20for%20all%20workloads)%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EGraph%20API%3C%2FTD%3E%0A%3CTD%3E%3CSPAN%3Eaudit-Logs%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EGraph%20API%3C%2FTD%3E%0A%3CTD%3E%3CSPAN%3ESign-in%20Logs%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%2C%20tell%20us%20more%20about%20the%20steps%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAssuming%2C%20we%20have%20a%20parent%20tenant%20(Pt)%20%26amp%3B%20a%20child%20tenant%20(Ct)%20and%20the%20requirements%20is%20to%20invoke%20the%20%22Ct%22%20tenant%20O365%20Management%20API%20%26amp%3B%20Graph%20APIs%20to%20pull%20Office%20365%20%26amp%3B%20AAD%20logs%20and%20ingest%20at%20%22Pt%22%20ones.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep(1)%3A%20Prep%20%26amp%3B%20App%20Registration%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EEnsure%20that%20%22Ct%22%20Office%20365%20Security%20%26amp%3B%20Compliance%20audit%20logs%20is%20enabled%26nbsp%3B%3CUL%3E%0A%3CLI%3ELog%20in%20to%20%22Ct%22%20%3CA%20href%3D%22http%3A%2F%2Fprotection.office.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fprotection.office.com%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3ESearch%20%26gt%3B%20Audit%20Log%20search%20(enabled%20and%20be%20able%20to%20search%20for%20activities)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ELog%20in%20to%20%22Ct%22%20Azure%20tenant%2C%20%3CA%20href%3D%22http%3A%2F%2Fportal.azure.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fportal.azure.com%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3ESearch%20for%20App%20Registration%20%26gt%3B%20New%20Registration%3C%2FLI%3E%0A%3CLI%3EType%20Name%2C%20ensure%20of%20selecting%20the%20right%20%22supported%20account%20type%22%3A%26nbsp%3B%3CSPAN%3E%3CSTRONG%3EAccounts%20in%20any%20organizational%20directory%20(Any%20Azure%20AD%20directory%20-%20Multitenant)%3C%2FSTRONG%3E%2C%20then%20click%20Register%20button%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EFollow%20the%20below%20gif%26nbsp%3B%2F%20step-by%20step%20guide%20on%20how%20to%20define%20and%20configure%20the%20API%20permissions%20%26amp%3B%20create%20the%20secret%3A%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22O365MultiConnector1.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231185iC568B89AE6D69EF2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22O365MultiConnector1.gif%22%20alt%3D%22O365MultiConnector1.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EClick%20at%20%E2%80%9CAPI%20permissions%E2%80%9D%3CUL%3E%0A%3CLI%3EAdd%20a%20permission%20%26gt%3B%20Office%20365%20Management%20API%20%26gt%3B%20Application%20permissions%3C%2FLI%3E%0A%3CLI%3ESelect%20and%20check%20%E2%80%9CActivityFeed.Read%E2%80%9D%20%2C%20%E2%80%9CActivityFeed.ReadDlp%E2%80%9D%20%26amp%3B%20%E2%80%9CServiceHealth.Read%E2%80%9D%3C%2FLI%3E%0A%3CLI%3EAdd%20a%20permission%20%26gt%3B%20Microsoft%20Graph%3C%2FLI%3E%0A%3CLI%3ESelect%20and%20check%20%E2%80%9CDirectory.Read.All%E2%80%9D%2C%20%E2%80%9CAuditLog.Read.All%E2%80%9D%3C%2FLI%3E%0A%3CLI%3EClick%20at%20%E2%80%9Cgrant%20admin%20consent%E2%80%9D%20link%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EClick%20at%20%E2%80%9CCertificates%20%26amp%3B%20secrets%E2%80%9D%3CUL%3E%0A%3CLI%3EUnder%20Client%20secrets%20%26gt%3B%20Add%20client%20secret%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EGet%20the%20following%20values%3A%3CUL%3E%0A%3CLI%3EApplication%20%2F%20Client%20ID%3C%2FLI%3E%0A%3CLI%3ETenant%20ID%3C%2FLI%3E%0A%3CLI%3ESecret%3C%2FLI%3E%0A%3CLI%3EAzure%20Active%20Directory%20Domain%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ERegister%20the%20API%20subscription%20via%20PowerShell%2C%20run%20the%20below%20PowerShell%20as%20administrator%20and%20connect%20to%20the%20%22Ct%22%20tenant%20directory%2C%20ensure%20of%20replacing%26nbsp%3B%24ClientID%2C%26nbsp%3B%24ClientSecret%2C%26nbsp%3B%24tenantdomain%E2%80%AFand%26nbsp%3B%24TenantGUID%20with%20the%20above%20copied%20values%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EConnect-AzAccount%20%23%20connect%20via%20child%20%22Pt%22%20admin%20account%0A%0A%23%20Populate%20with%20App%20ID%20and%20Secret%20from%20your%20Azure%20AD%20app%20registration%20%0A%24ClientID%20%3D%20%22%3CCLIENT_ID%3E%22%E2%80%AF%20%0A%24ClientSecret%E2%80%AF%3D%20%22%3CSECRET%3E%22%E2%80%AF%20%0A%24loginURL%E2%80%AF%3D%20%22https%3A%2F%2Flogin.microsoftonline.com%2F%22%E2%80%AF%20%0A%24tenantdomain%E2%80%AF%3D%20%22%3CTENANT-DOMAIN%3E.onmicrosoft.com%22%E2%80%AF%20%0A%23%20Get%20the%20tenant%20GUID%20from%20Properties%20%7C%20Directory%20ID%20under%20the%20Azure%20Active%20Directory%20section%20%0A%24TenantGUID%E2%80%AF%3D%20%22%3CTENANT_ID%3E%22%E2%80%AF%20%0A%24resource%20%3D%20%22https%3A%2F%2Fmanage.office.com%22%E2%80%AF%20%0A%24body%20%3D%20%40%7Bgrant_type%3D%22client_credentials%22%3Bresource%3D%24resource%3Bclient_id%3D%24ClientID%3Bclient_secret%3D%24ClientSecret%7D%E2%80%AF%0A%24oauth%E2%80%AF%3D%20Invoke-RestMethod%E2%80%AF-Method%20Post%20-Uri%20%24loginURL%2F%24tenantdomain%2Foauth2%2Ftoken%3Fapi-version%3D1.0%20-Body%20%24body%E2%80%AF%20%0A%24headerParams%E2%80%AF%3D%20%40%7B'Authorization'%3D%22%24(%24oauth.token_type)%20%24(%24oauth.access_token)%22%7D%E2%80%AF%E2%80%AF%20%0A%24publisher%20%3D%20New-Guid%0AInvoke-WebRequest%E2%80%AF-Method%20Post%20-Headers%20%24headerParams%E2%80%AF-Uri%20%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%24tenantGuid%2Factivity%2Ffeed%2Fsubscriptions%2Fstart%3FcontentType%3DAudit.AzureActiveDirectory%26amp%3BPublisherIdentifier%3D%24Publisher%22%E2%80%AF%0AInvoke-WebRequest%E2%80%AF-Method%20Post%20-Headers%20%24headerParams%E2%80%AF-Uri%20%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%24tenantGuid%2Factivity%2Ffeed%2Fsubscriptions%2Fstart%3FcontentType%3DDLP.ALL%26amp%3BPublisherIdentifier%3D%24Publisher%22%E2%80%AF%0AInvoke-WebRequest%E2%80%AF-Method%20Post%20-Headers%20%24headerParams%E2%80%AF-Uri%20%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%24tenantGuid%2Factivity%2Ffeed%2Fsubscriptions%2Fstart%3FcontentType%3DAudit.General%26amp%3BPublisherIdentifier%3D%24Publisher%22%E2%80%AF%0AInvoke-WebRequest%E2%80%AF-Method%20Post%20-Headers%20%24headerParams%E2%80%AF-Uri%20%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%24tenantGuid%2Factivity%2Ffeed%2Fsubscriptions%2Fstart%3FcontentType%3DAudit.Exchange%26amp%3BPublisherIdentifier%3D%24Publisher%22%E2%80%AF%0AInvoke-WebRequest%E2%80%AF-Method%20Post%20-Headers%20%24headerParams%E2%80%AF-Uri%20%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%24tenantGuid%2Factivity%2Ffeed%2Fsubscriptions%2Fstart%3FcontentType%3DAudit.SharePoint%26amp%3BPublisherIdentifier%3D%24Publisher%22%E2%80%AF%3C%2FTENANT_ID%3E%3C%2FTENANT-DOMAIN%3E%3C%2FSECRET%3E%3C%2FCLIENT_ID%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep(2)%3A%20Cross-Tenants%20Custom%20Connector%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ELog%20in%20to%20%22Pt%22%20Azure%20tenant%2C%20%3CA%20href%3D%22http%3A%2F%2Fportal.azure.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fportal.azure.com%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EGo%20to%20Azure%20Sentinel%20%26gt%3B%20Playbooks%3C%2FLI%3E%0A%3CLI%3ECreate%20a%20new%20Playbook%20and%20follow%20the%20below%20gif%20%2F%20step-by-step%20guide%2C%20the%20code%20being%20uploaded%20to%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fhesaad%2FAzureSentinelHub%2Fblob%2Fmaster%2FMulti-Tenants_O365AAD_Playbook%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Egithub%20repo%3C%2FA%3E%20as%20well%3A%3CUL%3E%0A%3CLI%3EAdd%20a%20%E2%80%9CRecurrence%E2%80%9D%20step%20and%20set%20the%20following%20field%2C%20below%20is%20an%20example%20to%20trigger%20the%20Playbook%20every%205%20minutes%3A%3CUL%3E%0A%3CLI%3EInterval%3A%205%3C%2FLI%3E%0A%3CLI%3EFrequency%3A%20Minute%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EInitialize%20set%20of%20variables%20for%20the%20content-types%20values%3A%3CBR%20%2F%3E%3CUL%3E%0A%3CLI%3EChild-Tenant%20ID%3A%3CUL%3E%0A%3CLI%3EName%3A%20ChildTenantID%3C%2FLI%3E%0A%3CLI%3EType%3A%20String%3C%2FLI%3E%0A%3CLI%3EValue%3A%20value%20of%20the%20child%20tenant%20ID%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAudit.General-Var%3A%3CUL%3E%0A%3CLI%3EName%3A%20AuditGeneral%3C%2FLI%3E%0A%3CLI%3EType%3A%20String%3C%2FLI%3E%0A%3CLI%3EValue%3A%20%3CA%20href%3D%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%40%7Bvariables('ChildTenantID')%7D%2Factivity%2Ffeed%2Fsubscriptions%2Fcontent%3FcontentType%3DAudit.General%26amp%3BPublisherIdentifier%3DMicrosoft%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%40%7Bvariables('ChildTenantID')%7D%2Factivity%2Ffeed%2Fsubscriptions%2Fcontent%3FcontentType%3DAudit.General%26amp%3BPublisherIdentifier%3DMicrosoft%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAudit.AzureActiveDirectory-Var%3A%3CUL%3E%0A%3CLI%3EName%3A%20AAD%3C%2FLI%3E%0A%3CLI%3EType%3A%20String%3C%2FLI%3E%0A%3CLI%3EValue%3A%20%3CA%20href%3D%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%40%7Bvariables('ChildTenantID')%7D%2Factivity%2Ffeed%2Fsubscriptions%2Fcontent%3FcontentType%3DAudit.AzureActiveDirectory%26amp%3BPublisherIdentifier%3DMicrosoft%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%40%7Bvariables('ChildTenantID')%7D%2Factivity%2Ffeed%2Fsubscriptions%2Fcontent%3FcontentType%3DAudit.AzureActiveDirectory%26amp%3BPublisherIdentifier%3DMicrosoft%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EDLP-Var%3A%3CUL%3E%0A%3CLI%3EName%3A%20DLP%3C%2FLI%3E%0A%3CLI%3EType%3A%20String%3C%2FLI%3E%0A%3CLI%3EValue%3A%20%3CA%20href%3D%22https%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%40%7Bvariables('ChildTenantID')%7D%2Factivity%2Ffeed%2Fsubscriptions%2Fcontent%3FcontentType%3DDLP.ALL%26amp%3BPublisherIdentifier%3DMicrosoft%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmanage.office.com%2Fapi%2Fv1.0%2F%40%7Bvariables('ChildTenantID')%7D%2Factivity%2Ffeed%2Fsubscriptions%2Fcontent%3FcontentType%3DDLP.ALL%26amp%3BPublisherIdentifier%3DMicrosoft%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EUser%20SignIns-Var%3A%3CUL%3E%0A%3CLI%3EName%3A%20Sign-Ins%3C%2FLI%3E%0A%3CLI%3EType%3A%20String%3C%2FLI%3E%0A%3CLI%3EValue%3A%20%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FauditLogs%2FsignIns%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FauditLogs%2FsignIns%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EUser-Activities-Var%3A%3CUL%3E%0A%3CLI%3EName%3A%20UserActivities%3C%2FLI%3E%0A%3CLI%3EType%3A%20String%3C%2FLI%3E%0A%3CLI%3EValue%3A%20%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FauditLogs%2FdirectoryAudits%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2FauditLogs%2FdirectoryAudits%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ESet%20an%20HTTP%20endpoints%20to%20Get%20content-types%20data%2C%20ensure%20the%20authorization%20type%20is%20Active%20Directory%20OAuth%3A%3CUL%3E%0A%3CLI%3EHTTP%20%E2%80%93%20Get%20Logs%20%E2%80%93%20O365API%3A%3CUL%3E%0A%3CLI%3EMethod%3A%20GET%3C%2FLI%3E%0A%3CLI%3EURI%3A%20%40%7Bvariables('AAD')%7D%3C%2FLI%3E%0A%3CLI%3EHeaders%3A%3CUL%3E%0A%3CLI%3EAccept%3A%20application%2Fjson%3C%2FLI%3E%0A%3CLI%3EContent-Type%3A%20application%2Fjson%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAuthentication%20type%3A%20Active%20Directory%20OAuth%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EHTTP%20%E2%80%93%20GraphAPI%3A%3CUL%3E%0A%3CLI%3EMethod%3A%20GET%3C%2FLI%3E%0A%3CLI%3EURI%3A%20%40%7Bvariables('Sign-Ins')%7D%3C%2FLI%3E%0A%3CLI%3EHeaders%3A%3CUL%3E%0A%3CLI%3EAccept%3A%20application%2Fjson%3C%2FLI%3E%0A%3CLI%3EContent-Type%3A%20application%2Fjson%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAuthentication%20type%3A%20Active%20Directory%20OAuth%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EParse%20content-types%20data%20via%20Json%3A%3CUL%3E%0A%3CLI%3EParse%20JSON%20%E2%80%93%20O365API%3A%3CUL%3E%0A%3CLI%3EContent%3A%20%40%7Bbody('HTTP__-_Get_Logs-O365API')%7D%3C%2FLI%3E%0A%3CLI%3ESchema%3A%20uploaded%20to%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fhesaad%2FAzureSentinelHub%2Fblob%2Fmaster%2FMulti-TenantsO365API-Parser%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Egithub%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EParse%20JSON%20%E2%80%93%20GraphAPI%3A%3CUL%3E%0A%3CLI%3EContent%3A%20%40%7Bbody('HTTP_-_GraphAPI')%7D%3C%2FLI%3E%0A%3CLI%3ESchema%3A%20uploaded%20to%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fhesaad%2FAzureSentinelHub%2Fblob%2Fmaster%2FMulti-TenantsGraphAPI-Parser%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Egithub%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ENext%20step%20is%20to%20send%20logs%20to%20Azure%20Sentinel%20via%20a%20custom%20log%20table%2C%20so%20will%20show%20an%20example%20of%20iterating%20all%20returned%20values%20from%20O365%20Management%20API%20and%20send%20data%20to%20Log%20analytics%20and%20another%20example%20of%20sending%20the%20raw-data%20from%20Graph%20API%20to%20log%20analytics%20without%20the%20iteration%20phase%3A%3CUL%3E%0A%3CLI%3EIterate%20(For-each)%20on%20all%20returned%20values%20(Body)%20and%20Get%20contentUri%20from%20Office%20365%20API%20and%20value%20from%20Graph%20API%20via%20an%20embedded%20-%20looped%20HTTP%20Endpoints%2C%20ensuring%20that%20the%20authorization%20type%20is%20Active%20Directory%20OAuth%3A%3CUL%3E%0A%3CLI%3EAdd%26nbsp%3B%20For%20Each%20control%3A%3CUL%3E%0A%3CLI%3ESelect%20an%20output%20from%20previous%20steps%3A%20%40body('Parse_JSON_-_O365API')%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAdd%20HTTP%20endpoint%20step%3A%3CUL%3E%0A%3CLI%3EMethod%3A%20GET%3C%2FLI%3E%0A%3CLI%3EURI%3A%20%40%7Bitems('For_each_-O365API')%5B'contentUri'%5D%7D%3C%2FLI%3E%0A%3CLI%3EHeaders%3A%3CUL%3E%0A%3CLI%3EAccept%3A%20application%2Fjson%3C%2FLI%3E%0A%3CLI%3EContent-Type%3A%20application%2Fjson%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAuthentication%3A%20Active%20Driectory%20OAuth%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAdd%20Send%20Data%20to%20Log%20Analytics%20Control%3A%3CUL%3E%0A%3CLI%3EJSON%20Request%20body%3A%20%40%7Bjson(body('HTTP'))%7D%3C%2FLI%3E%0A%3CLI%3ECustom%20Log%20Name%3A%20ChildO365AAD%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ESend%20the%20data%20(Office%20365%20Management%20API%20and%20Graph%20API)%20to%20Azure%20Sentinel%20Log%20analytics%20workspace%20via%20a%20custom%20log%20tables%3A%3CUL%3E%0A%3CLI%3EJSON%20Request%20body%3A%20%40%7Bbody('HTTP_-_GraphAPI')%7D%3C%2FLI%3E%0A%3CLI%3ECustom%20Log%20Name%3A%20ChildAADSignIn%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22O365MultiConnectorPlaybookPart1.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231581i12C1AB0384C3C60A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22O365MultiConnectorPlaybookPart1.gif%22%20alt%3D%22O365MultiConnectorPlaybookPart1.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22O365MultiConnectorPlaybookPart3.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231585i80663FBD26649ED8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22O365MultiConnectorPlaybookPart3.gif%22%20alt%3D%22O365MultiConnectorPlaybookPart3.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22O365MultiConnectorPlaybookPart4.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231587i6C1572E6F68C79BC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22O365MultiConnectorPlaybookPart4.gif%22%20alt%3D%22O365MultiConnectorPlaybookPart4.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENotes%20%26amp%3B%20Consideration%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EYou%20can%20customize%20the%20parsers%20at%20the%20connector's%20flow%20with%20the%20required%20and%20needed%20attributed%20%2F%20fields%20based%20on%20your%20schema%20%2F%20payload%20before%20the%20ingestion%20process%2C%20also%20you%20can%20create%20custom%20Azure%20Functions%20once%20the%20data%20being%20ingested%20to%20Azure%20Sentinel%3C%2FLI%3E%0A%3CLI%3EAzure%20Function%20can%20be%20used%26nbsp%3Bto%20create%20custom%20connector%20for%20multi-tenant%20access%2C%20here%E2%80%99s%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FO365-ActivityFeed-AzureFunction%2Ftree%2Fmaster%2FSentinel%2FEndPointDLP_preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ea%20great%20example%3C%2FA%3E%20created%20by%20Jon%20Nord%20invoking%20Office%20365%20Management%20API%20which%20you%20can%20extend%20and%20add%20Graph%20API%20as%20well.%3C%2FLI%3E%0A%3CLI%3ECouple%20of%20points%20to%20be%20considered%20while%20using%20Logic%20Apps%3A%3CUL%3E%0A%3CLI%3ECost%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fconnectors%2Fapis-list%3Ftoc%3D%252fazure%252flogic-apps%252ftoc.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Estandard%20%2F%20enterprise%20connectors%3C%2FA%3E)%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flogic-apps%2Flogic-apps-limits-and-config%23%3A~%3Atext%3DFor%2520logic%2520apps%2520in%2520multi-tenant%2520Azure%252C%2520the%252090-day%2Cretention%2520limit%2520from%252090%2520days%2520to%252030%2520days.%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EConsiderations%20%26amp%3B%20Configurations%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3ENon%20standard%20schema%3C%2FLI%3E%0A%3CLI%3ERewriting%20rules%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet%20started%20today!%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20encourage%20you%20to%20try%20it%20now!%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20also%20contribute%20new%20connectors%2C%20workbooks%2C%20analytics%20and%20more%20in%20Azure%20Sentinel.%20Get%20started%20now%20by%20joining%20the%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fthreathunters%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20Threat%20Hunters%20GitHub%20community%3C%2FA%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1848968%22%20slang%3D%22en-US%22%3E%3CP%3EGlobal%20SOC%20team%20are%20looking%20to%20configure%20the%20out-of-box%20O365%20and%20AAD%20data%20connectors%20to%20ingest%20logs%20from%20multiple%20separate%20tenants%20%26nbsp%3Bwhile%20Azure%20Sentinel%20can%E2%80%99t%20natively%20do%20that%2C%20we%20cover%20your%20back!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20get%20started%20and%20see%20how%20to%20build%20a%20custom%20multi-tenancy%20connector%20to%20pull%20O365%20%26amp%3B%20AAD%20logs%20from%20multiple%26nbsp%3Btenants!%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1848968%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDetection%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInvestigation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1866739%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20%26amp%3B%20AAD%20Multi-Tenant%20Custom%20Connector%20-%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1866739%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20guessing%20this%20ingestion%20would%20not%20be%20free%20anymore%20since%20it%20is%20not%20using%20the%20OOTB%20connector%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1866762%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20%26amp%3B%20AAD%20Multi-Tenant%20Custom%20Connector%20-%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1866762%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20correct%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46875%22%20target%3D%22_blank%22%3E%40Gary%20Bushey%3C%2FA%3E%26nbsp%3B%2C%20cost%20point%20mentioned%20under%20%22notes%20%26amp%3B%20consideration%22%20Section.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1870489%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20%26amp%3B%20AAD%20Multi-Tenant%20Custom%20Connector%20-%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1870489%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F49603%22%20target%3D%22_blank%22%3E%40Hesham%20Saad%3C%2FA%3E%26nbsp%3BThanks%20for%20the%20post.%20I%20was%20actually%20checking%20on%20this%20a%20couple%20of%20days%20back.%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20this%20feature%20was%20available%20in%20the%26nbsp%3BOffice%20365%20connector%20and%20was%20then%20depreciated%20due%20to%20some%26nbsp%3Bsecurity%20concerns%2C%20do%20you%20know%20what%20concerns%20were%20there%20exactly.%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%20isn't%20it%20more%20appropriate%20to%20allow%20the%20customer%20to%20accept%20the%20risk%20and%20allow%20the%20same%20functionality.%3C%2FP%3E%3CP%3EBecause%20it%20was%20really%20easy%20and%20straightforward%20to%20use%20the%20the%20OOTB%20connector%20to%20connect%20external%20O365%20tenants%20and%20we%20would%20get%20the%20logs%20under%20OfficeActivity%20table%20and%20not%20as%20Custom%20logs.%20Also%20the%20burden%20of%20cost%20per%20run%20of%20log%20ingestion%20would%20have%20been%20avoided.%3C%2FP%3E%3CP%3EI%20really%20think%20we%20should%20make%20Logic%20Apps%20free%2C%20since%20most%20workarounds%20and%20custom%20features%20end%20up%20with%20Logic%20Apps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1880273%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20%26amp%3B%20AAD%20Multi-Tenant%20Custom%20Connector%20-%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1880273%22%20slang%3D%22en-US%22%3E%3CP%3EMany%20thanks%20for%20the%20post.%20Can%20you%20please%20be%20more%20specific%20about%20the%20concepts%20Parent%20Tenant%20(Pt)%20and%20Child%20Tenant%20(Ct)%3F%20I%20do%20not%20understand%20the%20difference%20between%20them.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1880781%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20%26amp%3B%20AAD%20Multi-Tenant%20Custom%20Connector%20-%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1880781%22%20slang%3D%22en-US%22%3E%3CP%3ENo%20problem%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412263%22%20target%3D%22_blank%22%3E%40TH-Zenon75%3C%2FA%3E%26nbsp%3B%20-%26nbsp%3B%20please%20refer%20to%20the%20post%20top%20section%20%22%3CSPAN%3EAssuming%2C%20we%20have%20a%20parent%20tenant%20(Pt)%20%26amp%3B%20a%20child%20tenant%20(Ct)%20and%20the%20requirements%20is%20to%20invoke%20the%20%22Ct%22%20tenant%20O365%20Management%20API%20%26amp%3B%20Graph%20APIs%20to%20pull%20Office%20365%20%26amp%3B%20AAD%20logs%20and%20ingest%20at%20%22Pt%22%20ones.%22%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20use%20case%20here%20is%20to%20invoke%20and%20pull%20logs%20from%20specific%20tenant%20(called%20child%20Ct%20tenant)%20to%20ingest%20at%20the%20parent%20(Pt)%20tenant.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1880784%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20%26amp%3B%20AAD%20Multi-Tenant%20Custom%20Connector%20-%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1880784%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F387181%22%20target%3D%22_blank%22%3E%40Joseph-Abraham%3C%2FA%3E%26nbsp%3B%20for%20the%20feedback%2C%20we%20will%20share%20it%20with%20the%20product%20group%20team.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

 

Overview & Use Case

 

Thanks to @Ofer_Shezaf  and @Yaniv Shasha for the brainstorming, contributing and proof reading! 

 

A multi-national organization having multiple branches with different identities across the globe, each branch have it's own separate tenant (AAD & O365) logs and the global SOC team are looking for a way on how to ingest these logs coming from all branches to their main parent tenant via Azure Sentinel.

 

While Azure Sentinel can’t natively do that using the out-of-the box data connectors (Office 365 / Azure AD), we cover your back with O365 & AAD Multi-Tenancy custom connector via an Azure Sentinel Playbook (Logic App) that invoke the Office 365 Management API & Graph API to read from multiple tenants and writes to a custom table in Sentinel, same can be done using Azure Function.

 

Implementation

 

With the help of Office 365 Management API & Microsoft Graph API we can invoke specific content types cross-tenants:

 

API Content-Type / Activity Log
Office 365 Management API Audit.AzureActiveDirectory
Office 365 Management API Audit.Exchange
Office 365 Management API Audit.SharePoint
Office 365 Management API Audit.General (includes all other workloads not included in the previous content types)
Office 365 Management API DLP.All (DLP events only for all workloads)
Graph API audit-Logs
Graph API Sign-in Logs

 

So, tell us more about the steps?

 

Assuming, we have a parent tenant (Pt) & a child tenant (Ct) and the requirements is to invoke the "Ct" tenant O365 Management API & Graph APIs to pull Office 365 & AAD logs and ingest at "Pt" ones.

 

Step(1): Prep & App Registration

  • Ensure that "Ct" Office 365 Security & Compliance audit logs is enabled 
  • Log in to "Ct" Azure tenant, http://portal.azure.com
  • Search for App Registration > New Registration
  • Type Name, ensure of selecting the right "supported account type": Accounts in any organizational directory (Any Azure AD directory - Multitenant), then click Register button
  • Follow the below gif / step-by step guide on how to define and configure the API permissions & create the secret:

O365MultiConnector1.gif

  • Click at “API permissions”
    • Add a permission > Office 365 Management API > Application permissions
    • Select and check “ActivityFeed.Read” , “ActivityFeed.ReadDlp” & “ServiceHealth.Read”
    • Add a permission > Microsoft Graph
    • Select and check “Directory.Read.All”, “AuditLog.Read.All”
    • Click at “grant admin consent” link
  • Click at “Certificates & secrets”
    • Under Client secrets > Add client secret
  • Get the following values:
    • Application / Client ID
    • Tenant ID
    • Secret
    • Azure Active Directory Domain
  • Register the API subscription via PowerShell, run the below PowerShell as administrator and connect to the "Ct" tenant directory, ensure of replacing $ClientID, $ClientSecret, $tenantdomain and $TenantGUID with the above copied values:

 

 

Connect-AzAccount # connect via child "Pt" admin account

# Populate with App ID and Secret from your Azure AD app registration 
$ClientID = "<Client_ID>"  
$ClientSecret = "<Secret>"  
$loginURL = "https://login.microsoftonline.com/"  
$tenantdomain = "<tenant-domain>.onmicrosoft.com"  
# Get the tenant GUID from Properties | Directory ID under the Azure Active Directory section 
$TenantGUID = "<tenant_ID>"  
$resource = "https://manage.office.com"  
$body = @{grant_type="client_credentials";resource=$resource;client_id=$ClientID;client_secret=$ClientSecret} 
$oauth = Invoke-RestMethod -Method Post -Uri $loginURL/$tenantdomain/oauth2/token?api-version=1.0 -Body $body  
$headerParams = @{'Authorization'="$($oauth.token_type) $($oauth.access_token)"}   
$publisher = New-Guid
Invoke-WebRequest -Method Post -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenantGuid/activity/feed/subscriptions/start?contentType=Audit.AzureActiveDirectory&PublisherIdentifier=$Publisher" 
Invoke-WebRequest -Method Post -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenantGuid/activity/feed/subscriptions/start?contentType=DLP.ALL&PublisherIdentifier=$Publisher" 
Invoke-WebRequest -Method Post -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenantGuid/activity/feed/subscriptions/start?contentType=Audit.General&PublisherIdentifier=$Publisher" 
Invoke-WebRequest -Method Post -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenantGuid/activity/feed/subscriptions/start?contentType=Audit.Exchange&PublisherIdentifier=$Publisher" 
Invoke-WebRequest -Method Post -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenantGuid/activity/feed/subscriptions/start?contentType=Audit.SharePoint&PublisherIdentifier=$Publisher" 

 

 

 

Step(2): Cross-Tenants Custom Connector

  • Log in to "Pt" Azure tenant, http://portal.azure.com
  • Go to Azure Sentinel > Playbooks
  • Create a new Playbook and follow the below gif / step-by-step guide, the code being uploaded to github repo as well:
    • Add a “Recurrence” step and set the following field, below is an example to trigger the Playbook every 5 minutes:
      • Interval: 5
      • Frequency: Minute
    • Initialize set of variables for the content-types values:
    • Set an HTTP endpoints to Get content-types data, ensure the authorization type is Active Directory OAuth:
      • HTTP – Get Logs – O365API:
        • Method: GET
        • URI: @{variables('AAD')}
        • Headers:
          • Accept: application/json
          • Content-Type: application/json
        • Authentication type: Active Directory OAuth
      • HTTP – GraphAPI:
        • Method: GET
        • URI: @{variables('Sign-Ins')}
        • Headers:
          • Accept: application/json
          • Content-Type: application/json
        • Authentication type: Active Directory OAuth
    • Parse content-types data via Json:
      • Parse JSON – O365API:
        • Content: @{body('HTTP__-_Get_Logs-O365API')}
        • Schema: uploaded to github
      • Parse JSON – GraphAPI:
        • Content: @{body('HTTP_-_GraphAPI')}
        • Schema: uploaded to github
    • Next step is to send logs to Azure Sentinel via a custom log table, so will show an example of iterating all returned values from O365 Management API and send data to Log analytics and another example of sending the raw-data from Graph API to log analytics without the iteration phase:
      • Iterate (For-each) on all returned values (Body) and Get contentUri from Office 365 API and value from Graph API via an embedded - looped HTTP Endpoints, ensuring that the authorization type is Active Directory OAuth:
        • Add  For Each control:
          • Select an output from previous steps: @body('Parse_JSON_-_O365API')
        • Add HTTP endpoint step:
          • Method: GET
          • URI: @{items('For_each_-O365API')['contentUri']}
          • Headers:
            • Accept: application/json
            • Content-Type: application/json
          • Authentication: Active Driectory OAuth
        • Add Send Data to Log Analytics Control:
          • JSON Request body: @{json(body('HTTP'))}
          • Custom Log Name: ChildO365AAD
    • Send the data (Office 365 Management API and Graph API) to Azure Sentinel Log analytics workspace via a custom log tables:
      • JSON Request body: @{body('HTTP_-_GraphAPI')}
      • Custom Log Name: ChildAADSignIn

O365MultiConnectorPlaybookPart1.gif

 

O365MultiConnectorPlaybookPart3.gif

 

O365MultiConnectorPlaybookPart4.gif

 

Notes & Consideration

 

  • You can customize the parsers at the connector's flow with the required and needed attributed / fields based on your schema / payload before the ingestion process, also you can create custom Azure Functions once the data being ingested to Azure Sentinel
  • Azure Function can be used to create custom connector for multi-tenant access, here’s a great example created by Jon Nord invoking Office 365 Management API which you can extend and add Graph API as well.
  • Couple of points to be considered while using Logic Apps:

 

Get started today!

 

We encourage you to try it now!

You can also contribute new connectors, workbooks, analytics and more in Azure Sentinel. Get started now by joining the Azure Sentinel Threat Hunters GitHub community.

 

6 Comments
Super Contributor

I'm guessing this ingestion would not be free anymore since it is not using the OOTB connector?

Microsoft

Yes, correct @Gary Bushey , cost point mentioned under "notes & consideration" Section.

New Contributor

@Hesham Saad Thanks for the post. I was actually checking on this a couple of days back. 

Since this feature was available in the Office 365 connector and was then depreciated due to some security concerns, do you know what concerns were there exactly. 

Also isn't it more appropriate to allow the customer to accept the risk and allow the same functionality.

Because it was really easy and straightforward to use the the OOTB connector to connect external O365 tenants and we would get the logs under OfficeActivity table and not as Custom logs. Also the burden of cost per run of log ingestion would have been avoided.

I really think we should make Logic Apps free, since most workarounds and custom features end up with Logic Apps.

Senior Member

Many thanks for the post. Can you please be more specific about the concepts Parent Tenant (Pt) and Child Tenant (Ct)? I do not understand the difference between them.

Microsoft

No problem @TH-Zenon75  -  please refer to the post top section "Assuming, we have a parent tenant (Pt) & a child tenant (Ct) and the requirements is to invoke the "Ct" tenant O365 Management API & Graph APIs to pull Office 365 & AAD logs and ingest at "Pt" ones."

 

The use case here is to invoke and pull logs from specific tenant (called child Ct tenant) to ingest at the parent (Pt) tenant.

Microsoft

Thanks @Joseph-Abraham  for the feedback, we will share it with the product group team.