Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1322617%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20digital%20tripwires%20with%20custom%20threat%20intelligence%20feeds%20for%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1322617%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20are%20the%20logs%20you%20selected%20different%20then%20enabling%20Diagnostic%20Settings%20under%20the%20Activity%20Log%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1322881%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20digital%20tripwires%20with%20custom%20threat%20intelligence%20feeds%20for%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1322881%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20Diagnostic%20Logs%20will%20give%20you%20detailed%20information%20on%20the%20type%20of%20events%20that%20occurred%20in%20the%20storage%20account%20including%20information%20like%20UserAgent%20string%2C%20IP%20address%2C%20API%20etc.%20Much%20of%20this%20information%20is%20unavailable%20in%20the%20ActivityLog%20view%2C%20at%20least%20for%20the%20storage%20accounts%20I've%20inspected.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExpect%20to%20see%20audit%20activity%20and%20policy%20changes%20in%20the%20ActivityLog%20and%20detailed%20diagnostic%20information%20in%20the%20%24logs%20directory.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1320981%22%20slang%3D%22en-US%22%3ECreating%20digital%20tripwires%20with%20custom%20threat%20intelligence%20feeds%20for%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1320981%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20Storage%20allows%20you%20to%20store%20all%20kinds%20of%20data%20in%20the%20cloud.%20By%20default%2C%20this%20data%20is%20private%20or%20constrained%20to%20authorized%20accounts%2C%20but%20Azure%20Storage%20also%20allows%20you%20to%20share%20data%20worldwide.%20If%20you%20have%20a%20webapp%20that%20needs%20access%20to%20files%20or%20you%20want%20to%20stream%20images%20or%20documents%20to%20your%20customers%2C%20then%20you%20can%20use%20Azure%20cloud%20storage%20to%20rapidly%20deliver%20this%20content%20via%20a%20simple%20URL.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20what%20if%20this%20sharing%20was%20not%20intended%3F%20What%20if%20an%20organisation%20had%20inadvertently%20stored%20sensitive%20information%20in%20a%20publicly%20available%20location%3F%20Recent%20public%20disclosures%20have%20shown%20that%20a%20variety%20of%20threat%20actors%20are%20actively%20looking%20for%20misconfigured%20services%2C%20in%20many%20cases%20making%20use%20of%20scanning%20tools%20to%20find%20misconfigured%20storage%20accounts%20and%20exploring%20their%20contents.%20What%20if%20you%20could%20find%20these%20actors%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20blog%20I%E2%80%99ll%20describe%20how%20to%20use%20Azure%20Storage%20diagnostics%20and%20Azure%20Sentinel%20to%20set%20up%20monitoring%20of%20storage%20accounts.%20This%20can%20be%20used%20as%20a%20way%20of%20monitoring%20for%20actors%20scanning%20for%20open%20storage%20accounts.%20If%20you%20don%E2%80%99t%20have%20an%20existing%20storage%20account%20or%20want%20to%20set%20up%20one%20specifically%20to%20monitor%20bad%20actors%2C%20I%E2%80%99ll%20show%20how%20to%20create%20specially%20crafted%20storage%20blobs%20called%20%E2%80%98honey%20buckets%E2%80%99.%3C%2FP%3E%0A%3CP%3EA%20honey%20bucket%20is%20a%20publicly%20available%20storage%20service%2C%20but%20not%20actually%20used%20in%20any%20production%20environment.%20Instead%20it%20is%20used%20as%20a%20digital%20tripwire%20to%20monitor%20for%20unauthorised%20access.%20An%20organisation%20might%20set%20up%20a%20service%20like%20this%20to%20collect%20threat%20intelligence%20or%20monitor%20for%20attacker%20reconnaissance%20activity%20against%20their%20organisation.%20We%20aren%E2%80%99t%20sure%20who%20coined%20the%20name%2C%20but%20the%20first%20use%20seems%20to%20come%20from%20Adel%20K%20(%400x4d31)%20on%20Twitter.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMuch%20of%20the%20functionality%20I%E2%80%99ll%20describe%20in%20this%20blog%20post%20is%20already%20covered%20by%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fsecurity-center%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EATP%20for%20Azure%20Storage%3C%2FA%3E%2C%20Microsoft%E2%80%99s%20cloud-based%20security%20solution.%20If%20you%20are%20not%20interested%20in%20collecting%2C%20managing%20and%20leveraging%20your%20own%20raw%20threat%20intelligence%20feed%20consider%20using%20the%20managed%20solution%20that%20automatically%20offers%20protection%20against%20cloud-based%20threats.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20collect%20raw%20threat%20intelligence%20yourself%2C%20I%E2%80%99ll%20describe%20how%20you%20can%20use%20Azure%20Storage%20to%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Eturn%20on%20the%20necessary%20diagnostic%20logs%20or%20apply%20this%20to%20your%20own%20Azure%20Storage%20containers.%3C%2FLI%3E%0A%3CLI%3Equery%20the%20logs%20and%20extract%20useful%20fields.%3C%2FLI%3E%0A%3CLI%3Econsume%20these%20logs%20and%20store%20them%20in%20Azure%20Sentinel.%3C%2FLI%3E%0A%3CLI%3Ewrite%20an%20Azure%20Sentinel%20analytic%20to%20create%20an%20incident%20when%20a%20new%20IP%20is%20seen%20accessing%20your%20infrastructure.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3ETurning%20on%20Azure%20Storage%20diagnostic%20logs%20will%20result%20in%20increased%20storage%20usage%20and%20as%20such%20higher%20costs.%20You%20might%20want%20to%20try%20a%20honey%20bucket%20first%20before%20using%20this%20technique%20on%20production%20storage%20accounts.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1357301364%22%20id%3D%22toc-hId--1357301334%22%3ECreate%20your%20bucket%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20we%20will%20need%20to%20create%20a%20storage%20account%20and%20container%20(blob)%20for%20monitoring.%20If%20you%20haven%E2%80%99t%20used%20Azure%20Storage%20before%20you%20can%20follow%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-quickstart-create-account%3Ftabs%3Dazure-portal%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%E2%80%98Create%20a%20storage%20account%E2%80%99%20documentation%3C%2FA%3E%20-%20as%20well%20as%20the%20%3CA%20href%3D%22http%3A%2F%2FQuickstart%2520guide.%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EQuickstart%20guide%3C%2FA%3E.%20If%20you%20already%20have%20Azure%20Storage%20accounts%20and%20want%20to%20enable%20monitoring%2C%20you%20can%20skip%20this%20step%20and%20continue%20from%20the%20%E2%80%98Set%20up%20debug%20logging%E2%80%99%20section.%3CBR%20%2F%3ECrucially%20you%20will%20want%20to%20use%20an%20easily%20guessable%20storage%20account%20name.%20This%20way%20the%20storage%20account%20is%20more%20likely%20to%20be%20found%20by%20nefarious%20individuals.%20Several%20existing%20tools%20exist%20to%20scan%20for%20insecure%20configurations%2C%20these%20tools%20may%20have%20wordlists%20which%20will%20be%20a%20good%20place%20to%20choose%20a%20name%20from.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22width%3A%20100%25%3B%20border-style%3A%20hidden%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%20class%3D%22lia-align-center%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20468px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185335i46E3A520BDC50E32%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3ENext%20you%20will%20want%20to%20create%20a%20new%20%26nbsp%3Bcontainer.%20This%20container%20will%20be%20publicly%20readable%20and%20will%20similarly%20need%20an%20easily%20guessable%20name.%20Once%20this%20has%20been%20created%20you%20may%20optionally%20want%20to%20add%20some%20blobs%20to%20the%20%26nbsp%3Bcontainer%20for%20a%20would-be%20attacker%20to%20download.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22width%3A%20100%25%3B%20border-style%3A%20hidden%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%20class%3D%22lia-align-center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20468px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185337i938EF3EFECB4B52B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3EYou%20may%20want%20to%20disable%20the%20%E2%80%98Secure%20transfer%20required%E2%80%99%20to%20enable%20your%20container%20to%20be%20accessed%20over%20HTTP%20as%20well%20as%20HTTPS.%20Be%20aware%20of%20the%20security%20risks%20you%20may%20be%20opening%20yourself%20up%20to%20if%20you%20are%20applying%20this%20to%20an%20existing%20container.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20we%E2%80%99ve%20worked%20to%20undo%20the%20default%20security%20put%20in%20place%20by%20Azure%20Storage%20we%20can%20continue%20and%20enable%20debug%20logging.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1130211469%22%20id%3D%22toc-hId-1130211499%22%3EEnable%20debug%20logging%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzure%20Storage%20can%20log%20many%20of%20the%20interactions%20that%20occur%20with%20either%20the%20API%20or%20the%20webservice%2C%20potentially%20resulting%20in%20a%20large%20volume%20of%20logs%20and%20%3CSTRONG%3Eassociated%20storage%20cost%3C%2FSTRONG%3E.%20The%20cost%20associated%20is%20related%20to%20the%20number%20of%20log%20entries%20that%20are%20created%2C%20with%20every%20access%20creating%20an%20entry.%20Azure%20Storage%20account%20users%20with%20a%20high%20number%20of%20requests%20should%20exercise%20caution.%20As%20such%20this%20feature%20needs%20to%20be%20specifically%20enabled.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnabling%20diagnostic%20logging%20after%20you%E2%80%99ve%20created%20your%20blob%20storage%2C%20and%20added%20any%20necessary%20files%2C%20will%20reduce%20the%20number%20of%20resulting%20logs.%20Enabling%20diagnostics%20is%20performed%20by%20accessing%20%E2%80%98Diagnostic%20settings%E2%80%99%20from%20storage%20account%20menu.%20Below%20you%20can%20see%20logging%20has%20been%20enabled%20for%20Read%20access%20and%20that%20only%20the%20last%20days%E2%80%99%20worth%20of%20logs%20will%20be%20available.%20Once%20you%E2%80%99ve%20updated%20your%20blob%20logging%20properties%20don%E2%80%99t%20forget%20to%20click%20%E2%80%98Save%E2%80%99.%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22border-style%3A%20hidden%3B%20width%3A%20100%25%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%20class%3D%22lia-align-center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20380px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185339iF519FC91CAE558DD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3EAt%20this%20point%20a%20new%20container%20called%20%E2%80%98%24logs%E2%80%99%20is%20created%20to%20store%20the%20audit%20events.%20This%20container%20is%20not%20visible%20in%20the%20Azure%20portal.%20If%20you%20want%20to%20inspect%20these%20logs%2C%20you%E2%80%99ll%20need%20to%20use%20the%20Azure%20API%20or%20the%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Ffeatures%2Fstorage-explorer%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Storage%20Explorer%20application%3C%2FA%3E.%3CBR%20%2F%3EThe%20format%20for%20the%20log%20file%20is%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2FStorage-Analytics-Log-Format%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Edocumented%20here%3C%2FA%3E.%26nbsp%3BOf%20interest%20is%20the%20%E2%80%98%3CFONT%20color%3D%22%23FF0000%22%3Erequester-ip-address%3C%2FFONT%3E%E2%80%99%20field%2C%20which%20holds%20the%20IP%20address%20of%20the%20entity%20that%20accessed%20the%20blob%20data.%20The%20%E2%80%98%3CFONT%20color%3D%22%233366FF%22%3Euser-agent-header%3C%2FFONT%3E%E2%80%99%20field%20which%20contains%20the%20user%20agent%20or%20whatever%20accessed%20the%20blob%20and%20the%20%E2%80%98%3CFONT%20color%3D%22%2399CC00%22%3Erequest-start-time%3C%2FFONT%3E%E2%80%99.%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22border-style%3A%20hidden%3B%20width%3A%20100%25%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%20class%3D%22lia-align-center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%224.png%22%20style%3D%22width%3A%20451px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185340i96A3A7FD4AC9E718%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%224.png%22%20alt%3D%224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3EIn%20your%20organisation%20the%20IP%20address%20or%20geolocation%20of%20your%20users%20may%20be%20well%20understood.%20As%20such%20examining%20these%20IPs%20may%20give%20you%20an%20indicator%20of%20possible%20recon%20behaviour.%20With%20a%20%E2%80%98honey%20bucket%E2%80%99%20the%20storage%20account%20is%20never%20advertised%20or%20used%2C%20so%20an%20IP%20address%20that%20appears%20in%20this%20log%20is%20of%20interest.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%3A%20It%20isn%E2%80%99t%20just%20external%20entities%20which%20generate%20Azure%20Storage%20logging%20information.%20The%20Azure%20portal%2C%20Azure%20Storage%20API%20or%20other%20products%20such%20as%20Azure%20Storage%20Explorer%20could%20all%20generate%20log%20entries.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--677242994%22%20id%3D%22toc-hId--677242964%22%3EGetting%20the%20data%20into%20Azure%20Sentinel%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20this%20point%20we%20will%20import%20these%20logs%20to%20Azure%20Sentinel%20to%20enable%20analysis.%20We%20can%20use%20an%20Azure%20Function%20to%20query%20the%20log%20files%2C%20extract%20the%20information%20and%20add%20this%20to%20the%20Azure%20Sentinel%20workspace.%20A%20sample%20Azure%20Function%20and%20installation%20instructions%20can%20be%20found%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20GitHub%3C%2FA%3E%20page%20under%20the%20DataConnectors%20directory.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EDiagnostic%20events%20are%20not%20written%20to%20the%20storage%20account%20in%20real%20time%2C%20it%20can%20take%20up%20to%20one%20hour%20for%20events%20to%20be%20available.%20The%20sample%20function%20runs%20once%20an%20hour%2C%20gathers%20the%20previous%20logs%20and%20examines%20them%20for%20List%20or%20Get%20operations.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EAs%20mentioned%20in%20the%20previous%20section%2C%20anything%20accessing%20the%20storage%20account%20could%20inadvertently%20add%20logging%20entries%2C%20this%20includes%20collecting%20the%20logs%20themselves.%20The%20sample%20Azure%20function%20does%20a%20reasonable%20job%20of%20whitelisting%20these%20to%20reduce%20false%20positives.%20It%20collects%20log%20entries%20of%20interest%20and%20adds%20the%20results%20to%20a%20custom%20Azure%20Sentinel%20table%20called%20%E2%80%98HoneyBucketLogs_CL%E2%80%99.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1810269839%22%20id%3D%22toc-hId-1810269869%22%3EThreat%20hunting%20with%20Azure%20Sentinel%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20logs%20now%20in%20Azure%20Sentinel%20you%20can%20easily%20query%20the%20data%20and%20correlate%20with%20other%20sources.%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22border-style%3A%20hidden%3B%20width%3A%20100%25%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%20class%3D%22lia-align-center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%225.png%22%20style%3D%22width%3A%20628px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185342iEF9C900061DD76FD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%225.png%22%20alt%3D%225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BExecuting%20a%20query%20like%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EHoneyBucketLogs_CL%20%0A%7C%20order%20by%20RequestTime_t%20desc%0A%7C%20project%20OriginIP_s%2C%20UserAgent_s%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ewill%20return%20all%20the%20IP%20addresses%20and%20corresponding%20User%20Agents%20that%20triggered%20the%20honeybucket%20%E2%80%98tripwire%E2%80%99.%20These%20could%20be%20correlated%20against%20audit%20data%20from%20legitimate%20storage%20logs%2C%20Azure%20Active%20Directory%20sign-in%20events%2C%20or%20other%20log%20sources%20such%20as%20web%20application%20firewalls.%20The%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20GitHub%20repository%3C%2FA%3E%20is%20a%20great%20source%20of%20inspiration%20for%20what%20you%20could%20query%20with%20a%20UserAgent%20or%20IP%20address.%3C%2FP%3E%0A%3CP%3EThe%20example%20below%20shows%20correlation%20against%20Azure%20Active%20Directory%20successful%20sign-ins%3A%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22width%3A%20100%25%3B%20border-style%3A%20hidden%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%20class%3D%22lia-align-center%22%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%226.png%22%20style%3D%22width%3A%20518px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185343iDD72F61F295CA4DD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%226.png%22%20alt%3D%226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%227.png%22%20style%3D%22width%3A%20547px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185344i3C7AC7AE56364D7A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%227.png%22%20alt%3D%227.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%228.png%22%20style%3D%22width%3A%20628px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185347i26D7D108F06BA37E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%228.png%22%20alt%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CH2%20id%3D%22toc-hId-2815376%22%20id%3D%22toc-hId-2815406%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--1804639087%22%20id%3D%22toc-hId--1804639057%22%3EFinal%20thoughts%3C%2FH2%3E%0A%3CP%3EIf%20you%20are%20using%20cloud-based%20storage%2C%20it%20is%20crucial%20to%20understand%20who%20can%20access%20your%20data.%20By%20default%2C%20Azure%20Storage%20does%20not%20create%20publicly%20visible%20blob%20storage.%20Where%20wider%20data%20access%20is%20configured%2C%20Azure%20Storage%20gives%20customers%20detailed%20auditing%20capabilities.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure-advanced-threat-protection%2Fwhat-is-atp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EATP%20for%20Azure%20Storage%3C%2FA%3E%26nbsp%3Bis%20Microsoft%E2%80%99s%20cloud-based%20security%20solution%20that%20monitors%2C%20analysis%20and%20reports%20on%20anomalies%20in%20your%20organisation.%20ATP%20for%20Azure%20Storage%20adds%20an%20additional%20layer%20of%20security%20intelligence%20that%20detects%20unusual%20and%20potentially%20harmful%20attempts%20to%20access%20or%20exploit%20storage%20account.%20If%20you%20are%20interested%20in%20monitoring%20for%20the%20types%20of%20threats%20described%20in%20this%20blog%20post%20you%20may%20also%20want%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-advanced-threat-protection%3Ftabs%3Dazure-portal%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Econfigure%20Azure%20ATP%20for%20your%20storage%20account%3C%2FA%3E%20and%20connect%20this%20data%20into%20your%20Azure%20Sentinel%20workspace.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EMicrosoft%E2%80%99s%20Threat%20Intelligence%20Center%20proactively%20uses%20data%20sources%20and%20techniques%20such%20as%20those%20described%20here%20to%20discover%20emerging%20threats%20as%20well%20as%20to%20ensure%20that%20our%20detection%20coverage%20is%20relevant%20to%20the%20attacks%20facing%20both%20Microsoft%20and%20its%20customers.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1320981%22%20slang%3D%22en-US%22%3E%3CP%3ELets%20show%20how%20to%20connected%20Azure%20Storage%20to%20Sentinel%20by%20setting%20up%20Honeybuckets%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1320981%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDetection%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Azure Storage allows you to store all kinds of data in the cloud. By default, this data is private or constrained to authorized accounts, but Azure Storage also allows you to share data worldwide. If you have a webapp that needs access to files or you want to stream images or documents to your customers, then you can use Azure cloud storage to rapidly deliver this content via a simple URL.

 

But what if this sharing was not intended? What if an organisation had inadvertently stored sensitive information in a publicly available location? Recent public disclosures have shown that a variety of threat actors are actively looking for misconfigured services, in many cases making use of scanning tools to find misconfigured storage accounts and exploring their contents. What if you could find these actors?

 

In this blog I’ll describe how to use Azure Storage diagnostics and Azure Sentinel to set up monitoring of storage accounts. This can be used as a way of monitoring for actors scanning for open storage accounts. If you don’t have an existing storage account or want to set up one specifically to monitor bad actors, I’ll show how to create specially crafted storage blobs called ‘honey buckets’.

A honey bucket is a publicly available storage service, but not actually used in any production environment. Instead it is used as a digital tripwire to monitor for unauthorised access. An organisation might set up a service like this to collect threat intelligence or monitor for attacker reconnaissance activity against their organisation. We aren’t sure who coined the name, but the first use seems to come from Adel K (@0x4d31) on Twitter.

 

Much of the functionality I’ll describe in this blog post is already covered by ATP for Azure Storage, Microsoft’s cloud-based security solution. If you are not interested in collecting, managing and leveraging your own raw threat intelligence feed consider using the managed solution that automatically offers protection against cloud-based threats.

 

If you want to collect raw threat intelligence yourself, I’ll describe how you can use Azure Storage to:

  • turn on the necessary diagnostic logs or apply this to your own Azure Storage containers.
  • query the logs and extract useful fields.
  • consume these logs and store them in Azure Sentinel.
  • write an Azure Sentinel analytic to create an incident when a new IP is seen accessing your infrastructure.

Turning on Azure Storage diagnostic logs will result in increased storage usage and as such higher costs. You might want to try a honey bucket first before using this technique on production storage accounts.

 

Create your bucket

 

First, we will need to create a storage account and container (blob) for monitoring. If you haven’t used Azure Storage before you can follow the ‘Create a storage account’ documentation - as well as the Quickstart guide. If you already have Azure Storage accounts and want to enable monitoring, you can skip this step and continue from the ‘Set up debug logging’ section.
Crucially you will want to use an easily guessable storage account name. This way the storage account is more likely to be found by nefarious individuals. Several existing tools exist to scan for insecure configurations, these tools may have wordlists which will be a good place to choose a name from.

 

1.png

Next you will want to create a new  container. This container will be publicly readable and will similarly need an easily guessable name. Once this has been created you may optionally want to add some blobs to the  container for a would-be attacker to download.

2.png

You may want to disable the ‘Secure transfer required’ to enable your container to be accessed over HTTP as well as HTTPS. Be aware of the security risks you may be opening yourself up to if you are applying this to an existing container.

 

Now we’ve worked to undo the default security put in place by Azure Storage we can continue and enable debug logging.

 

Enable debug logging

 

Azure Storage can log many of the interactions that occur with either the API or the webservice, potentially resulting in a large volume of logs and associated storage cost. The cost associated is related to the number of log entries that are created, with every access creating an entry. Azure Storage account users with a high number of requests should exercise caution. As such this feature needs to be specifically enabled.

 

Enabling diagnostic logging after you’ve created your blob storage, and added any necessary files, will reduce the number of resulting logs. Enabling diagnostics is performed by accessing ‘Diagnostic settings’ from storage account menu. Below you can see logging has been enabled for Read access and that only the last days’ worth of logs will be available. Once you’ve updated your blob logging properties don’t forget to click ‘Save’.

3.png

At this point a new container called ‘$logs’ is created to store the audit events. This container is not visible in the Azure portal. If you want to inspect these logs, you’ll need to use the Azure API or the Azure Storage Explorer application.
The format for the log file is documented here. Of interest is the ‘requester-ip-address’ field, which holds the IP address of the entity that accessed the blob data. The ‘user-agent-header’ field which contains the user agent or whatever accessed the blob and the ‘request-start-time’.

4.png

In your organisation the IP address or geolocation of your users may be well understood. As such examining these IPs may give you an indicator of possible recon behaviour. With a ‘honey bucket’ the storage account is never advertised or used, so an IP address that appears in this log is of interest.

Note: It isn’t just external entities which generate Azure Storage logging information. The Azure portal, Azure Storage API or other products such as Azure Storage Explorer could all generate log entries.

 

Getting the data into Azure Sentinel

 

At this point we will import these logs to Azure Sentinel to enable analysis. We can use an Azure Function to query the log files, extract the information and add this to the Azure Sentinel workspace. A sample Azure Function and installation instructions can be found in the Azure Sentinel GitHub page under the DataConnectors directory.


Diagnostic events are not written to the storage account in real time, it can take up to one hour for events to be available. The sample function runs once an hour, gathers the previous logs and examines them for List or Get operations.


As mentioned in the previous section, anything accessing the storage account could inadvertently add logging entries, this includes collecting the logs themselves. The sample Azure function does a reasonable job of whitelisting these to reduce false positives. It collects log entries of interest and adds the results to a custom Azure Sentinel table called ‘HoneyBucketLogs_CL’.

 

Threat hunting with Azure Sentinel

 

With the logs now in Azure Sentinel you can easily query the data and correlate with other sources.

5.png

 

 Executing a query like:

 

HoneyBucketLogs_CL 
| order by RequestTime_t desc
| project OriginIP_s, UserAgent_s

 

will return all the IP addresses and corresponding User Agents that triggered the honeybucket ‘tripwire’. These could be correlated against audit data from legitimate storage logs, Azure Active Directory sign-in events, or other log sources such as web application firewalls. The Azure Sentinel GitHub repository is a great source of inspiration for what you could query with a UserAgent or IP address.

The example below shows correlation against Azure Active Directory successful sign-ins:

6.png

7.png

8.png

 

Final thoughts

If you are using cloud-based storage, it is crucial to understand who can access your data. By default, Azure Storage does not create publicly visible blob storage. Where wider data access is configured, Azure Storage gives customers detailed auditing capabilities.

 

ATP for Azure Storage is Microsoft’s cloud-based security solution that monitors, analysis and reports on anomalies in your organisation. ATP for Azure Storage adds an additional layer of security intelligence that detects unusual and potentially harmful attempts to access or exploit storage account. If you are interested in monitoring for the types of threats described in this blog post you may also want to configure Azure ATP for your storage account and connect this data into your Azure Sentinel workspace.


Microsoft’s Threat Intelligence Center proactively uses data sources and techniques such as those described here to discover emerging threats as well as to ensure that our detection coverage is relevant to the attacks facing both Microsoft and its customers.

 

2 Comments
Regular Contributor

How are the logs you selected different then enabling Diagnostic Settings under the Activity Log?

Microsoft

The Diagnostic Logs will give you detailed information on the type of events that occurred in the storage account including information like UserAgent string, IP address, API etc. Much of this information is unavailable in the ActivityLog view, at least for the storage accounts I've inspected.

 

Expect to see audit activity and policy changes in the ActivityLog and detailed diagnostic information in the $logs directory.