%3CLINGO-SUB%20id%3D%22lingo-sub-1770400%22%20slang%3D%22en-US%22%3EUsing%20Jupyter%20Notebook%20to%20analyze%20and%20visualize%20Azure%20Sentinel%20Analytics%20and%20Hunting%20Queries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1770400%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--1238222986%22%20id%3D%22toc-hId--1238222950%22%20id%3D%22toc-hId--1238222950%22%20id%3D%22toc-hId--1238222950%22%20id%3D%22toc-hId--1238222950%22%3E%3CFONT%20color%3D%22%23003366%22%3EIntroduction%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20Github%3C%2FA%3E%20contains%20out%20of%20the%20box%20detections%2C%20exploration%20queries%2C%20hunting%20queries%2C%20workbooks%2C%20playbooks%20and%20much%20more%20to%20help%20you%20get%20ramped%20up%20with%20Azure%20Sentinel%20and%20provide%20you%20security%20content%20to%20secure%20your%20environment%20and%20hunt%20for%20threats.%26nbsp%3B%20In%20this%20blog%2C%20we%20will%20look%20at%20various%20Detections%20and%20Hunting%20Queries%20published%20in%20our%20public%20GitHub%20Repo%20%2C%20analyze%20and%20visualize%20the%20output%20to%20understand%20current%20MITRE%20ATT%26amp%3BCK%C2%AE%20coverage%2C%20identify%20gaps%20etc.%20The%20goal%20is%20not%20necessarily%20to%20fill%20every%20gap%20but%20strategically%20identify%20opportunities%20to%20increase%20coverage%20to%20additional%20tactics%2C%20identify%20new%20data%20sources%20and%26nbsp%3B%20develop%20detections%20to%20increase%20the%20coverage%20drastically.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20entire%20workflow%20of%20the%20process%20can%20be%20visualized%20as%20shown%20in%20below%20diagram.%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%22Ashwin_Patil_1-1602477048391.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225894iCF50008B0249130B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Ashwin_Patil_1-1602477048391.png%22%20alt%3D%22Ashwin_Patil_1-1602477048391.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20will%20start%20with%20data%20acquisition%20which%20can%20be%20either%20directly%20from%20public%20community%20GitHub%20or%20you%20can%20also%20point%20to%20your%20private%20GitHub%20repository%20with%20queries%20if%20you%20have%20one.%20Another%20option%20is%20to%20use%20Azure%20Sentinel%20REST%20API%20to%20query%20your%20Azure%20Sentinel%20instance%20for%20Rule%20templates%20and%20Saved%20Searches%20which%20contains%20Hunting%20Queries.%20Once%20the%20data%20has%20been%20acquired%2C%20you%20can%20load%20into%20a%20%3CA%20href%3D%22https%3A%2F%2Fpandas.pydata.org%2Fpandas-docs%2Fstable%2Fuser_guide%2Fdsintro.html%23dataframe%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edataframe%3C%2FA%3E%20for%20further%20cleaning%20and%20enrichment%20with%20MITRE%20dataset%20to%20finally%20receive%20some%20structured%20tabular%20data.%26nbsp%3B%20The%20resulting%20dataset%20is%20structured%20into%20tabular%20format%20which%20you%20can%20also%20send%20it%20back%20to%20LogAnalytics%20into%20a%20custom%20logs%20table%20or%20simply%20access%20via%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fexternaldata-operator%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eexternaldata%3C%2FA%3E%20operator%20from%20accessible%20storage.%3C%2FP%3E%0A%3CP%3EThe%20datasets%20can%20also%20be%20visualized%20via%20following%20tools.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fpowerbi%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPowerBI%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Ftutorial-monitor-your-data%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWorkbooks%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EPython%20libraries%20(%3CA%20href%3D%22https%3A%2F%2Fplotly.com%2Fpython%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPlotly%3C%2FA%3E%2C%3CA%20href%3D%22https%3A%2F%2Fmatplotlib.org%2F3.3.0%2Fgallery%2Findex.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%26nbsp%3Bmatplotlib%3C%2FA%3E).%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWith%20the%20structured%20datasets%2C%20you%20can%20also%20create%20ATT%26amp%3BCK%20navigation%20layer%20json%20files%20to%20visualize%20it%20as%20an%20embedded%20iFrame%20within%20a%20Jupyter%20notebook%20or%20in%20independently%20in%20a%20browser.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1249289847%22%20id%3D%22toc-hId-1249289883%22%20id%3D%22toc-hId-1249289883%22%20id%3D%22toc-hId-1249289883%22%20id%3D%22toc-hId-1249289883%22%3E%3CFONT%20color%3D%22%23003366%22%3EData%20Acquisition%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3EYou%20can%20retrieve%20Detections%20and%20hunting%20Queries%20via%20below%202%20methods%3A%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1939851321%22%20id%3D%22toc-hId-1939851357%22%20id%3D%22toc-hId-1939851357%22%20id%3D%22toc-hId-1939851357%22%20id%3D%22toc-hId-1939851357%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-132396858%22%20id%3D%22toc-hId-132396894%22%20id%3D%22toc-hId-132396894%22%20id%3D%22toc-hId-132396894%22%20id%3D%22toc-hId-132396894%22%3E%3CFONT%20color%3D%22%23003366%22%3EDownload%20from%20GitHub.%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EIn%20the%20first%20method%2C%20you%20can%20directly%20download%20template%20from%20the%20public%20Azure%20Sentinel%20GitHub%20repo.%20The%20templates%20are%20available%20within%20the%20Analytics%20pane%20and%20must%20be%20explicitly%20enabled%20and%20onboarded.%26nbsp%3B%20Alternatively%2C%20you%20can%20also%20point%20it%20to%20your%20private%20GitHub%20repository%20if%20available.%20If%20you%20want%20to%20read%20more%20about%20Azure%20Sentinel%20DevOps%20process%2C%20refer%20the%20blog%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fdeploying-and-managing-azure-sentinel-as-code%2Fba-p%2F1131928%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EDeploying%20and%20Managing%20Azure%20Sentinel%20as%20Code%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJupyter%20notebook%20will%20start%20with%20Setup%20section%20where%20it%20will%20check%20pre-requisite%2C%20install%20missing%20packages%20and%20set%20up%20the%20environment.%20Initial%20cells%20contains%20function%20definitions%20which%20will%20be%20sequentially%20executed%20at%20later%20stages.%20Later%20you%20will%20come%20at%20Data%20Acquisition%20section.%3C%2FP%3E%0A%3CP%3EIn%20this%20section%2C%20you%20will%20be%20prompted%20for%20folder%20location%20to%20store%20the%20extracted%20files%20(Detections%20and%20Hunting%20Queries).%20By%20default%2C%20it%20will%20create%20a%20folder%20named%20%3CSTRONG%3E%3CEM%3Emitre-attack%3C%2FEM%3E%3C%2FSTRONG%3E%20under%20current%20folder.%20You%20can%20customize%20and%20specify%20location%20if%20you%20want.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJupyter%20notebook%20will%20start%20with%20Setup%20section%20where%20it%20will%20check%20pre-requisite%2C%20install%20missing%20packages%20and%20set%20up%20the%20environment.%20Initial%20cells%20contains%20function%20definitions%20which%20will%20be%20sequentially%20executed%20at%20alter%20stages.%20Later%20you%20will%20come%20at%20Data%20Acquisition%20section.%20In%20this%20section%2C%20you%20will%20be%20prompted%20for%20folder%20location%20to%20store%20the%20extracted%20files%20(Detections%20and%20Hunting%20Queries).%20By%20default%2C%26nbsp%3B%20it%20will%20store%20in%26nbsp%3Bcurrent%20folder.%20You%20can%20customize%20and%20specify%20location%20if%20you%20want%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%2201-downloadpath.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225908i584D63DEC5DA03A0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2201-downloadpath.png%22%20alt%3D%2201-downloadpath.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20python%20function%20named%20%3CSTRONG%3E%3CEM%3Eget_sentinel_queries_from_github()%20%3C%2FEM%3E%3C%2FSTRONG%3Eis%20created%20which%20can%20be%20invoked%20to%20download%20the%20entire%20repository%20and%20only%20extract%20selected%20folder%20(Detection%20and%20Hunting%20Queries)%20in%20previously%20mentioned%20location.%20If%20you%20are%20using%20your%20private%20repo%2C%20provide%20the%20archived%20path%20to%20your%20repo%20in%20%3CSTRONG%3E%3CEM%3Eazsentinel_git_url%3C%2FEM%3E%3C%2FSTRONG%3E%20containing%20Detections%20and%20Hunting%20Queries%20as%20child%20folders.%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%2202-archiveextraction.png%22%20style%3D%22width%3A%20916px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225910i06843F86AD67A5B2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2202-archiveextraction.png%22%20alt%3D%2202-archiveextraction.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20validate%20the%20operation%20is%20successful%20by%20manually%20running%20%25ls%20in%20both%20the%20folders.%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%2203-dir-listings.png%22%20style%3D%22width%3A%20837px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225911i201ACE90DAEF6E87%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2203-dir-listings.png%22%20alt%3D%2203-dir-listings.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1675057605%22%20id%3D%22toc-hId--1675057569%22%20id%3D%22toc-hId--1675057569%22%20id%3D%22toc-hId--1675057569%22%20id%3D%22toc-hId--1675057569%22%3E%3CFONT%20color%3D%22%23003366%22%3ERetrieve%20via%20Azure%20Sentinel%20REST%20API%20%E2%80%93%20Experimental%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EIn%20this%20method%2C%20you%20can%20use%20Azure%20Sentinel%20REST%20API%20to%20query%20your%20existing%20sentinel%20instance.%20For%20more%20information%20on%20using%20REST%20API%2C%20refer%20bog%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fazure-sentinel-api-101%2Fba-p%2F1438928%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EAzure%20Sentinel%20API%20101%3C%2FA%3E.%20This%20section%20is%20currently%20marked%26nbsp%3B%20as%20Experimental%2C%20as%20there%20are%20some%20limitations%20with%20output%20received%20from%20API%20so%20you%20won%E2%80%99t%20be%20able%20to%20get%20same%20level%20of%20granular%20details%20as%20from%20above%20first%20step.%20You%20will%20have%20to%20first%20authenticate%20via%20az%20login.%26nbsp%3B%26nbsp%3B%20Refer%20docs%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fauthenticate-azure-cli%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESign%20in%20with%20Azure%20CLI%3C%2FA%3E%20if%20you%20need%20more%20details.%20%26nbsp%3BOnce%20successfully%20authenticated%2C%20you%20can%20generate%20refresh%20token%20and%20use%20it%20with%20API%20headers%20to%20send%20REST%20API%20query%20to%20%3CU%3E%3CEM%3E%3CSTRONG%3EAlertRuleTemplates%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FU%3E%20and%20%3CU%3E%3CEM%3E%3CSTRONG%3ESavedSeaches%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FU%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3E%3CSTRONG%3EKnown%20API%20Limitations%3A%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EHunting%20Query%20is%20currently%20not%20part%20of%20REST%20API%20which%20is%20GA%2C%20but%20you%20can%20use%20LogAnalytics%20REST%20API%20saved%20searches%20and%20then%20filter%20out%20Hunting%20Queries.%3C%2FLI%3E%0A%3CLI%3EIn%20both%20cases%2C%20the%20data%20retrieved%20from%20savedSearches%20and%20AlertRuleTemplates%2C%20only%20Tactics%20is%20available%20and%20not%20techniques.%20You%20may%20have%20to%20pull%20techniques%20by%20joining%20with%20Github%20Dataset%20if%20rule%20template%20is%20available.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EBelow%20is%20stripped%20section%20of%20sample%20output%20retrieved%20from%20REST%20API%20%E2%80%93%20AlertRuleTemplates%20and%20hunting%20queries.%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%2204-alert-via-api.png%22%20style%3D%22width%3A%20708px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225912i5948451B2B8AF3C0%2Fimage-dimensions%2F708x295%3Fv%3D1.0%22%20width%3D%22708%22%20height%3D%22295%22%20role%3D%22button%22%20title%3D%2204-alert-via-api.png%22%20alt%3D%2204-alert-via-api.png%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%2205-huntingqueries-via-api.png%22%20style%3D%22width%3A%20716px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225913i22CC91CA80A12FBF%2Fimage-dimensions%2F716x341%3Fv%3D1.0%22%20width%3D%22716%22%20height%3D%22341%22%20role%3D%22button%22%20title%3D%2205-huntingqueries-via-api.png%22%20alt%3D%2205-huntingqueries-via-api.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1685560709%22%20id%3D%22toc-hId--1685560673%22%20id%3D%22toc-hId--1685560673%22%20id%3D%22toc-hId--1685560673%22%20id%3D%22toc-hId--1685560673%22%3E%3CFONT%20color%3D%22%23003366%22%3EData%20Cleaning%20and%20Enrichment%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3EOnce%20you%20acquire%20the%20data%2C%20you%20will%20have%20to%20perform%20various%20data%20cleaning%20steps%20to%20be%20eligible%20for%20analysis.%20All%20the%20published%20rule%20templates%20are%20in%20YAML%20format%2C%20which%20is%20already%20structured%2C%20but%20the%20values%20are%20often%20multiple%20in%20array%20or%20array%20of%20dictionary%20format.%20You%20will%20have%20to%20flatten%20these%20values%20to%20create%20dataset.%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-1503016702%22%20id%3D%22toc-hId-1503016738%22%20id%3D%22toc-hId-1503016738%22%20id%3D%22toc-hId-1503016738%22%20id%3D%22toc-hId-1503016738%22%3E%26nbsp%3B%3C%2FH4%3E%0A%3CH4%20id%3D%22toc-hId--304437761%22%20id%3D%22toc-hId--304437725%22%20id%3D%22toc-hId--304437725%22%20id%3D%22toc-hId--304437725%22%20id%3D%22toc-hId--304437725%22%3E%3CFONT%20color%3D%22%23003366%22%3EYAML%20Parsing%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3EIn%20the%20first%20step%2C%20we%20will%20parse%20all%20the%20YAML%20files%20and%20load%20it%20into%20dataframe.%20The%20Dataframe%20is%20nothing%20but%20a%20Python%20data%20structure%20similar%20to%20a%20spreadsheet%20in%20rows%20and%20column%20format.%20You%20can%20read%20more%20about%20dataframe%20datastructure%20at%20%3CA%20href%3D%22https%3A%2F%2Fpandas.pydata.org%2Fpandas-docs%2Fstable%2Fuser_guide%2Fdsintro.html%23dataframe%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIntro%20to%20data%20structures%20-%20DataFrame%3C%2FA%3E.%20We%20have%20created%20a%20Python%20function%20named%20%3CSTRONG%3E%3CEM%3Eparse_yaml()%3C%2FEM%3E%3C%2FSTRONG%3E%20which%20will%20take%20a%20folder%20containing%20YAML%20files.%20We%20will%20parse%20the%20files%20from%20both%20Detections%20and%20Hunting%20Queries%20and%20join%20both%20datasets.%20While%20doing%20this%20operation%2C%20we%20will%20also%20create%20additional%20columns%20to%20extend%20the%20YAML%20schema%2C%20such%20as%20GithubURL%20%2C%20IngestedDate%2C%20Detection%20Type%2C%20Detection%20Service%20etc.%20Finally%2C%20when%20you%20run%20this%20function%2C%20with%20some%20additional%20cleanup%2C%20it%20will%20display%20status%20similar%20to%20below.%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%2206-githubstats.png%22%20style%3D%22width%3A%20909px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225914iB4EE2BB9C1FC4153%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2206-githubstats.png%22%20alt%3D%2206-githubstats.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--2111892224%22%20id%3D%22toc-hId--2111892188%22%20id%3D%22toc-hId--2111892188%22%20id%3D%22toc-hId--2111892188%22%20id%3D%22toc-hId--2111892188%22%3E%3CFONT%20color%3D%22%23003366%22%3EClean%20and%20Preprocess%20Data%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3EOnce%20you%20have%20parsed%20the%20yaml%20files%20and%20load%20it%20into%20dataframe%2C%20we%20will%20further%20clean%20and%20preprocess%20the%20data.%20Example%20operations%20in%20this%20step%20can%20be%20as%20detailed%20below.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESeparate%20existing%20columns%20and%20derive%20new%20columns%20such%20as%20ConnectorId%2C%20DataTypes.%3C%2FLI%3E%0A%3CLI%3ESeparating%20Null%20and%20valid%20ConnectorId%20values.%3C%2FLI%3E%0A%3CLI%3EExpanding%20the%20columns%20(ConnectorId%2C%20DataTypes%2C%20Tactics%2C%20relevantTechniques%20)%20which%20have%20multiple%20values%20assigned%20as%20array%20into%20separate%20rows%20for%20easier%20analysis.%3C%2FLI%3E%0A%3CLI%3EPopulate%20new%20column%20as%20Platform%20which%20will%20be%20based%20on%20custom%20mapping%20based%20on%20ConnectorId%20values%20e.g.%20AWSCloudTrail%20to%20AWS%20etc.%26nbsp%3B%20Snippet%20of%20example%20mapping%20is%20shown%20as%20below.%20This%20mapping%20can%20be%20changed%20to%20customize%20to%20your%20environment.%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%2206-Platformmapping.png%22%20style%3D%22width%3A%20540px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225915i596AD416DBCF4812%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2206-Platformmapping.png%22%20alt%3D%2206-Platformmapping.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20then%20invoke%20function%20%3CSTRONG%3E%3CEM%3Eclean_and_preprocess_data()%20%3C%2FEM%3E%3C%2FSTRONG%3Eto%20execute%20this%20step.%20This%20function%20will%20return%20the%20dataset%20after%20cleaning%20and%20pre-processing%20original%20yaml%20files.%20We%20will%20also%20join%20the%20fusion%20dataset%20to%20the%20result%20dataset%20to%20create%20final%20dataset.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBelow%20is%20example%20output%20from%20this%20step.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2207-CleanandPreprocessdata.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225916i9B0A993426E9DFE3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2207-CleanandPreprocessdata.png%22%20alt%3D%2207-CleanandPreprocessdata.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-375620609%22%20id%3D%22toc-hId-375620645%22%20id%3D%22toc-hId-375620645%22%20id%3D%22toc-hId-375620645%22%20id%3D%22toc-hId-375620645%22%3E%3CFONT%20color%3D%22%23003366%22%3EEnrich%20with%20MITRE%20Matrix%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3ETo%20find%20gaps%20in%20coverage%20%2C%20our%20original%20dataset%20needs%20to%20be%20joined%20with%20master%20dataset%20from%20%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMITRE%20ATT%26amp%3BCK%20matrix%3C%2FA%3E%26nbsp%3B.%20We%20have%20created%20a%20function%20%3CSTRONG%3E%3CEM%3Eget_mitre_matrix_flat()%3C%2FEM%3E%3C%2FSTRONG%3E%20that%20uses%20the%20Python%20library%20%3CA%20href%3D%22https%3A%2F%2Fpypi.org%2Fproject%2Fattackcti%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eattackcti%3C%2FA%3E%20underneath%20with%20an%20additional%20data%20wrangling%20steps%20to%20return%20flat%20table%20as%20dataframe.%3C%2FP%3E%0A%3CP%3EBelow%20is%20example%20output%20from%20this%20function.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2207-Mitre-matrix-flat.png%22%20style%3D%22width%3A%20746px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225917i1F0DC4FD6C7780F7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2207-Mitre-matrix-flat.png%22%20alt%3D%2207-Mitre-matrix-flat.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--200963255%22%20id%3D%22toc-hId--200963219%22%20id%3D%22toc-hId--200963219%22%20id%3D%22toc-hId--200963219%22%20id%3D%22toc-hId--200963219%22%3E%3CFONT%20color%3D%22%23003366%22%3EMerge%20preprocessed%20dataset%20with%20mitre%20datasets%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3EIn%20this%20step%2C%20we%20will%20merge%20our%20cleaned%20preprocessed%20dataset%20with%20the%20Mitre%20dataset.%20The%20resulting%20dataset%20will%20have%20our%20detections%20and%20hunting%20queries%20mapped%20to%20existing%20tactics%20%26amp%3B%20techniques%2C%20and%20will%20have%20blank%20lines%20where%20there%20are%20no%20matches.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2209-Merge-data.png%22%20style%3D%22width%3A%20441px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225918iF3F5A3E9E4B6E54D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2209-Merge-data.png%22%20alt%3D%2209-Merge-data.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20renaming%20columns%20and%20normalizing%20the%20datasets%2C%20output%20will%20look%20like%20the%20one%20below.%3C%2FP%3E%0A%3CP%3ERemember%20you%20can%20have%20multiple%20rows%20for%20single%20detection%20if%20it%20has%20different%20values%20in%20Platform%2C%20ConnectorId%2C%20DataTypes.%20The%20resulting%20dataset%20will%20have%20single%20value%20in%20these%20columns%20so%20that%20it%20can%20be%20effectively%20analyzed%20and%20visualized.%20You%20can%20always%20aggregate%20them%20back%20into%20list%2Farray%20to%20single%20row%20per%20detection.%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%2210-displayresults.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225919iBD49F5317D5BBFCA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2210-displayresults.png%22%20alt%3D%2210-displayresults.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-2028384140%22%20id%3D%22toc-hId-2028384176%22%20id%3D%22toc-hId-2028384176%22%20id%3D%22toc-hId-2028384176%22%20id%3D%22toc-hId-2028384176%22%3E%3CFONT%20color%3D%22%23003366%22%3EScraping%20Detection%20List%20of%20Microsoft%20Threat%20Protection%20Portfolio%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3EMicrosoft%20has%20a%20variety%20of%20threat%20protection%20solutions%20in%20its%20portfolio.%20Depending%20upon%20licenses%20you%20may%20have%20one%20or%20multiple%20of%20these%20enabled%20in%20your%20environment.%20Azure%20Sentinel%20natively%20integrates%20with%20these%20solutions%20and%20ingests%20rules%20once%20connected%20under%20SecurityAlerts%20table.%20Some%20of%20these%20solutions%26nbsp%3B%20have%20published%20documentation%20on%20available%20rules%20under%20each%20on%20Microsoft%20docs%20website.%20These%20details%20can%20be%20easily%20scraped%20programmatically%20and%20create%20a%20result%20dataset.%20As%20we%20find%20more%20documentation%2C%20we%20will%20add%20other%20products%20to%20this%20list.%20Currently%20below%20services%20have%20rules%20published.%3C%2FP%3E%0A%3CP%3EWe%20have%20created%20python%20function%20for%20each%20of%20these%20and%20sample%20output%20are%20as%20shown%20below.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Defender%20(previously%20ASC)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsecurity-center%2Falerts-reference%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsecurity-center%2Falerts-reference%3C%2FA%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%2211-azure-defender.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225920i077F98D7E55F3DBF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2211-azure-defender.png%22%20alt%3D%2211-azure-defender.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Identity%20Protection%20Center%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fidentity-protection%2Fconcept-identity-protection-risks%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fidentity-protection%2Fconcept-identity-protection-risks%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212-azure-ipc.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225921iA3592AE4D8FF6AFF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2212-azure-ipc.png%22%20alt%3D%2212-azure-ipc.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Defender%20for%20Identity%20(previously%20AATP)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure-advanced-threat-protection%2Fsuspicious-activity-guide%3Ftabs%3Dexternal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure-advanced-threat-protection%2Fsuspicious-activity-guide%3Ftabs%3Dexternal%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2213-azure-defender-identity.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225922i430E39F83A5A2C7A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2213-azure-defender-identity.png%22%20alt%3D%2213-azure-defender-identity.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EMicrosoft%20Cloud%20Application%20Security%20(MCAS)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcloud-app-security%2Finvestigate-anomaly-alerts%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcloud-app-security%2Finvestigate-anomaly-alerts%3C%2FA%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%2214-mcas.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225923i7B66FF06FCD200BA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2214-mcas.png%22%20alt%3D%2214-mcas.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20later%20combine%20all%20above%20datasets%20into%20single%20dataframe%2C%20and%20display%20results%20as%20shown%20below.%3C%2FP%3E%0A%3CP%3EThis%20dataframe%20can%20be%20further%20used%20in%20visualization%20section.%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%2215-merge-all-msft.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225924iB8509720EF3E22E8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2215-merge-all-msft.PNG%22%20alt%3D%2215-merge-all-msft.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-220929677%22%20id%3D%22toc-hId-220929713%22%20id%3D%22toc-hId-220929713%22%20id%3D%22toc-hId-220929713%22%20id%3D%22toc-hId-220929713%22%3E%3CFONT%20color%3D%22%23003366%22%3EData%20Visualization%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3ENow%2C%20we%20have%20all%20the%20data%20into%20a%20structured%20format%2C%20we%20can%20visualize%20it%20in%20a%20number%20of%20different%20ways%20and%20tools.%20The%20data%20can%20be%20sent%20back%20to%20LogAnalytics%20into%20custom%20table%20and%20later%20be%20visualized%20via%20either%20PowerBI%20or%20native%20Azure%20Sentinel%20Workbooks.%20Or%20you%20can%20also%20leverage%20the%20power%20of%20various%20Python%20visualization%20libraries%20within%20a%20Jupyter%20notebook.%20In%20the%20below%20screenshots%2C%20we%20have%20used%20matplotlib%20to%20visualize%20it%20as%20a%20heatmap%2C%20and%20used%20Plotly%20to%20visualize%20it%20into%20radar%20plots%2C%20donut%20charts%20etc.%20From%20the%20structured%20dataset%2C%20we%20can%20also%20automatically%20create%20ATT%26amp%3BCK%20navigation%20layer%20json%20files.%20These%20json%20files%20can%20be%20visualized%20as%20embedded%20iFrames%20within%20a%20Jupyter%20notebook%20or%20independently%20in%20a%20browser%20window.%20Check%20out%20below%20gif%20walkthrough%20of%26nbsp%3B%20visualizations.%20You%20can%20also%20check%20the%20%3CA%20href%3D%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FSample%2520Data%2FMITRE%2520ATT%2526CK%2FMITRE%2520ATT%2526CK%2520for%2520Azure%2520Sentinel.ipynb%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Enotebook%3C%2FA%3E%20directly%20for%20more%20static%20and%20interactive%20view.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1457442067%22%20id%3D%22toc-hId--1457442031%22%20id%3D%22toc-hId--1457442031%22%20id%3D%22toc-hId--1457442031%22%20id%3D%22toc-hId--1457442031%22%3E%3CFONT%20color%3D%22%23003366%22%3EAlerts%20Table%20Viewer%20%E2%80%93%20Jupyter%20Widget%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Part%205%20Data%20Viz-%20Jupyter%20widget.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225946i5FBFDF258CB7FA06%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Part%205%20Data%20Viz-%20Jupyter%20widget.gif%22%20alt%3D%22Part%205%20Data%20Viz-%20Jupyter%20widget.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1030070766%22%20id%3D%22toc-hId-1030070802%22%20id%3D%22toc-hId-1030070802%22%20id%3D%22toc-hId-1030070802%22%20id%3D%22toc-hId-1030070802%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--777383697%22%20id%3D%22toc-hId--777383661%22%20id%3D%22toc-hId--777383661%22%20id%3D%22toc-hId--777383661%22%20id%3D%22toc-hId--777383661%22%3E%3CFONT%20color%3D%22%23003366%22%3EHeatmaps%20using%20Matplotlib.%3C%2FFONT%3E%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-1710129136%22%20id%3D%22toc-hId-1710129172%22%20id%3D%22toc-hId-1710129172%22%20id%3D%22toc-hId-1710129172%22%20id%3D%22toc-hId-1710129172%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Part%205%20Data%20Viz-Heatmap.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225945i3755ADA116C1BA10%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Part%205%20Data%20Viz-Heatmap.gif%22%20alt%3D%22Part%205%20Data%20Viz-Heatmap.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--97325327%22%20id%3D%22toc-hId--97325291%22%20id%3D%22toc-hId--97325291%22%20id%3D%22toc-hId--97325291%22%20id%3D%22toc-hId--97325291%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1904779790%22%20id%3D%22toc-hId--1904779754%22%20id%3D%22toc-hId--1904779754%22%20id%3D%22toc-hId--1904779754%22%20id%3D%22toc-hId--1904779754%22%3E%3CFONT%20color%3D%22%23003366%22%3EATT%26amp%3BCK%20Navigator%20Embedded%20Iframe%20view%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Part%205%20Data%20Viz%20-ATTACK%20Navigator.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225944iFF6DBBFB5F621D81%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Part%205%20Data%20Viz%20-ATTACK%20Navigator.gif%22%20alt%3D%22Part%205%20Data%20Viz%20-ATTACK%20Navigator.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-582733043%22%20id%3D%22toc-hId-582733079%22%20id%3D%22toc-hId-582733079%22%20id%3D%22toc-hId-582733079%22%20id%3D%22toc-hId-582733079%22%3E%3CFONT%20color%3D%22%23003366%22%3ERadar%20Plots%20with%20Plotly%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Part%205%20Data%20Viz-Radar%20plots.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225943i6165AC774E154755%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Part%205%20Data%20Viz-Radar%20plots.gif%22%20alt%3D%22Part%205%20Data%20Viz-Radar%20plots.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--526559479%22%20id%3D%22toc-hId--526559443%22%20id%3D%22toc-hId--526559443%22%20id%3D%22toc-hId--526559443%22%20id%3D%22toc-hId--526559443%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-1960953354%22%20id%3D%22toc-hId-1960953390%22%20id%3D%22toc-hId-1960953390%22%20id%3D%22toc-hId-1960953390%22%20id%3D%22toc-hId-1960953390%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-153498891%22%20id%3D%22toc-hId-153498927%22%20id%3D%22toc-hId-153498927%22%20id%3D%22toc-hId-153498927%22%20id%3D%22toc-hId-153498927%22%3E%3CFONT%20color%3D%22%23003366%22%3EDonut%20Plots%20with%20Plotly%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Part%205%20Data%20Viz-Donut%20Charts.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225942i990B815051BB5444%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Part%205%20Data%20Viz-Donut%20Charts.gif%22%20alt%3D%22Part%205%20Data%20Viz-Donut%20Charts.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1653955572%22%20id%3D%22toc-hId--1653955536%22%20id%3D%22toc-hId--1653955536%22%20id%3D%22toc-hId--1653955536%22%20id%3D%22toc-hId--1653955536%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-833557261%22%20id%3D%22toc-hId-833557297%22%20id%3D%22toc-hId-833557297%22%20id%3D%22toc-hId-833557297%22%20id%3D%22toc-hId-833557297%22%3E%3CFONT%20color%3D%22%23003366%22%3EMITRE%20ATT%26amp%3BCK%20Workbook%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3E%3CFONT%20color%3D%22%23003366%22%3EThis%20is%20an%20early%20version%20of%20the%20workbook%20available%20in%20GitHub%26nbsp%3Bwhich%20will%20be%20updated%20further%20for%20a%20more%20mature%20version%20and%20recommended%20instructions%20based%20on%20the%20workspace%20and%20datasources.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MITRE%20Workbook.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225949i0F9E869BBC3F8F52%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MITRE%20Workbook.gif%22%20alt%3D%22MITRE%20Workbook.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1102979921%22%20id%3D%22toc-hId--1102979885%22%20id%3D%22toc-hId--1102979885%22%20id%3D%22toc-hId--1102979885%22%20id%3D%22toc-hId--1102979885%22%3E%3CFONT%20color%3D%22%23003366%22%3EUploading%20Results%20to%20Azure%20Sentinel%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3EThe%20data%20generated%20by%20data%20analysis%20(Alerts%20from%20Microsoft%20Services%20and%20Normalized%20Azure%20Sentinel%20Detections)%20can%20be%20uploaded%20back%20to%20Azure%20Sentinel.%20You%20can%20use%20data%20uploader%20feature%20of%20Msticpy%20for%20this.%20You%20can%20read%20more%20about%20it%20%3CA%20href%3D%22https%3A%2F%2Fmsticpy.readthedocs.io%2Fen%2Flatest%2Fdata_acquisition%2FUploadData.html%23uploading-data-to-azure-sentinel-log-analytics%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUploading%20data%20to%20Azure%20Sentinel%2FLog%20Analytics%3C%2FA%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%2223-Uploadresults.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225934i77F53356AD190BDD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2223-Uploadresults.png%22%20alt%3D%2223-Uploadresults.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1384532912%22%20id%3D%22toc-hId-1384532948%22%20id%3D%22toc-hId-1384532948%22%20id%3D%22toc-hId-1384532948%22%20id%3D%22toc-hId-1384532948%22%3E%3CFONT%20color%3D%22%23003366%22%3EConclusion%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3EAzure%20Sentinel%20provides%20out-of-the%20box%20detection%20and%20hunting%20query%20templates%20via%20its%20public%20GitHub%20repo.%20Currently%20the%20repository%20holds%20around%20362%20queries%20for%20defenders.%20Depending%20on%20the%20environment%20and%20onboarded%20data%20sources%2C%20customer%20can%20choose%20these%20and%20enable%20it%20in%20their%20respective%20Azure%20Sentinel%20instance.%20As%20all%20the%20templates%20are%20already%20mapped%20to%20the%20MITRE%20ATT%26amp%3BCK%20Tactics%20and%20Techniques%2C%20you%20can%20analyze%20and%20visualize%20the%20detection%20coverage%20and%20identify%20potential%20gaps.%20The%20goal%20or%20outcome%20of%20this%20analysis%20is%20not%20necessarily%20to%20fill%20every%20gap%20but%20understand%20the%20coverage%20%2Cidentify%20blind%20spots%20and%20strategically%20make%20decisions%20to%20create%20new%20detections%20or%26nbsp%3B%20onboard%20new%20data%20sources%20to%20increase%20the%20coverage.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESpecial%20thanks%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F313718%22%20target%3D%22_blank%22%3E%40ianhelle%3C%2FA%3E%26nbsp%3B%26nbsp%3Bfor%20Sentinel%20API%20and%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F591947%22%20target%3D%22_blank%22%3E%40Cyb3rWard0g%3C%2FA%3E%26nbsp%3Bfor%20ATT%26amp%3BCK%20Navigation%20layer%20section%20in%20the%20notebook.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--422921551%22%20id%3D%22toc-hId--422921515%22%20id%3D%22toc-hId--422921515%22%20id%3D%22toc-hId--422921515%22%20id%3D%22toc-hId--422921515%22%3E%3CFONT%20color%3D%22%23003366%22%3EReferences%3C%2FFONT%3E%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EMITRE%20ATT%26amp%3BCK%20for%20Azure%20Sentinel%20Resources%20(Notebook%2C%20Supporting%20Files)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FSample%2520Data%2FMITRE%2520ATT%2526CK%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FSample%2520Data%2FMITRE%2520ATT%2526CK%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EMITRE%20ATT%26amp%3BCK%20Workbook%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FWorkbooks%2FMITREAttack.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FWorkbooks%2FMITREAttack.json%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EATT%26amp%3BCK%20Navigator%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmitre-attack%2Fattack-navigator%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmitre-attack%2Fattack-navigator%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESign%20in%20with%20Azure%20CLI%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fauthenticate-azure-cli%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fauthenticate-azure-cli%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EIntro%20to%20Data%20Structures%20-%20DataFrame%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fpandas.pydata.org%2Fpandas-docs%2Fstable%2Fuser_guide%2Fdsintro.html%23dataframe%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fpandas.pydata.org%2Fpandas-docs%2Fstable%2Fuser_guide%2Fdsintro.html%23dataframe%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAutomate%20the%20Creation%20of%20ATT%26amp%3BCK%20Navigator%20Group%20Layer%20Files%20with%20Python%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmedium.com%2Fthreat-hunters-forge%2Fautomate-the-creation-of-att-ck-navigator-group-layer-files-with-python-3b16a11a47cf%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmedium.com%2Fthreat-hunters-forge%2Fautomate-the-creation-of-att-ck-navigator-group-layer-files-with-python-3b16a11a47cf%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EDeploying%20and%20Managing%20Azure%20Sentinel%20as%20Code%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fdeploying-and-managing-azure-sentinel-as-code%2Fba-p%2F1131928%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fdeploying-and-managing-azure-sentinel-as-code%2Fba-p%2F1131928%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Sentinel%20REST%20API%20101%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fazure-sentinel-api-101%2Fba-p%2F1438928%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fazure-sentinel-api-101%2Fba-p%2F1438928%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPlotly%20%E2%80%93%20Radar%20Charts%20in%20Python%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fplotly.com%2Fpython%2Fradar-chart%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fplotly.com%2Fpython%2Fradar-chart%2F%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPlotly%20%E2%80%93%20Donut%20Chart%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fplotly.com%2Fpython%2Fpie-charts%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fplotly.com%2Fpython%2Fpie-charts%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1770400%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3BIn%20this%20blog%2C%20we%20will%20look%20at%20various%20Detections%20and%20Hunting%20Queries%20published%20in%20our%20Public%20GitHub%20Repo%20%2C%20analyze%20and%20visualize%20the%20output%20to%20understand%20current%20MITRE%20ATT%26amp%3BCK%C2%AE%20coverage%2C%20identify%20gaps%20etc%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%22workflow.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225893i66DC4F5D7748482E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workflow.png%22%20alt%3D%22workflow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1774564%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Jupyter%20Notebook%20to%20analyze%20and%20visualize%20Azure%20Sentinel%20Analytics%20and%20Hunting%20Queries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1774564%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20article.%26nbsp%3B%20It%20seems%20that%20you%20repeated%20a%20section%20with%20different%20folder%20names%3A%3C%2FP%3E%3CP%3EJupyter%20notebook%20will%20start%20with%20Setup%20section%20where%20it%20will%20check%20pre-requisite%2C%20install%20missing%20packages%20and%20set%20up%20the%20environment.%20Initial%20cells%20contains%20function%20definitions%20which%20will%20be%20sequentially%20executed%20at%20later%20stages.%20Later%20you%20will%20come%20at%20Data%20Acquisition%20section.%3C%2FP%3E%3CP%3EIn%20this%20section%2C%20you%20will%20be%20prompted%20for%20folder%20location%20to%20store%20the%20extracted%20files%20(Detections%20and%20Hunting%20Queries).%20By%20default%2C%20it%20will%20create%20a%20folder%20named%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%3CEM%3Emitre-attack%3C%2FEM%3E%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eunder%20current%20folder.%20You%20can%20customize%20and%20specify%20location%20if%20you%20want.%26nbsp%3B%3C%2FP%3E%3CP%3EJupyter%20notebook%20will%20start%20with%20Setup%20section%20where%20it%20will%20check%20pre-requisite%2C%20install%20missing%20packages%20and%20set%20up%20the%20environment.%20Initial%20cells%20contains%20function%20definitions%20which%20will%20be%20sequentially%20executed%20at%20alter%20stages.%20Later%20you%20will%20come%20at%20Data%20Acquisition%20section.%20In%20this%20section%2C%20you%20will%20be%20prompted%20for%20folder%20location%20to%20store%20the%20extracted%20files%20(Detections%20and%20Hunting%20Queries).%20By%20default%2C%26nbsp%3B%20it%20will%20store%20in%26nbsp%3Bcurrent%20folder.%20You%20can%20customize%20and%20specify%20location%20if%20you%20want%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1775587%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Jupyter%20Notebook%20to%20analyze%20and%20visualize%20Azure%20Sentinel%20Analytics%20and%20Hunting%20Queries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1775587%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%2F46875%22%20target%3D%22_blank%22%3E%40Gary%20Bushey%3C%2FA%3E%26nbsp%3B%20for%20reading%20and%20letting%20me%20know.%26nbsp%3B%20I%20have%20now%20corrected%20the%20post.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Introduction

Azure Sentinel Github contains out of the box detections, exploration queries, hunting queries, workbooks, playbooks and much more to help you get ramped up with Azure Sentinel and provide you security content to secure your environment and hunt for threats.  In this blog, we will look at various Detections and Hunting Queries published in our public GitHub Repo , analyze and visualize the output to understand current MITRE ATT&CK® coverage, identify gaps etc. The goal is not necessarily to fill every gap but strategically identify opportunities to increase coverage to additional tactics, identify new data sources and  develop detections to increase the coverage drastically.

 

The entire workflow of the process can be visualized as shown in below diagram.

 

Ashwin_Patil_1-1602477048391.png

 

We will start with data acquisition which can be either directly from public community GitHub or you can also point to your private GitHub repository with queries if you have one. Another option is to use Azure Sentinel REST API to query your Azure Sentinel instance for Rule templates and Saved Searches which contains Hunting Queries. Once the data has been acquired, you can load into a dataframe for further cleaning and enrichment with MITRE dataset to finally receive some structured tabular data.  The resulting dataset is structured into tabular format which you can also send it back to LogAnalytics into a custom logs table or simply access via externaldata operator from accessible storage.

The datasets can also be visualized via following tools.

With the structured datasets, you can also create ATT&CK navigation layer json files to visualize it as an embedded iFrame within a Jupyter notebook or in independently in a browser.

 

Data Acquisition

You can retrieve Detections and hunting Queries via below 2 methods:

 

Download from GitHub.

In the first method, you can directly download template from the public Azure Sentinel GitHub repo. The templates are available within the Analytics pane and must be explicitly enabled and onboarded.  Alternatively, you can also point it to your private GitHub repository if available. If you want to read more about Azure Sentinel DevOps process, refer the blog Deploying and Managing Azure Sentinel as Code.

 

Jupyter notebook will start with Setup section where it will check pre-requisites, install missing packages and set up the environment. Initial cells contain function definitions which will be sequentially executed at later stages. After that you will come at Data Acquisition section.

In this section, you will be prompted for folder location to store the extracted files (Detections and Hunting Queries).  You can customize and specify location if you want. By default,  it will store in current folder.

 

01-downloadpath.png

 

A python function named get_sentinel_queries_from_github() is created which can be invoked to download the entire repository and only extract selected folder (Detection and Hunting Queries) in previously mentioned location. If you are using your private repo, provide the archived path to your repo in azsentinel_git_url containing Detections and Hunting Queries as child folders.

 

02-archiveextraction.png

 

You can also validate the operation is successful by manually running %ls in both the folders.

 

03-dir-listings.png

 

Retrieve via Azure Sentinel REST API – Experimental

In this method, you can use Azure Sentinel REST API to query your existing sentinel instance. For more information on using REST API, refer bog Azure Sentinel API 101. This section is currently marked  as Experimental, as there are some limitations with output received from API so you won’t be able to get same level of granular details as from above first step. You will have to first authenticate via az login.   Refer docs Sign in with Azure CLI if you need more details.  Once successfully authenticated, you can generate refresh token and use it with API headers to send REST API query to AlertRuleTemplates and SavedSeaches.

 

Known API Limitations:

  • Hunting Query is currently not part of REST API which is GA, but you can use LogAnalytics REST API saved searches and then filter out Hunting Queries.
  • In both cases, the data retrieved from savedSearches and AlertRuleTemplates, only Tactics is available and not techniques. You may have to pull techniques by joining with Github Dataset if rule template is available.

Below is stripped section of sample output retrieved from REST API – AlertRuleTemplates and hunting queries.

 

04-alert-via-api.png

 

05-huntingqueries-via-api.png

 

Data Cleaning and Enrichment

Once you acquire the data, you will have to perform various data cleaning steps to be eligible for analysis. All the published rule templates are in YAML format, which is already structured, but the values are often multiple in array or array of dictionary format. You will have to flatten these values to create dataset.

 

YAML Parsing

In the first step, we will parse all the YAML files and load it into dataframe. The Dataframe is nothing but a Python data structure similar to a spreadsheet in rows and column format. You can read more about dataframe datastructure at Intro to data structures - DataFrame. We have created a Python function named parse_yaml() which will take a folder containing YAML files. We will parse the files from both Detections and Hunting Queries and join both datasets. While doing this operation, we will also create additional columns to extend the YAML schema, such as GithubURL , IngestedDate, Detection Type, Detection Service etc. Finally, when you run this function, with some additional cleanup, it will display status similar to below.

 

06-githubstats.png

 

Clean and Preprocess Data

Once you have parsed the yaml files and load it into dataframe, we will further clean and preprocess the data. Example operations in this step can be as detailed below.

  • Separate existing columns and derive new columns such as ConnectorId, DataTypes.
  • Separating Null and valid ConnectorId values.
  • Expanding the columns (ConnectorId, DataTypes, Tactics, relevantTechniques ) which have multiple values assigned as array into separate rows for easier analysis.
  • Populate new column as Platform which will be based on custom mapping based on ConnectorId values e.g. AWSCloudTrail to AWS etc.  Snippet of example mapping is shown as below. This mapping can be changed to customize to your environment.

06-Platformmapping.png

 

You can then invoke function clean_and_preprocess_data() to execute this step. This function will return the dataset after cleaning and pre-processing original yaml files. We will also join the fusion dataset to the result dataset to create final dataset.

 

Below is example output from this step.

07-CleanandPreprocessdata.png

 

Enrich with MITRE Matrix

To find gaps in coverage , our original dataset needs to be joined with master dataset from MITRE ATT&CK matrix . We have created a function get_mitre_matrix_flat() that uses the Python library attackcti underneath with an additional data wrangling steps to return flat table as dataframe.

Below is example output from this function.

07-Mitre-matrix-flat.png

Merge preprocessed dataset with mitre datasets

In this step, we will merge our cleaned preprocessed dataset with the Mitre dataset. The resulting dataset will have our detections and hunting queries mapped to existing tactics & techniques, and will have blank lines where there are no matches.

09-Merge-data.png

 

After renaming columns and normalizing the datasets, output will look like the one below.

Remember you can have multiple rows for single detection if it has different values in Platform, ConnectorId, DataTypes. The resulting dataset will have single value in these columns so that it can be effectively analyzed and visualized. You can always aggregate them back into list/array to single row per detection.

 

10-displayresults.png

 

Scraping Detection List of Microsoft Threat Protection Portfolio

Microsoft has a variety of threat protection solutions in its portfolio. Depending upon licenses you may have one or multiple of these enabled in your environment. Azure Sentinel natively integrates with these solutions and ingests rules once connected under SecurityAlerts table. Some of these solutions  have published documentation on available rules under each on Microsoft docs website. These details can be easily scraped programmatically and create a result dataset. As we find more documentation, we will add other products to this list. Currently below services have rules published.

We have created python function for each of these and sample output are as shown below.

  • Azure Defender (previously ASC)

https://docs.microsoft.com/en-us/azure/security-center/alerts-reference

 

11-azure-defender.png

  • Azure Identity Protection Center

https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/concept-identity-protect...

12-azure-ipc.png

 

  • Azure Defender for Identity (previously AATP)

https://docs.microsoft.com/en-us/azure-advanced-threat-protection/suspicious-activity-guide?tabs=ext...

13-azure-defender-identity.png

 

  • Microsoft Cloud Application Security (MCAS)

https://docs.microsoft.com/en-us/cloud-app-security/investigate-anomaly-alerts

 

14-mcas.png

 

You can later combine all above datasets into single dataframe, and display results as shown below.

This dataframe can be further used in visualization section.

 

15-merge-all-msft.PNG

 

Data Visualization

Now, we have all the data into a structured format, we can visualize it in a number of different ways and tools. The data can be sent back to LogAnalytics into custom table and later be visualized via either PowerBI or native Azure Sentinel Workbooks. Or you can also leverage the power of various Python visualization libraries within a Jupyter notebook. In the below screenshots, we have used matplotlib to visualize it as a heatmap, and used Plotly to visualize it into radar plots, donut charts etc. From the structured dataset, we can also automatically create ATT&CK navigation layer json files. These json files can be visualized as embedded iFrames within a Jupyter notebook or independently in a browser window. Check out below gif walkthrough of  visualizations. You can also check the notebook directly for more static and interactive view.

Alerts Table Viewer – Jupyter Widget

Part 5 Data Viz- Jupyter widget.gif

 

Heatmaps using Matplotlib.

Part 5 Data Viz-Heatmap.gif

 

ATT&CK Navigator Embedded Iframe view

Part 5 Data Viz -ATTACK Navigator.gif

Radar Plots with Plotly

Part 5 Data Viz-Radar plots.gif

 

 

Donut Plots with Plotly

Part 5 Data Viz-Donut Charts.gif

 

 

MITRE ATT&CK Workbook

This is an early version of the workbook available in GitHub which will be updated further for a more mature version and recommended instructions based on the workspace and datasources.

MITRE Workbook.gif

Uploading Results to Azure Sentinel

The data generated by data analysis (Alerts from Microsoft Services and Normalized Azure Sentinel Detections) can be uploaded back to Azure Sentinel. You can use data uploader feature of Msticpy for this. You can read more about it Uploading data to Azure Sentinel/Log Analytics.

 

23-Uploadresults.png

 

Conclusion

Azure Sentinel provides out-of-the box detection and hunting query templates via its public GitHub repo. Currently the repository holds around 362 queries for defenders. Depending on the environment and onboarded data sources, customer can choose these and enable it in their respective Azure Sentinel instance. As all the templates are already mapped to the MITRE ATT&CK Tactics and Techniques, you can analyze and visualize the detection coverage and identify potential gaps. The goal or outcome of this analysis is not necessarily to fill every gap but understand the coverage ,identify blind spots and strategically make decisions to create new detections or  onboard new data sources to increase the coverage. 

 

Special thanks to @ianhelle  for Sentinel API and @Cyb3rWard0g for ATT&CK Navigation layer section in the notebook.

References

  • MITRE ATT&CK for Azure Sentinel Resources (Notebook, Supporting Files)

https://github.com/Azure/Azure-Sentinel/tree/master/Sample%20Data/MITRE%20ATT%26CK

  • MITRE ATT&CK Workbook

https://github.com/Azure/Azure-Sentinel/blob/master/Workbooks/MITREAttack.json

  • ATT&CK Navigator

https://github.com/mitre-attack/attack-navigator

  • Sign in with Azure CLI

https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli

  • Intro to Data Structures - DataFrame

https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html#dataframe

  • Automate the Creation of ATT&CK Navigator Group Layer Files with Python

https://medium.com/threat-hunters-forge/automate-the-creation-of-att-ck-navigator-group-layer-files-...

  • Deploying and Managing Azure Sentinel as Code

https://techcommunity.microsoft.com/t5/azure-sentinel/deploying-and-managing-azure-sentinel-as-code/...

  • Azure Sentinel REST API 101

https://techcommunity.microsoft.com/t5/azure-sentinel/azure-sentinel-api-101/ba-p/1438928

  • Plotly – Radar Charts in Python

https://plotly.com/python/radar-chart/

  • Plotly – Donut Chart

https://plotly.com/python/pie-charts/

 

2 Comments
Super Contributor

Great article.  It seems that you repeated a section with different folder names:

Jupyter notebook will start with Setup section where it will check pre-requisite, install missing packages and set up the environment. Initial cells contains function definitions which will be sequentially executed at later stages. Later you will come at Data Acquisition section.

In this section, you will be prompted for folder location to store the extracted files (Detections and Hunting Queries). By default, it will create a folder named mitre-attack under current folder. You can customize and specify location if you want. 

Jupyter notebook will start with Setup section where it will check pre-requisite, install missing packages and set up the environment. Initial cells contains function definitions which will be sequentially executed at alter stages. Later you will come at Data Acquisition section. In this section, you will be prompted for folder location to store the extracted files (Detections and Hunting Queries). By default,  it will store in current folder. You can customize and specify location if you want

Microsoft

Thanks @Gary Bushey  for reading and letting me know.  I have now corrected the post.