%3CLINGO-SUB%20id%3D%22lingo-sub-1771676%22%20slang%3D%22en-US%22%3EPlaybooks%20%26amp%3B%20Watchlists%20Part%202%3A%20Automate%20incident%20response%20for%20Deny-list%2FAllow-list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1771676%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3EGreat%20Thanks%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F240086%22%20target%3D%22_blank%22%3E%40Julian%20Gonzalez%3C%2FA%3E%26nbsp%3B%20for%20working%20together%20on%20the%20playbooks%20templates!%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20previous%20article%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fplaybooks-amp-watchlists-part-1-inform-the-subscription-owner%2Fba-p%2F1768917%22%20target%3D%22_self%22%3EPlaybooks%20%26amp%3B%20Watchlists%20Part%201%3A%20Inform%20the%20subscription%20owner%3C%2FA%3E%26nbsp%3BI%20have%20presented%20one%20scenario%20of%20using%20Watchlists%20in%20Playbooks.%20I%20also%20presented%20some%20best%20practices%3A%20how%20to%20query%20a%20watchlist%20using%20Azure%20Monitor%20Logs%20connector%2C%20and%20also%20how%20to%20use%20the%20output%20data.%3C%2FP%3E%0A%3CP%3EIn%20this%20blogpost%20I'll%20present%20another%20interesting%20use%20case%20and%20some%20new%20ways%20to%20work%20with%20the%20Watchlists%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAllow-listing%20is%20a%20strategy%20for%20allowing%20certain%20identities%20or%20sources%20to%20access%20sensitive%20resources%20or%20to%20exclude%20them%20from%26nbsp%3Bsecurity%20protections.%20An%20example%20for%20such%20scenario%20can%20be%20a%20set%20of%20IP%20addresses%20which%20might%20trigger%20new%20alerts%2C%20but%20known%20to%20the%20SOC%20as%20coming%20from%20approved%20sources.%20In%20a%20case%20where%20a%20new%20alert%20consists%20only%20approved%20IPs%20as%20its%20entities%2C%20we%20might%20want%20to%20save%20the%20analysts%20time%20and%20auto%20close%20the%20incident.%3C%2FP%3E%0A%3CP%3EOf%20course%2C%20more%20steps%20and%20actions%20can%20be%20taken%20and%20added%20to%20this%20playbook%20for%20other%20steps%20taken%20in%20this%20case%20by%20the%20SOC.%20Also%2C%20the%20same%20practice%20can%20be%20adopted%20for%20Deny-list%20scenarios.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FPlaybooks%2FWatchlist-CloseIncidentKnownIPs%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EQuick%20access%20to%20the%20playbook%20in%20Azure%20Sentinel%20Github%20repository%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EThis%20blogpost%20includes%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESolution%20summary%3C%2FLI%3E%0A%3CLI%3EPrerequisites%3C%2FLI%3E%0A%3CLI%3EPlaybook%20steps%20explained%3C%2FLI%3E%0A%3CLI%3ESetup%20instructions%3CBR%20%2F%3E%3CUL%3E%0A%3CLI%3ECreate%20and%20upload%20your%20watchlist%3C%2FLI%3E%0A%3CLI%3EARM%20Template%20deployment%3C%2FLI%3E%0A%3CLI%3EPlaybook%20configurations%3C%2FLI%3E%0A%3CLI%3ESet%20automated%20response%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EDocumentation%20reference%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId--1238190062%22%20id%3D%22toc-hId--1238190062%22%3E%3CSTRONG%3ESolution%20summary%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EAn%20Azure%20Sentinel%20Watchlist%20lists%20all%20approved%20IP%20addresses.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FPlaybooks%2FWatchlist-CloseIncidentKnownIPs%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EWatchlist-CloseIncidentKnownIPs%3C%2FA%3E%26nbsp%3BPlaybook%20is%20attached%20to%20an%20analytic%20rule%20that%20attaches%20IPs%20to%20the%20outcome%20alerts.%3C%2FLI%3E%0A%3CLI%3EEverytime%20a%20new%20alert%20of%20this%20analytic%20rule%20is%20created%2C%20the%20playbook%20is%20triggered%2C%20receiving%20the%20alert%20with%20the%20contained%20alerts%20as%20an%20input.%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EFor%20each%20IP%20entity%20in%20this%20alert%2C%20the%20playbook%20queries%20the%20Watchlist%20includes%20it.%3CUL%3E%0A%3CLI%3EIn%20case%20the%20IP%20is%20in%20the%20Watchlist%2C%20it%20will%20be%20added%20to%20%22Safe%20IPs%22%20array.%3C%2FLI%3E%0A%3CLI%3EElse%2C%20it%20will%20be%20added%20to%20%22Not%20Safe%20IPs%22%20array.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EA%20informative%20HTML%20comment%20will%20be%20written%20to%20the%20incident%20that%20contains%20this%20alert%2C%20to%20inform%20about%20the%20IPs%20in%20each%20category.%3C%2FLI%3E%0A%3CLI%3EIf%20all%20IPs%20were%20found%20safe%2C%20the%20incident%20will%20be%20closed%20with%20Benign%20Positive%20classification%20reason.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--671548100%22%20id%3D%22toc-hId-1249322771%22%20id%3D%22toc-hId-1249322771%22%3E%3CSTRONG%3EPrerequisites%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3EA%20user%20or%20registered%20application%20with%20Azure%20Sentinel%20Contributor%20role%20to%20be%20used%20with%20the%20Azure%20Sentinel%20connector%20to%20Logic%20Apps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--671548100%22%20id%3D%22toc-hId--558131692%22%20id%3D%22toc-hId--558131692%22%3E%3CSTRONG%3EPlaybook%20steps%20explained%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-1929381141%22%20id%3D%22toc-hId-1929381141%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20860px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226010iBED45980A93053C7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhen%20a%20response%20to%20an%20Azure%20Sentinel%20alert%20is%20triggered%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAzure%20Sentinel%20alert%20was%20created.%20The%20playbook%20receives%20the%20alert%20as%20the%20input.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EInitialize%20variables%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThis%20actions%20stores%20values%20to%20be%20used%20later%20in%20the%20playbook%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWatchlist%20name%20is%20a%20variable%20of%20type%20string%2C%20will%20be%20used%20for%20the%20Log%20Analytics%20query%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ESafe%2Fnot%20safe%20IPs%20are%20variables%20of%20type%20array%2C%20will%20be%20used%20to%20store%20the%20found%20IPs%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EEntities%20-%20Get%20IPs%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3EThis%20action%20takes%20all%20the%20entities%20found%20in%20the%20alert%20and%20parses%20only%20the%20IPs%20with%20their%20special%20fields%20ready%20to%20be%20used%20as%20dynamic%20values%20in%20later%20actions.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EFor%20Each%20IP%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIterates%20on%20the%20IPs%20found%20in%20this%20alert%20and%20performs%20the%20following%3A%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-121926678%22%20id%3D%22toc-hId-121926678%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20936px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226009i5071F0BFB1B8B3D3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ERun%20query%20and%20list%20results%20-%20Get%20Watchlist%3C%2FSTRONG%3E%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3EIn%20this%20step%20we%20ask%20Log%20Analytics%20(Azure%20Monitor%20Logs%20connector)%20to%20get%20the%20items%20of%20the%20Watchlist.%20Subscription%2C%20Resource%20Group%20and%20Resource%20Name%20are%20the%20Azure%20Sentinel%20workspace%20details%20where%20the%20watchlist%20is%20located.%3CBR%20%2F%3EI%20used%20the%20following%20query%3A%3CBR%20%2F%3E%3CSPAN%3E_GetWatchlist(%3C%2FSPAN%3E%3CSPAN%3E%40%7Bvariables('WatchlistName')%7D%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-cce%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%7C%20extend%20IpAddress%20%3D%20tostring(parse_json(WatchlistItem).IpAddress)%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%7C%20where%20IpAddress%20%3D%3D%20''%40%7Bitems('For_each')%3F%5B'Address'%5D%7D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-cce%22%3E%22%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ECondition%3CBR%20%2F%3E%3C%2FSTRONG%3EIn%20this%20step%20I%20check%20the%20length%20of%20the%20response%20array%20from%20the%20query%2C%20using%20the%20Logic%20apps%20expression%20length(%3CEM%3Ecollection).%20If%20it%20is%20greater%20then%200%2C%20we%20have%20found%20the%20IP%20in%20the%20watchlist.%3CBR%20%2F%3E%3C%2FEM%3E%3CEM%3ETherefor%2C%20we%20will%20add%20this%20IP%20to%20the%20Safe%20array%3B%20otherwise%2C%20to%20the%20not%20safe.%3C%2FEM%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAdd%20a%20comment%20to%20the%20incident%3C%2FSTRONG%3E%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3EIn%20this%20step%20we%20audit%20the%20information%20collected%20so%20far%3A%20a%20list%20of%20safe%20IPs%20found%20in%20the%20Watchlist%2C%20a%20side%20to%20a%20list%20of%20unknown%20IPs.%3CSPAN%20class%3D%22pl-cce%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ECondition%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EFinally%2C%20we%20want%20to%20check%20if%20there%20is%20any%20IP%20which%20found%20as%20not%20safe.%20This%20step%20checks%20if%20our%20%22not%20safe%22%20array%20is%20empty.%20If%20so%2C%20we%20will%20close%20the%20incident.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EChange%20Incident%20Status%3C%2FSTRONG%3E%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3ECloses%20the%20incident%20with%20Benign%20Positive%20classification%20reason.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1815964733%22%20id%3D%22toc-hId--1685527785%22%20id%3D%22toc-hId--1685527785%22%3E%3CSTRONG%3ESetup%20instructions%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ECreate%20and%20Upload%20your%20watchlist%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3ECreate%20your%20input%20CSV%20table%3C%2FSTRONG%3E%3CBR%20%2F%3EIn%20this%20use%20case%20I%20have%20created%20a%20simple%20table%2C%20where%20each%20row%20represents%20an%20ip%20address.%3CBR%20%2F%3EI%20created%20the%20table%20using%20Office%20365%20Excel%2C%20and%20then%20saved%20it%20as%20a%20CSV%20file%20(save%20as).%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EUpload%20your%20table%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3COL%20class%3D%22lia-list-style-type-lower-roman%22%3E%0A%3CLI%3EIn%20Azure%20Sentinel%2C%20go%20to%26nbsp%3B%3CSTRONG%3EWatchlists.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EClick%20on%26nbsp%3B%3CSTRONG%3EAdd%20new%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F225808i3A3CA68B69BAA265%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EFill%20in%20the%20required%20details.%3C%2FSTRONG%3E%3CBR%20%2F%3ENote%20that%20the%20Alias%20will%20be%20used%20to%20query%20this%20watchlist%20in%20the%20playbook%20query%20step.%3CSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EAdd%20the%20CSV%20file%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EReview%20and%20create.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22toc-hId-801985048%22%20id%3D%22toc-hId-801985048%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-1815964733%22%20id%3D%22toc-hId--1005469415%22%20id%3D%22toc-hId--1005469415%22%3E%3CSTRONG%3EPlaybook%20deployment%20instructions%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EOpen%20the%20link%20to%20the%20playbook.%26nbsp%3B%20Scroll%20down%20on%20the%20page%20and%26nbsp%3BClick%20on%20%E2%80%9CDeploy%20to%20Azure%E2%80%9D%20or%20%22Deploy%20to%20Azure%20Gov%22%20button%20depending%20on%20your%20need.%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CDIV%20id%3D%22tinyMceEditorliortamir_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CDIV%20id%3D%22tinyMceEditorliortamir_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3EFill%20the%20parameters%3A%3CBR%20%2F%3E%3CDIV%20id%3D%22tinyMceEditorliortamir_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3EBasics%3CBR%20%2F%3E%3C%2FSTRONG%3EFill%20the%20subscription%2C%20resource%20group%20and%20location%20Sentinel%20workspace%20is%20under.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESettings%3C%2FSTRONG%3E%3COL%3E%0A%3CLI%3EPlaybook%20name%20-%20this%20is%20how%20you'll%20find%20the%20playbook%20in%20your%20subscription%3C%2FLI%3E%0A%3CLI%3EUser%20name%20(will%20affect%20the%20names%20of%20the%20API%20connections%20resources)%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3ECheck%20the%20terms%20and%20conditions%20and%20click%20purchase.%3C%2FLI%3E%0A%3CLI%3EThe%20ARM%20template%2C%20contains%20the%20Logic%20App%20workflow%20(playbook)%20and%20API%20connections%20is%20now%20deploying%20to%20Azure.%20When%20finished%2C%20you%20will%20be%20taken%20to%20the%20Azure%20ARM%20Template%20summary%20page.%3C%2FLI%3E%0A%3CLI%3EClick%20on%20the%20Logic%20Apps%20name.%20you%20will%20be%20taken%20to%20the%20Logic%20Apps%20resource%20of%20this%20playbook.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH3%20id%3D%22toc-hId-699071744%22%20id%3D%22toc-hId--314907941%22%20id%3D%22toc-hId--314907941%22%3E%3CSTRONG%3EConfirm%20API%20connections%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3EOn%20the%20left%20menu%2C%20click%20on%20API%20connections.%3CBR%20%2F%3EFor%20each%20product%20being%20used%20in%20this%20playbook%2C%20click%20on%20the%20connection%20name%20-%20in%20our%20case%2C%20it%20is%20only%20the%20Azure%20Sentinel%20connection.%3CBR%20%2F%3EClick%20on%20%3CSTRONG%3EAuthorize%3C%2FSTRONG%3E%20to%20log%20in%20with%20your%20user%2C%20and%20don't%20forget%20to%20save.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--325411045%22%20id%3D%22toc-hId--325411045%22%3E%3CSTRONG%3EDocumentation%20Reference%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fconnectors%2Fazuresentinel%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20Logic%20Apps%20connector%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1771676%22%20slang%3D%22en-US%22%3E%3CP%3ELeveraging%20the%20power%20of%20Azure%20Sentinel%20playbooks%20and%20new%20Watchlists%20feature%2C%20its%20now%20easy%20to%20automatically%20triage%20alerts%20and%20incidents%20based%20on%20Deny-list%2FAllow-list.%20In%20this%20blogpost%20I'll%20present%20a%20scenario%20where%20the%20response%20to%20an%20alert%20can%20be%20automated%20when%20all%20the%20consisted%20IPs%20are%20part%20of%20an%20approved%20IPs%20list%20(Allow-list).%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1771676%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPlaybook%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ewatchlist%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Great Thanks to @Julian Gonzalez  for working together on the playbooks templates!

 

In the previous article, Playbooks & Watchlists Part 1: Inform the subscription owner I have presented one scenario of using Watchlists in Playbooks. I also presented some best practices: how to query a watchlist using Azure Monitor Logs connector, and also how to use the output data.

In this blogpost I'll present another interesting use case and some new ways to work with the Watchlists data.

 

Allow-listing is a strategy for allowing certain identities or sources to access sensitive resources or to exclude them from security protections. An example for such scenario can be a set of IP addresses which might trigger new alerts, but known to the SOC as coming from approved sources. In a case where a new alert consists only approved IPs as its entities, we might want to save the analysts time and auto close the incident.

Of course, more steps and actions can be taken and added to this playbook for other steps taken in this case by the SOC. Also, the same practice can be adopted for Deny-list scenarios.

 

Quick access to the playbook in Azure Sentinel Github repository

 

This blogpost includes:

  • Solution summary
  • Prerequisites
  • Playbook steps explained
  • Setup instructions
    • Create and upload your watchlist
    • ARM Template deployment
    • Playbook configurations
    • Set automated response
  • Documentation reference

Solution summary

  • An Azure Sentinel Watchlist lists all approved IP addresses.
  • Watchlist-CloseIncidentKnownIPs Playbook is attached to an analytic rule that attaches IPs to the outcome alerts.
  • Everytime a new alert of this analytic rule is created, the playbook is triggered, receiving the alert with the contained alerts as an input. 
  • For each IP entity in this alert, the playbook queries the Watchlist includes it.
    • In case the IP is in the Watchlist, it will be added to "Safe IPs" array.
    • Else, it will be added to "Not Safe IPs" array.
  • A informative HTML comment will be written to the incident that contains this alert, to inform about the IPs in each category.
  • If all IPs were found safe, the incident will be closed with Benign Positive classification reason.

 

Prerequisites

A user or registered application with Azure Sentinel Contributor role to be used with the Azure Sentinel connector to Logic Apps.

 

Playbook steps explained

image.png

 

When a response to an Azure Sentinel alert is triggered

Azure Sentinel alert was created. The playbook receives the alert as the input.

 

Initialize variables

This actions stores values to be used later in the playbook:

  • Watchlist name is a variable of type string, will be used for the Log Analytics query 
  • Safe/not safe IPs are variables of type array, will be used to store the found IPs

 

Entities - Get IPs

This action takes all the entities found in the alert and parses only the IPs with their special fields ready to be used as dynamic values in later actions.

 

For Each IP

Iterates on the IPs found in this alert and performs the following:

image.png

 

  • Run query and list results - Get Watchlist
    In this step we ask Log Analytics (Azure Monitor Logs connector) to get the items of the Watchlist. Subscription, Resource Group and Resource Name are the Azure Sentinel workspace details where the watchlist is located.
    I used the following query:
    _GetWatchlist(@{variables('WatchlistName')})
    | extend IpAddress = tostring(parse_json(WatchlistItem).IpAddress)
    | where IpAddress == ''@{items('For_each')?['Address']}"
  • Condition
    In this step I check the length of the response array from the query, using the Logic apps expression length(collection). If it is greater then 0, we have found the IP in the watchlist.
    Therefor, we will add this IP to the Safe array; otherwise, to the not safe.

 

Add a comment to the incident
In this step we audit the information collected so far: a list of safe IPs found in the Watchlist, a side to a list of unknown IPs.

 

Condition

Finally, we want to check if there is any IP which found as not safe. This step checks if our "not safe" array is empty. If so, we will close the incident.

 

Change Incident Status
Closes the incident with Benign Positive classification reason.

Setup instructions

 

Create and Upload your watchlist

 

  1. Create your input CSV table
    In this use case I have created a simple table, where each row represents an ip address.
    I created the table using Office 365 Excel, and then saved it as a CSV file (save as).

  2. Upload your table

    1. In Azure Sentinel, go to Watchlists.

    2. Click on Add new
      image.png

    3. Fill in the required details.
      Note that the Alias will be used to query this watchlist in the playbook query step.

    4. Add the CSV file

    5. Review and create.

 

Playbook deployment instructions

 

  1. Open the link to the playbook.  Scroll down on the page and Click on “Deploy to Azure” or "Deploy to Azure Gov" button depending on your need.
     
     
     
     
  2. Fill the parameters:
     
    1. Basics
      Fill the subscription, resource group and location Sentinel workspace is under.
    2. Settings
      1. Playbook name - this is how you'll find the playbook in your subscription
      2. User name (will affect the names of the API connections resources)
    3. Check the terms and conditions and click purchase.
    4. The ARM template, contains the Logic App workflow (playbook) and API connections is now deploying to Azure. When finished, you will be taken to the Azure ARM Template summary page.
    5. Click on the Logic Apps name. you will be taken to the Logic Apps resource of this playbook.

Confirm API connections

On the left menu, click on API connections.
For each product being used in this playbook, click on the connection name - in our case, it is only the Azure Sentinel connection.
Click on Authorize to log in with your user, and don't forget to save.

 

Documentation Reference