%3CLINGO-SUB%20id%3D%22lingo-sub-1299929%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Sentinel%20Data%20Enrichment%20-%20Walk-through%20with%20Scripting%2C%20KQL%20and%20Playbooks%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1299929%22%20slang%3D%22en-US%22%3E%3CP%3EGood%20long%20source.%20thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1302983%22%20slang%3D%22en-US%22%3ERe%3A%20Enriching%20Azure%20Sentinel%20with%20Azure%20AD%20information%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1302983%22%20slang%3D%22en-US%22%3E%3CP%3ESeeing%20some%20examples%20with%20data%20from%20the%203rd%20party%20connectors%20would%20be%20interesting.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1305711%22%20slang%3D%22en-US%22%3ERe%3A%20Enriching%20Azure%20Sentinel%20with%20Azure%20AD%20information%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1305711%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%3E%40Dean%20Gross%3C%2FA%3E%20-%20Specifically%20with%20AAD%20Enrichment%20with%20a%203rd%20party%20connector%3F%20Would%20be%20more%20than%20happy%20to%20show%20an%20example%2C%20is%20there%20a%20specific%20one%20you're%20thinking%20of%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1314011%22%20slang%3D%22en-US%22%3ERe%3A%20Enriching%20Azure%20Sentinel%20with%20Azure%20AD%20information%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1314011%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89690%22%20target%3D%22_blank%22%3E%40Chris%20Boehm%3C%2FA%3E%26nbsp%3B%20not%20necessarily%20AAD%20Enrichment%2C%20but%20if%20there%20is%20something%20that%20could%20be%20done%20with%20Okta%2C%20Ping%2C%20or%20Duo%20that%20could%20be%20interesting.%20I%20was%20actually%20thinking%20about%20examples%20with%20sources%20like%20AWS%2C%20F5%2C%20Barracuda%2C%20Checkpoint%20etc.%20Maybe%20something%20from%20each%20of%20the%20major%20categories%20of%20connector%20types.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1288805%22%20slang%3D%22en-US%22%3EEnriching%20Azure%20Sentinel%20with%20Azure%20AD%20information%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1288805%22%20slang%3D%22en-US%22%3E%3CP%3EHowdy%20Everyone!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20organizations%20are%20migrating%20over%20to%20Azure%20Sentinel%20as%20their%20primary%20SIEM%20solution%2C%20they%20are%20looking%20at%20ways%20to%20enrich%20their%20data.%20For%20example%20associating%20Azure%20Activity%20logs%20or%20Office%20365%20Data%20with%20an%20organizational%20unit%20derived%20from%20Azure%20AD.%20Such%20enrichment%20enables%20filtering%20the%20information%20based%20on%20organizational%20units.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20walk-through%2C%20I%20will%20demonstrate%20how%20to%20import%20Azure%20AD%20information%20which%20includes%20the%20subsidiary%20association%20of%20users%20as%20an%20extension%20property%20to%20Azure%20Sentinel.%20I%20will%20than%20use%20a%20join%20query%20to%20enrich%20event%20data%20and%20use%20the%20enrichment%20information%20to%20split%20up%20events%20based%20on%20subsidiary.%20This%20will%20enable%20me%20to%20send%20the%20data%20to%20a%20separate%20workspace%20representing%20the%20subsidiary%20owned%20date%20store.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3ESpecial%20Thanks!%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EYaniv%20Shasha-%20Thank%20you%20for%20the%20assistance%20on%20creating%20the%20automation%20scripts%20with%20Azure%20Function.%3C%2FP%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Fyanivshasha%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.linkedin.com%2Fin%2Fyanivshasha%2F%3C%2FA%3E%3C%2FFONT%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJim%20Britt%20-%20Thank%20you%20for%20assistance%20of%20co-working%20this%20problem%20together%20and%20your%20PS%20Module.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Fjimbritt%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3Ehttps%3A%2F%2Fwww.linkedin.com%2Fin%2Fjimbritt%2F%3C%2FFONT%3E%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3E%3CSTRONG%3ERequirements%3A%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWorkspace%20and%20Log%20Permissions%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CP%3EYou%E2%80%99ll%20be%20needing%20API%20permissions%20for%20the%20Log%20Analytics%20workspace%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fmanage-access%23manage-access-using-workspace-permissions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMore%20details%20here%3C%2FA%3E%20%2C%20I%E2%80%99ll%20personally%20be%20using%20the%20Log%20Analytics%20Contributor%20role.%20For%20my%20example%2C%20I%E2%80%99m%20using%20AAD%20permissions%2C%20please%20make%20sure%20you%20have%20the%20appropriate%20permissions%20when%20pulling%20your%20data.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fusers-groups-roles%2Fdirectory-assign-admin-roles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAAD%20Roles%20here%3C%2FA%3E%20if%20your%20pulling%20data%20from%20Azure%20AD.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EPS%20Modules%20I%E2%80%99m%20using%20with%20PowerShell%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20AD%20Module%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fusers-groups-roles%2Fdirectory-assign-admin-roles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELink%20here%20to%20install%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EOMSIngestionAPI%3A%20%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FOMSIngestionAPI%2F1.6.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELink%20here%20to%20install%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3EWalking%20through%20the%20test%20AAD%20Ingestion%3A%3C%2FU%3E%3C%2FP%3E%0A%3CP%3EBased%20on%20the%20goal%20above%2C%20I%E2%80%99m%20looking%20at%20getting%20all%20the%20tenant%20AAD%20Attributes%20into%20Azure%20Sentinel%20to%20enrich%20my%20current%20dataset.%20As%20there%20is%20no%20native%20%22data%20connector%22%20for%20AAD%20Attributes%20we%E2%80%99ll%20have%20to%20build%20our%20own%20connector.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20have%20a%20few%20options%20of%20ingesting%20data%20into%20Log%20Analytics%2C%20those%20all%20centered%20on%20the%20API%20Log%20Analytics%20offers.%20Examples%20are%20Data%20connector%20with%20Logic%20Apps%2C%20PS%20Module%20or%20even%20the%20raw%20API%20with%20Scripting.%20We'll%20be%20using%26nbsp%3B%20and%20work%20on%20automation%20after.%20Playbooks%20can%20be%20a%20simple%20option%20as%20well%2C%20could%20even%20automate%20this%20pulling%20of%20this%20information%20with%20playbooks%2C%20although%20Azure%20Automation%20or%20Scripting%20can%20be%20cheaper%20if%20you%E2%80%99re%20expecting%20to%20Query%2FFormat%2FPush%20lots%20of%20data%20into%20an%20Log%20Analytics%20workspace.%20I'm%20planning%20on%20submitting%20unformatted%20information%20into%20Log%20Analytics%20from%20AAD.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3EStarting%20with%20PowerShell%3A%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThis%20section%20is%20walking%20through%20the%20process%20with%20manually%20running%20PowerShell%20to%20ingest%20data.%20The%20scripts%20mentioned%20in%20this%20walk-through%20will%20be%20added%20to%20the%20Azure%20Sentinel%20Github%20Community%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELink%20to%20Community%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3%20min%20video%20explaining%20the%20process%20through%20PowerShell%3A%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%3CDIV%20class%3D%22video-embed-center%20video-embed%22%3E%3CIFRAME%20class%3D%22embedly-embed%22%20src%3D%22https%3A%2F%2Fcdn.embedly.com%2Fwidgets%2Fmedia.html%3Fsrc%3Dhttps%253A%252F%252Fwww.youtube.com%252Fembed%252F1hKHZEAhMSg%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D1hKHZEAhMSg%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252F1hKHZEAhMSg%252Fhqdefault.jpg%26amp%3Bkey%3Db0d40caa4f094c68be7c29880b16f56e%26amp%3Btype%3Dtext%252Fhtml%26amp%3Bschema%3Dyoutube%22%20width%3D%22600%22%20height%3D%22338%22%20scrolling%3D%22no%22%20title%3D%22YouTube%20embed%22%20frameborder%3D%220%22%20allow%3D%22autoplay%3B%20fullscreen%22%20allowfullscreen%3D%22true%22%3E%3C%2FIFRAME%3E%3C%2FDIV%3E%3CP%3E%3C%2FP%3E%0A%3CP%3EGetting%20started%20we'll%20need%20to%20connect%20to%20Azure%20Active%20Directory%20via%20the%20AzureAD%20Powershell%20Module.%3C%2FP%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%3CPRE%20class%3D%22lia-code-sample%20language-css%22%3E%3CCODE%3EConnect-AzureAD%20-AccountId%20%3CUPN%3E%20-TenantId%20%3CTENANT%20guid%3D%22%22%3E%3C%2FTENANT%3E%3C%2FUPN%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%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Connect.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183627iEFFB97551D9AFB3D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Connect.png%22%20alt%3D%22Connect.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%E2%80%99m%20going%20to%20collect%20all%20the%20AzureAD%20Users%20and%20store%20it%20into%20a%20variable%20of%20%24UsersCollected%3C%2FP%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-css%22%3E%3CCODE%3E%24UsersCollected%20%3D%20Get-AzureADUser%20-All%20%24True%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFeel%20free%20to%20look%20at%20the%20variable%2C%20we%E2%80%99re%20needing%20this%20to%20be%20in%20JSON%20format%20to%20ingest%20the%20data%20cleanly.%20Going%20to%20make%20another%20variable%20to%20make%20my%20future%20scripting%20easier.%3C%2FP%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-css%22%3E%3CCODE%3E%24JsonUserFormat%20%3D%20ConvertTo-Json%20%24UsersCollected%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20all%20the%20information%20collected%20from%20the%20Azure%20AD%20Tenant%20has%20collected%2C%20we%E2%80%99re%20needing%20to%20test%20the%20ingestion%20into%20the%20Log%20Analytics%20workspace%20Azure%20Sentinel%20is%20using.%20You%E2%80%99ll%20need%20the%20following%20information%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3E%24CustomerID%3C%2FSTRONG%3E%20%3A%20%3CLOG%20analytics%3D%22%22%20workspace%3D%22%22%20id%3D%22%22%3E%0A%3CUL%3E%0A%3CLI%3EObtain%20workspace%20ID%20and%20key%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fagent-windows%23obtain-workspace-id-and-key%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Elink%20here%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLOG%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3E%24SharedKey%3C%2FSTRONG%3E%20%3A%20%3CLOG%20analytics%3D%22%22%20primary%3D%22%22%20key%3D%22%22%3E%3C%2FLOG%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3E%24JsonUserFormat%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3E%24logType%3C%2FSTRONG%3E%20%3D%20%E2%80%9CAADLogTest%E2%80%9D%0A%3CUL%3E%0A%3CLI%3EImportant%2C%20this%20is%20the%20custom%20table%20field%20the%20logs%20will%20be%20ingested%20in.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E(Optional)%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3E%24TimeStampfield%3C%2FSTRONG%3E%20%3D%20Get-Date%0A%3CUL%3E%0A%3CLI%3EWill%20show%20the%20time%20of%20the%20ingestion%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CU%3ECopy%20and%20paste%20the%20below%2C%20update%20with%20your%20workspace%20information%3A%3C%2FU%3E%3C%2FP%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-css%22%3E%3CCODE%3E%24CustomerID%20%3D%20%E2%80%98%3CWORKSPACE%20id%3D%22%22%3E%E2%80%99%0A%24SharedKey%20%3D%20%E2%80%98%3CWORKSPACE%20key%3D%22%22%3E%E2%80%99%0A%24logType%20%3D%20%E2%80%9C%3CWORKSPACE%20custom%3D%22%22%20table%3D%22%22%20name%3D%22%22%3E%E2%80%9D%0A%24TimeStampfield%20%3D%20Get-Date%3C%2FWORKSPACE%3E%3C%2FWORKSPACE%3E%3C%2FWORKSPACE%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%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Variables.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183638i6CDD4C69F8E64794%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Variables.png%22%20alt%3D%22Variables.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ENow%20using%20the%20OMSAPI%20Module%2C%20send%20the%20data%20to%20the%20Log%20Analytics%20workspace.%3C%2FP%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-css%22%3E%3CCODE%3ESend-OMSAPIIngestionFile%20-customerId%20%24customerId%20-sharedKey%20%24sharedKey%20-body%20%24JsonUserFormat%20-logType%20%24logType%20-TimeStampField%20%24Timestampfield%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%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22OMSAPI.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183641iE14EE8E82EC2C1DA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22OMSAPI.png%22%20alt%3D%22OMSAPI.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAccepting%20the%20data%20will%20be%20very%20quick%2C%20the%20very%20first%20time%20it%20can%20take%20up%20to%2020-30%20mins%20for%20the%20table%20to%20be%20build%20into%20the%20Log%20Analytics%20workspace.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ELooking%20at%20the%20data%20with-in%20Azure%20Sentinel%E2%80%99s%20log%20Analytics%20workspace%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorChris%20Boehm_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22AADLogTest.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182816i4AA97FAB1F28E4A7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22AADLogTest.png%22%20alt%3D%22AADLogTest.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%E2%80%99ll%20see%20above%20the%20Custom%20Logs%20table%20has%20been%20crated%2C%20and%20I%20was%20able%20to%20query%20the%20information.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAn%20example%20user%20in%20my%20domain%2C%20Adele%20Vance%2C%20this%20user%20has%20been%20preconfigured%20with%20an%20ExtensionProperty%20that%20tells%20us%20her%20home%20office%20location.%20We're%20interested%20in%20enriching%20our%20Azure%20Sentinel%20alerts%20with%20this%20property.%3C%2FP%3E%0A%3CP%3ELooking%20up%20her%20name%2C%20we%20found%20her%20Azure%20Active%20Directory%20Attributes%20information%2C%20then%20filtered%20the%20query%20down%20to%20the%20information%20we're%20currently%20interested%20in%3A%3C%2FP%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%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EAADLogTest_CL%0A%7C%20where%20UserPrincipalName_s%20contains%20%22adelev%22%0A%7C%20project%20UserPN%20%3D%20UserPrincipalName_s%2C%20ObjectId%20%3D%20ObjectId_g%2C%20UserType%20%3D%20UserType_s%2C%20CompanyLocation%20%3D%20ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s%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%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22AdelevTest.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183628i9549C8CF5ADEF43E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22AdelevTest.png%22%20alt%3D%22AdelevTest.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ENow%20seeing%20the%20information%20we're%20wanting%2C%20lets%20join%20the%20%E2%80%9CCompanyLocation%E2%80%9D%20property%20with%20the%20UPN%20with%20other%20data%20sets.%20We're%20going%20to%20use%20SigninLogs%2C%20as%20she's%20just%20been%20complained%20about%20login%20failure's%20to%20her%20account%20multiple%20times%20with%20the%20wrong%20password.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3EHere%20is%20an%20example%20of%20joining%20the%20data%20together%20with%20SigninLogs%20query%20example%3A%3C%2FU%3E%3C%2FP%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-markup%22%3E%3CCODE%3ESigninLogs%0A%7C%20where%20UserPrincipalName%20contains%20%22adelev%22%0A%7C%20project%20UserPrincipalName_s%20%3D%20UserPrincipalName%2C%20Status%2C%20Location%2C%20IPAddress%2C%20Identity%2C%20ResultDescription%0A%7C%20join%20kind%3D%20inner%20(%0A%20%20%20AADLogTest_CL%0A)%20on%20UserPrincipalName_s%0A%7C%20project%20Username_S%20%3D%20UserPrincipalName_s%2C%20Status%2C%20Location%2C%20IPAddress%2C%20Identity%2C%20ResultDescription%2C%20ObjectId%20%3D%20ObjectId_g%2C%20UserType%20%3D%20UserType_s%2C%20CompanyLocation%20%3D%20ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s%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%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22AdelevTestwSigninLogs.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183629iEBCEA83551F9F4EF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22AdelevTestwSigninLogs.png%22%20alt%3D%22AdelevTestwSigninLogs.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EGoing%20one%20step%20further%3B%20we%20could%20look%20at%20multiple%20data%20sets%20and%20query%20out%20the%20information%20based%20on%20the%20UPN%20location%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3EExample%20would%20be%20us%20looking%20at%20SigninLogs%2C%20OfficeActivity%20and%20AuditLogs.%3C%2FU%3E%3C%2FP%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-markup%22%3E%3CCODE%3Elet%20UserLocation%20%3D%20%22US%20-%20Texas%22%3B%0Alet%20T1SigninLogs%20%3D%0ASigninLogs%0A%7C%20extend%20UserPrincipalName_s%20%3D%20UserPrincipalName%0A%7C%20join%20kind%3D%20inner%20(%0A%20%20%20AADLogTest_CL%0A%20%20%20%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(7d)%0A%20%20%20%7C%20where%20ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s%20%3D%3D%20UserLocation%20%20%0A)%20on%20UserPrincipalName_s%3B%0Alet%20T2AuditLogs%20%3D%0AAuditLogs%0A%7C%20extend%20UserPrincipalName_s%20%3D%20tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)%0A%7C%20join%20kind%3D%20inner%20(%0A%20%20%20AADLogTest_CL%0A%20%20%20%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(7d)%0A%20%20%20%7C%20where%20ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s%20%3D%3D%20UserLocation%20%20%0A)%20on%20UserPrincipalName_s%3B%0Alet%20T3OfficeActivity%20%3D%0AOfficeActivity%20%0A%7C%20extend%20UserPrincipalName_s%20%3D%20UserId%0A%7C%20join%20kind%3D%20inner%20(%0A%20%20%20AADLogTest_CL%0A%20%20%20%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(7d)%0A%20%20%20%7C%20where%20ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s%20%3D%3D%20UserLocation%20%20%0A)%20on%20UserPrincipalName_s%3B%20%0Aunion%20T1SigninLogs%2C%20T2AuditLogs%2C%20T3OfficeActivity%0A%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%3CU%3E%3CSTRONG%3EAzure%20Sentinel%20Playbook%3A%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%0A%3CP%3E%3CU%3E4%20Min%20video%20walking%20through%20Playbook%20design%3A%3C%2FU%3E%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%3CDIV%20class%3D%22video-embed-center%20video-embed%22%3E%3CIFRAME%20class%3D%22embedly-embed%22%20src%3D%22https%3A%2F%2Fcdn.embedly.com%2Fwidgets%2Fmedia.html%3Fsrc%3Dhttps%253A%252F%252Fwww.youtube.com%252Fembed%252F3rb6OoD5wsM%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D3rb6OoD5wsM%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252F3rb6OoD5wsM%252Fhqdefault.jpg%26amp%3Bkey%3Db0d40caa4f094c68be7c29880b16f56e%26amp%3Btype%3Dtext%252Fhtml%26amp%3Bschema%3Dyoutube%22%20width%3D%22600%22%20height%3D%22337%22%20scrolling%3D%22no%22%20title%3D%22YouTube%20embed%22%20frameborder%3D%220%22%20allow%3D%22autoplay%3B%20fullscreen%22%20allowfullscreen%3D%22true%22%3E%3C%2FIFRAME%3E%3C%2FDIV%3E%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20we're%20able%20to%20see%20the%20data%2C%20lets%20build%20an%20Azure%20Sentinel%20playbook%20to%20send%20the%20data%20into%20the%20US%20%E2%80%93%20Texas%20location%20Log%20Analytics%20workspace.%20This%20can%20be%20accomplished%20via%20Azure%20Automation%2C%20PS%20with%20API%E2%80%99s%20another%20easier%20way%20to%20visually%20see%20what%E2%80%99s%20going%20is%20a%20Playbook%20(Logic%20Apps)%20with%20Azure%20Sentinel.%3C%2FP%3E%0A%3CP%3EGoing%20into%20our%20Azure%20Sentinel%20Playbooks%2C%20create%20a%20new%20Playbook%20and%20decide%20how%20you%E2%80%99re%20wanting%20to%20start%20playbook.%20Popular%20choices%20are%20%E2%80%9CRecurrence%E2%80%9D%2C%20%E2%80%9CHTTP%20request%E2%80%9D%2C%20and%20%E2%80%9CAlert%20Triggered%20with%20Azure%20Sentinel%E2%80%9D.%3C%2FP%3E%0A%3CP%3E%3CU%3EFor%20this%20example%2C%20lets%20use%20Recurrence%2C%20every%2030%20mins.%3C%2FU%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Recurrence.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182820i4A2B1AF42D11F1CF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Recurrence.png%22%20alt%3D%22Recurrence.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorChris%20Boehm_6%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EIn%20this%20example%2C%20we're%20not%20going%20to%20dynamically%20fill%20a%20Location%20value%2C%20although%20this%20might%20be%20accomplished%20through%20some%20type%20of%20pull%20or%20alert%20or%20HTTP%20Request.%20Skipping%20that%20part%2C%20lets%20setup%20a%20%E2%80%9CLocation%20Value%E2%80%9D%20with%20the%20Variables%20connector.%20Select%20%E2%80%9CInitialize%20Variable%E2%80%9D%3C%2FP%3E%0A%3CP%3E%3CU%3EConfigure%20the%20following%3A%3C%2FU%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EName%3C%2FLI%3E%0A%3CLI%3EType%20%3A%20String%3C%2FLI%3E%0A%3CLI%3EValue%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CDIV%20id%3D%22tinyMceEditorChris%20Boehm_7%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ENow%20to%20collect%20the%20information%2C%20we%20could%20use%20the%20Log%20Analytics%20API%20although%20I%E2%80%99m%20going%20to%20utilize%20the%20Log%20Analytics%20connector%20for%20querying%20information%20to%20simplify%20the%20process.%20Find%20%E2%80%9CAzure%20Monitor%20Logs%E2%80%9D%2C%20Select%20%E2%80%9CRun%20Query%20and%20List%20Results%E2%80%9D%3C%2FP%3E%0A%3CP%3E%3CU%3EConfigure%20the%20following%3A%20We%E2%80%99re%20using%20the%20Workspace%20the%20AAD%20information%20has%20been%20sent%20to.%3C%2FU%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESubscription%3A%20Workspace%20Sub%3C%2FLI%3E%0A%3CLI%3EResourceGroup%3A%20Workspace%20Resource%20Group%3C%2FLI%3E%0A%3CLI%3EResourceType%20%3A%20Log%20Analytics%20Workspace%3C%2FLI%3E%0A%3CLI%3EResourceName%3A%20Workspace%20Name%3C%2FLI%3E%0A%3CLI%3EQuery%20%3CEM%3EExample%3C%2FEM%3E%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-markup%22%3E%3CCODE%3ESigninLogs%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(30m)%0A%7C%20extend%20UserPrincipalName_s%20%3D%20UserPrincipalName%0A%7C%20join%20kind%3D%20inner%20(%0A%20%20%20AADLogTest_CL%0A%20%20%20%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(7d)%0A%20%20%20%7C%20where%20ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s%20%3D%3D%20%22%40%7Bvariables('Location')%7D%22%0A)%20on%20UserPrincipalName_s%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ETime%20Range%3A%20Set%20in%20query%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%22LogAQuery%20(2).png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183600i07A036FC9BE259C3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22LogAQuery%20(2).png%22%20alt%3D%22LogAQuery%20(2).png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIn%20the%20query%20we%E2%80%99ve%20configured%20to%20only%20look%20at%20Signinlogs%20to%20test%20the%20failure%20of%20login%E2%80%99s%2C%20like%20I%20showed%20earlier%20this%20could%20be%20expanded%20to%20include%20multiple%20tables%20when%20pulling%20information.%20We%E2%80%99re%20not%20caring%20about%20what%20user%2C%20unless%20the%20username%20has%20the%20approved%20value%20when%20we%E2%80%99re%20using%20the%20ExtensionProperty_UserLocation%20to%20match%20%E2%80%9CUS%20%E2%80%93%20Texas%E2%80%9D.%20I%E2%80%99m%20planning%20on%20only%20updating%20my%20AAD%20tables%20once%20a%20week%2C%20why%20I%E2%80%99ve%20configured%20it%20look%20back%207%20days%2C%20and%20I%E2%80%99m%20wanting%20only%20the%20past%2030%20mins%20of%20information%20to%20limit%20my%20window.%20This%20could%20be%20bigger%20or%20smaller%2C%20although%20to%20prevent%20repeating%20information%20setting%20a%20window%20would%20be%20better%20during%20reoccurring%20of%20pulling%20information%20over.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorChris%20Boehm_8%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ENow%20to%20compose%20the%20data%20to%20be%20ingested%20into%20Log%20Analytics%20again%2C%20the%20information%20I%E2%80%99m%20wanting%20is%20the%20%E2%80%9Cvalues%E2%80%9D%20collected.%20So%20it%E2%80%99ll%20look%20something%20like%20this%20%C3%A0%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorChris%20Boehm_9%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Compose.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182823i5748E40211ECD7C2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Compose.png%22%20alt%3D%22Compose.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ENow%20to%20send%20the%20data%20over%20to%20another%20workspace%2C%20or%20the%20same%20workspace.%20We%E2%80%99re%20going%20to%20build%20a%20new%20custom%20table%20for%20enrichment%20of%20information%20called%20%E2%80%9CUSTexasData%E2%80%9D%20and%20send%20the%20outputs%20we%E2%80%99ve%20filtered%20into%20this%20workspace.%3C%2FP%3E%0A%3CP%3EConfigure%20the%20following%3A%20We%E2%80%99re%20using%20the%20Workspace%20you%E2%80%99re%20wanting%20to%20send%20the%20filtered%20information%20to%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EJSON%20Request%20Body%20%3A%20Outputs%20from%20Compose%3C%2FLI%3E%0A%3CLI%3ECustom%20Log%20Name%3A%20Whatever%20Custom%20log%20name%20you%E2%80%99re%20wanting%20to%20use%3C%2FLI%3E%0A%3CLI%3EConnect%20to%20%3A%20Confirm%20the%20connection%20you%E2%80%99re%20wanting%20to%20connect%20to%2C%20%3CFONT%20color%3D%22%23ff0000%22%3Emake%20sure%20whatever%20account%20you%E2%80%99re%20using%20has%20the%20correct%20access%20to%20write%20to%20this%20workspace%20when%20building%20that%20connection.%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EExample%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SendData.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182824i197B5B51ADDB8B92%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22SendData.png%22%20alt%3D%22SendData.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ETo%20create%20some%20noise%2C%20attempt%20to%20unsucessfully%20login%20to%20the%20account%20we're%20monitoring%2CAdelev's%20account%20in%20this%20example%2C%20we%20should%20now%20see%20a%20new%20collection%20of%20data%20after%20the%2030%20min%20window%20automatically%20to%20this%20table%20configured%20in%20the%20logic%20app%20(USTexasData_CL)%3A%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%22USTexasData.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182826i3C8CF2FC63D36966%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22USTexasData.png%22%20alt%3D%22USTexasData.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorChris%20Boehm_11%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EWe've%20now%20successfully%20filtered%20our%20our%20users%20that%20are%20at%20the%20US%20-%20Texas%20location%20and%20sent%20these%20logs%20over%20to%20a%20new%20custom%20table.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20anyone%20has%20any%20other%20requests%20on%20what%20to%20be%20blogged%20about%2C%20please%20feel%20free%20to%20reply%20to%20this%20blog%20post.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EChris%20Boehm%3C%2FP%3E%0A%3CP%3ECustomer%20Experience%20Engineering%20-%20Azure%20Sentinel%20Team.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22http%3A%2F%2Flinkedin.com%2Fin%2Fchrisboehmii%2F%20%20%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELinkedin%20Profile%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1288805%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20you%20need%20to%20split%20your%20Azure%20Sentinel%20tables%20based%20on%20the%20department%20a%20user%20belongs%20to%3F%20Ensure%20an%20overseas%20compliance%20office%20has%20access%20only%20to%20Office%20365%20logs%20for%20his%20subsidiary%3F%26nbsp%3BIn%20this%20blog%20post%2C%20I%20will%20share%20a%20solution%20for%20this%20challenge.%20I'm%20walking%20you%20though%20the%20steps%20of%20sending%20AAD%20enrichment%20information%20via%20a%20PowerShell%20script%20to%20Azure%20Sentinel%2C%20enriching%20data%20tables%20with%20Kusto%20query%20language%20and%20sending%20the%20information%20collected%20to%20a%20new%20Log%20Analytics%20table%20by%20the%20power%20of%20Playbooks.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22FLowchart.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F183626iC1FE468AFD06760B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22FLowchart.jpg%22%20alt%3D%22FLowchart.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1288805%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1377352%22%20slang%3D%22en-US%22%3ERe%3A%20Enriching%20Azure%20Sentinel%20with%20Azure%20AD%20information%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1377352%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89690%22%20target%3D%22_blank%22%3E%40Chris%20Boehm%3C%2FA%3E%26nbsp%3B%20Hey%20Chris%2C%20have%20you%20added%20%3CU%3E%3CSTRONG%3EAAD%20Ingestion%3C%2FSTRONG%3E%20script%20to%20the%20Github.%20I%20would%20appreciate%20if%20you%20can%20add%20it%20there%20please.%3C%2FU%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Howdy Everyone!

 

As organizations are migrating over to Azure Sentinel as their primary SIEM solution, they are looking at ways to enrich their data. For example associating Azure Activity logs or Office 365 Data with an organizational unit derived from Azure AD. Such enrichment enables filtering the information based on organizational units.

 

In this walk-through, I will demonstrate how to import Azure AD information which includes the subsidiary association of users as an extension property to Azure Sentinel. I will than use a join query to enrich event data and use the enrichment information to split up events based on subsidiary. This will enable me to send the data to a separate workspace representing the subsidiary owned date store.

 

Special Thanks!

Yaniv Shasha- Thank you for the assistance on creating the automation scripts with Azure Function.

https://www.linkedin.com/in/yanivshasha/ 

Jim Britt - Thank you for assistance of co-working this problem together and your PS Module.

https://www.linkedin.com/in/jimbritt/

 

Requirements:

Workspace and Log Permissions:

You’ll be needing API permissions for the Log Analytics workspace: More details here , I’ll personally be using the Log Analytics Contributor role. For my example, I’m using AAD permissions, please make sure you have the appropriate permissions when pulling your data. AAD Roles here if your pulling data from Azure AD.

 

PS Modules I’m using with PowerShell:

 

Walking through the test AAD Ingestion:

Based on the goal above, I’m looking at getting all the tenant AAD Attributes into Azure Sentinel to enrich my current dataset. As there is no native "data connector" for AAD Attributes we’ll have to build our own connector.

 

We have a few options of ingesting data into Log Analytics, those all centered on the API Log Analytics offers. Examples are Data connector with Logic Apps, PS Module or even the raw API with Scripting. We'll be using  and work on automation after. Playbooks can be a simple option as well, could even automate this pulling of this information with playbooks, although Azure Automation or Scripting can be cheaper if you’re expecting to Query/Format/Push lots of data into an Log Analytics workspace. I'm planning on submitting unformatted information into Log Analytics from AAD.

 

Starting with PowerShell:

This section is walking through the process with manually running PowerShell to ingest data. The scripts mentioned in this walk-through will be added to the Azure Sentinel Github Community: Link to Community.

 

3 min video explaining the process through PowerShell:

Getting started we'll need to connect to Azure Active Directory via the AzureAD Powershell Module.

 

 

 

Connect-AzureAD -AccountId <UPN> -TenantId <Tenant GUID>

 

 

 

Connect.png

I’m going to collect all the AzureAD Users and store it into a variable of $UsersCollected

 

 

$UsersCollected = Get-AzureADUser -All $True

 

 

Feel free to look at the variable, we’re needing this to be in JSON format to ingest the data cleanly. Going to make another variable to make my future scripting easier.

 

 

$JsonUserFormat = ConvertTo-Json $UsersCollected

 

 

Now all the information collected from the Azure AD Tenant has collected, we’re needing to test the ingestion into the Log Analytics workspace Azure Sentinel is using. You’ll need the following information:

  • $CustomerID : <Log Analytics WORKSPACE ID>
  • $SharedKey : <Log Analytics Primary Key>
  • $JsonUserFormat
  • $logType = “AADLogTest”
    • Important, this is the custom table field the logs will be ingested in.

(Optional)

  • $TimeStampfield = Get-Date
    • Will show the time of the ingestion

Copy and paste the below, update with your workspace information:

 

 

$CustomerID = ‘<WORKSPACE ID>’
$SharedKey = ‘<WORKSPACE KEY>’
$logType = “<WORKSPACE CUSTOM TABLE NAME>”
$TimeStampfield = Get-Date

 

 

Variables.png

Now using the OMSAPI Module, send the data to the Log Analytics workspace.

 

 

Send-OMSAPIIngestionFile -customerId $customerId -sharedKey $sharedKey -body $JsonUserFormat -logType $logType -TimeStampField $Timestampfield

 

 

OMSAPI.png

Accepting the data will be very quick, the very first time it can take up to 20-30 mins for the table to be build into the Log Analytics workspace.

Looking at the data with-in Azure Sentinel’s log Analytics workspace:

 

AADLogTest.png

You’ll see above the Custom Logs table has been crated, and I was able to query the information.

 

An example user in my domain, Adele Vance, this user has been preconfigured with an ExtensionProperty that tells us her home office location. We're interested in enriching our Azure Sentinel alerts with this property.

Looking up her name, we found her Azure Active Directory Attributes information, then filtered the query down to the information we're currently interested in:

 

 

 

AADLogTest_CL
| where UserPrincipalName_s contains "adelev"
| project UserPN = UserPrincipalName_s, ObjectId = ObjectId_g, UserType = UserType_s, CompanyLocation = ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s

 

 

AdelevTest.png

Now seeing the information we're wanting, lets join the “CompanyLocation” property with the UPN with other data sets. We're going to use SigninLogs, as she's just been complained about login failure's to her account multiple times with the wrong password.

 

Here is an example of joining the data together with SigninLogs query example:

 

 

SigninLogs
| where UserPrincipalName contains "adelev"
| project UserPrincipalName_s = UserPrincipalName, Status, Location, IPAddress, Identity, ResultDescription
| join kind= inner (
   AADLogTest_CL
) on UserPrincipalName_s
| project Username_S = UserPrincipalName_s, Status, Location, IPAddress, Identity, ResultDescription, ObjectId = ObjectId_g, UserType = UserType_s, CompanyLocation = ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s

 

 

AdelevTestwSigninLogs.png

Going one step further; we could look at multiple data sets and query out the information based on the UPN location:

 

Example would be us looking at SigninLogs, OfficeActivity and AuditLogs.

 

 

let UserLocation = "US - Texas";
let T1SigninLogs =
SigninLogs
| extend UserPrincipalName_s = UserPrincipalName
| join kind= inner (
   AADLogTest_CL
   | where TimeGenerated >= ago(7d)
   | where ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s == UserLocation  
) on UserPrincipalName_s;
let T2AuditLogs =
AuditLogs
| extend UserPrincipalName_s = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
| join kind= inner (
   AADLogTest_CL
   | where TimeGenerated >= ago(7d)
   | where ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s == UserLocation  
) on UserPrincipalName_s;
let T3OfficeActivity =
OfficeActivity 
| extend UserPrincipalName_s = UserId
| join kind= inner (
   AADLogTest_CL
   | where TimeGenerated >= ago(7d)
   | where ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s == UserLocation  
) on UserPrincipalName_s; 
union T1SigninLogs, T2AuditLogs, T3OfficeActivity

 

 

 

Azure Sentinel Playbook:

4 Min video walking through Playbook design:

 

Now that we're able to see the data, lets build an Azure Sentinel playbook to send the data into the US – Texas location Log Analytics workspace. This can be accomplished via Azure Automation, PS with API’s another easier way to visually see what’s going is a Playbook (Logic Apps) with Azure Sentinel.

Going into our Azure Sentinel Playbooks, create a new Playbook and decide how you’re wanting to start playbook. Popular choices are “Recurrence”, “HTTP request”, and “Alert Triggered with Azure Sentinel”.

For this example, lets use Recurrence, every 30 mins.

Recurrence.png

 

In this example, we're not going to dynamically fill a Location value, although this might be accomplished through some type of pull or alert or HTTP Request. Skipping that part, lets setup a “Location Value” with the Variables connector. Select “Initialize Variable”

Configure the following:

  • Name
  • Type : String
  • Value
 

Now to collect the information, we could use the Log Analytics API although I’m going to utilize the Log Analytics connector for querying information to simplify the process. Find “Azure Monitor Logs”, Select “Run Query and List Results”

Configure the following: We’re using the Workspace the AAD information has been sent to.

  • Subscription: Workspace Sub
  • ResourceGroup: Workspace Resource Group
  • ResourceType : Log Analytics Workspace
  • ResourceName: Workspace Name
  • Query Example:

 

 

SigninLogs
| where TimeGenerated >= ago(30m)
| extend UserPrincipalName_s = UserPrincipalName
| join kind= inner (
   AADLogTest_CL
   | where TimeGenerated >= ago(7d)
   | where ExtensionProperty_extension_1fdbfe7a3f344194b08d177c8125ef04_UserLocation_s == "@{variables('Location')}"
) on UserPrincipalName_s

 

 

  • Time Range: Set in query

LogAQuery (2).png

In the query we’ve configured to only look at Signinlogs to test the failure of login’s, like I showed earlier this could be expanded to include multiple tables when pulling information. We’re not caring about what user, unless the username has the approved value when we’re using the ExtensionProperty_UserLocation to match “US – Texas”. I’m planning on only updating my AAD tables once a week, why I’ve configured it look back 7 days, and I’m wanting only the past 30 mins of information to limit my window. This could be bigger or smaller, although to prevent repeating information setting a window would be better during reoccurring of pulling information over.

 

Now to compose the data to be ingested into Log Analytics again, the information I’m wanting is the “values” collected. So it’ll look something like this à

 

Compose.png

Now to send the data over to another workspace, or the same workspace. We’re going to build a new custom table for enrichment of information called “USTexasData” and send the outputs we’ve filtered into this workspace.

Configure the following: We’re using the Workspace you’re wanting to send the filtered information to

  • JSON Request Body : Outputs from Compose
  • Custom Log Name: Whatever Custom log name you’re wanting to use
  • Connect to : Confirm the connection you’re wanting to connect to, make sure whatever account you’re using has the correct access to write to this workspace when building that connection.

Example:

SendData.png

To create some noise, attempt to unsucessfully login to the account we're monitoring,Adelev's account in this example, we should now see a new collection of data after the 30 min window automatically to this table configured in the logic app (USTexasData_CL):

 

USTexasData.png

 

We've now successfully filtered our our users that are at the US - Texas location and sent these logs over to a new custom table.

 

If anyone has any other requests on what to be blogged about, please feel free to reply to this blog post.

 

Thanks!

 

Chris Boehm

Customer Experience Engineering - Azure Sentinel Team.

Linkedin Profile 

5 Comments
Occasional Visitor

Good long source. thanks

Respected Contributor

Seeing some examples with data from the 3rd party connectors would be interesting. 

Microsoft

@Dean Gross - Specifically with AAD Enrichment with a 3rd party connector? Would be more than happy to show an example, is there a specific one you're thinking of? 

Respected Contributor

@Chris Boehm  not necessarily AAD Enrichment, but if there is something that could be done with Okta, Ping, or Duo that could be interesting. I was actually thinking about examples with sources like AWS, F5, Barracuda, Checkpoint etc. Maybe something from each of the major categories of connector types. 

Occasional Visitor

@Chris Boehm  Hey Chris, have you added AAD Ingestion script to the Github. I would appreciate if you can add it there please.