Home
%3CLINGO-SUB%20id%3D%22lingo-sub-308710%22%20slang%3D%22en-US%22%3EContextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-308710%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%22toc-hId-1869968892%22%20id%3D%22toc-hId-1903187845%22%3EOverview%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fenable-mailbox-auditing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EExchange%20audit%20log%3C%2FA%3E%3C%2FSPAN%3E%20is%20an%20important%20tool%20in%20the%20defender%20toolbox%20to%20understand%20the%20activity%20of%20users%20(or%20attackers%20masquerading%20as%20users)%20in%20an%20organization.%20Defenders%20can%20manually%20browse%20through%20their%20audit%20logs%20for%20user%20activity%20that%20indicates%20malicious%20activity.%20These%20audit%20logs%20feed%20many%20first-party%20and%20third-party%20protect%2C%20detect%2C%20and%20investigate%20capabilities%20in%20Security%20Information%20and%20Event%20Managers%20(SIEMs).%20This%20data%20can%20be%20consumed%20via%20both%20the%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fprotection.office.com%2F%23%2Fhomepage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ESecurity%20and%20Compliance%20Center%3C%2FA%3E%3C%2FSPAN%3E%20(SCC)%20and%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fportal.cloudappsecurity.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Cloud%20App%20Security%3C%2FA%3E%3C%2FSPAN%3E%20(MCAS)%20for%20their%20detections.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EToday%2C%20we%20are%20offering%20session%20context%20in%20the%20exchange%20audit%20logs%20to%20empower%20defenders%20to%20better%20understand%20account%20activity%20and%20better%20distinguish%20malicious%20attackers%20from%20regular%20employees.%20Session%20ID%20will%20be%20audited%20as%20a%20part%20of%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fenable-mailbox-auditing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Emailbox%20audit%20logs%3C%2FA%3E%20%3C%2FSPAN%3Eand%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fpolicy-and-compliance%2Fadmin-audit-logging%2Fadmin-audit-logging%3Fview%3Dexchserver-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eadmin%20audit%20logs%3C%2FA%3E%3C%2FSPAN%3E.%20Session%20ID%20is%20a%20guid%20identifier%20encoded%20in%20the%20Azure%20AD%20token.%20The%20session%20ID%20is%20preserved%20over%20token%20refreshes%20and%20can%20group%20all%20actions%20a%20user%20has%20taken%20in%20a%20single%20logon%20session%20(a%20user%20has%20to%20re-enter%20credentials%20in%20order%20for%20the%20session%20ID%20to%20change).%20A%20few%20of%20the%20ways%20that%20this%20contextualization%20becomes%20useful%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EIn%20the%20case%20of%20compromise%20coming%20through%20a%20corporate%20VLAN%20where%20the%20IP%20address%20of%20the%20attacker%20matches%20that%20of%20the%20user%2C%20you%20can%20still%20distinguish%20attacker%20activity%20from%20that%20of%20a%20user%20via%20the%20session%20ID.%3C%2FLI%3E%0A%3CLI%3EIn%20the%20case%20that%20attackers%20use%20a%20third-party%20VPN%20with%20hundreds%20of%20IPs%20and%20compromise%20credentials%20for%20an%20account%2C%20you%20can%20track%20the%20actions%20through%20the%20user%20session%20even%20across%20varying%20IP%20addresses.%3C%2FLI%3E%0A%3CLI%3EYou%20can%20build%20a%20profile%20of%20what%20actions%20users%20typically%20take%20during%20a%20session%20and%20compare%20each%20new%20session%20for%20signs%20of%20anomalous%20behavior%20that%20may%20be%20indicative%20of%20a%20compromise.%3C%2FLI%3E%0A%3CLI%3EYou%20can%20understand%20how%20many%20individual%20sessions%20are%20occurring%20at%20one%20time%20on%20a%20user%E2%80%99s%20account.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20case%20where%20session%20ID%20can%20no%20longer%20help%20is%20when%20the%20attacker%20manages%20to%20steal%20the%20token.%20Since%20they%20are%20using%20the%20exact%20same%20token%20as%20the%20user%2C%20you%20would%20no%20longer%20be%20able%20to%20distinguish%20between%20attacker%20and%20the%20user%20actions.%20Token%20theft%20usually%20requires%20the%20attacker%20to%20control%20the%20user%20endpoint%2C%20however%2C%20which%20has%20other%20implications%20for%20the%20severity%20of%20the%20breach.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--682188069%22%20id%3D%22toc-hId--648969116%22%3ESession%20ID%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20session%20ID%20is%20encoded%20in%20the%20claims%20of%20the%20token%3B%20since%20the%20tokens%20can%20only%20be%20created%20by%20Azure%20AD%2C%20they%20offer%20protection%20against%20falsifying%20session%20information.%20For%20every%20action%20audited%20by%20Exchange%2C%20we%20are%20including%20the%20session%20ID%20in%20the%20audit%20logs.%20You%20can%20see%20an%20example%20of%20the%20audit%20log%20below.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20962px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64627iBC82F03C5AFA54AC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22session%20ID%20picture.png%22%20title%3D%22session%20ID%20picture.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESession%20ID%20in%20a%20MailboxLogin%20audit%20record%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20case%20that%20a%20user%E2%80%99s%20credentials%20get%20compromised%20and%20the%20attacker%20logs%20to%20execute%20malicious%20user%20activity%2C%20exchange%20auditing%20will%20log%20the%20actions%20with%20session%20IDs%20below%3A%20%3CFONT%20color%3D%22%23FF0000%22%3Ered%20%3C%2FFONT%3E(12bce%E2%80%A6)%20denotes%20attacker%20with%20%3CFONT%20color%3D%22%23339966%22%3Egreen%3C%2FFONT%3E%20(bdcea%E2%80%A6)%20denoting%20the%20user.%20As%20shown%20in%20the%20table%20below%2C%20you%20can%20distinguish%20between%20two%20kinds%20of%20user%20activity%20simply%20based%20on%20the%20session%20ID%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20style%3D%22width%3A%20650px%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2288%22%3E%3CP%3E%3CSTRONG%3ETimeStamp%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22173%22%3E%3CP%3E%3CSTRONG%3EAction%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22246%22%3E%3CP%3E%3CSTRONG%3ESession%20ID%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E3%3A42%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22173%22%3E%3CP%3EMailboxLogin%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22261%22%3E%3CP%3E%3CFONT%20color%3D%22%23339966%22%3E%3CEM%3Ebdcea574-5cfd-48b1-ab5b-d826f164da53%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E4%3A35%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22173%22%3E%3CP%3EMailboxLogin%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22261%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E4%3A45%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22173%22%3E%3CP%3EMoveToDeleted%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22261%22%3E%3CP%3E%3CFONT%20color%3D%22%23339966%22%3E%3CEM%3Ebdcea574-5cfd-48b1-ab5b-d826f164da53%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E4%3A59%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22173%22%3E%3CP%3EAddInboxRules%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22261%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E5%3A12%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22174%22%3E%3CP%3EAddFolderPermissions%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22261%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E5%3A30%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22173%22%3E%3CP%3ESet-Mailbox%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22261%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1060622266%22%20id%3D%22toc-hId-1093841219%22%3ESet%20up%20your%20organization%20to%20use%20Session%20ID%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1688048200%22%20id%3D%22toc-hId--1654829247%22%3ETurn%20on%20Auditing%20for%20your%20Organization%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETurning%20on%20auditing%20is%20an%20important%20all-up%20security%20measure%20for%20your%20organization.%20Audit%20data%20is%20important%20to%20understand%20not%20only%20what%20actions%20were%20taken%20in%20the%20organization%20but%20in%20what%20context%20did%20the%20actions%20take%20place%20(IP%20address%2C%20user%2C%20session%20ID%2C%20etc.)%20To%20get%20the%20full%20range%20of%20audit%20data%20in%20Exchange%2C%20you%20need%20to%20make%20sure%20mailbox%20auditing%20is%20turned%20on.%20Starting%20from%20the%202019%20calendar%20year%2C%20auditing%20will%20be%20enabled%20by%20default%20but%20you%20should%20check%20if%20your%20organization%20has%20auditing%20enabled%20from%20this%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FSecurity-Privacy-and-Compliance%2FExchange-Mailbox-Auditing-will-be-enabled-by-default%2Fba-p%2F215171%22%20target%3D%22_blank%22%3Eblogpost%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20should%20also%20turn%20on%20Office%20365%20Unified%20Auditing%20to%20record%20audit%20data%20from%20workloads%20besides%20Exchange%20as%20well%20as%20enable%20Microsoft%20365%20detection%20capabilities%20and%20scalable%20consumption%20of%20audit%20data%20across%20your%20organization.%20You%20can%20find%20instructions%20to%20turn%20on%20Unified%20Auditing%20in%20this%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fturn-audit-log-search-on-or-off%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Edocumentation%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-54762135%22%20id%3D%22toc-hId-87981088%22%3EBlock%20Basic%20Authentication%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20caveat%20to%20using%20the%20Session%20ID%20is%20that%20it%20is%20an%20AAD%20construct%20which%20does%20not%20exist%20in%20the%20case%20of%20legacy%20authentication%3B%20it%20can%20only%20be%20tracked%20when%20the%20logon%20occurs%20through%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-gb%2Farticle%2Fenable-or-disable-modern-authentication-in-exchange-online-58018196-f918-49cd-8238-56f57f38d662%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Emodern%20authentication%3C%2FA%3E%3C%2FSPAN%3E.%20Since%20the%20session%20ID%20is%20not%20present%20unless%20a%20user%20is%20authenticating%20via%20modern%20authentication%20through%20Azure%20AD%2C%20you%20need%20to%20disable%20legacy%20authentication%20throughout%20your%20organization.%20The%20benefits%20of%20blocking%20basic%20authentication%20cannot%20be%20overstated%3B%20they%20enable%20a%20host%20of%20protection%20capabilities.%20You%20can%20find%20more%20information%20about%20how%20to%20block%20legacy%20authentication%20and%20the%20benefits%20in%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Active-Directory-Identity%2FAzure-AD-Conditional-Access-support-for-blocking-legacy-auth-is%2Fba-p%2F245417%22%20target%3D%22_blank%22%3Ethis%20blogpost%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1994085975%22%20id%3D%22toc-hId-2027304928%22%3EInvestigating%20Attacker%20Activities%20using%20Session%20ID%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20investigating%20an%20incident%2C%20defenders%20use%20pivots%20through%20with%20which%20they%20can%20identify%20attackers%20to%20link%20together%20actions%20and%20understand%20the%20full%20attack%20chain.%20Examples%20of%20pivots%20used%20are%20properties%20such%20as%20user%20account%2C%20IP%20address%2C%20target%20mailbox%2C%20activity%20pattern%2C%20resource%2Fasset%2C%20etc.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--754584491%22%20id%3D%22toc-hId--721365538%22%3EScenario%3A%20Correlate%20attacker%20action%20when%20they%20use%20third-party%20VPNs%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20order%20to%20hide%20their%20tracks%2C%20attackers%20use%20VPNs%20or%20TOR%20to%20hide%20their%20IP%20addresses%20to%20avoid%20law%20enforcement%20retaliation.%20These%20networks%20regularly%20have%20thousands%20of%20servers%20with%20different%20IP%20addresses%20that%20attackers%20can%20constantly%20switch%20between%3B%20defenders%20cannot%20depend%20on%20simply%20filtering%20on%20a%20single%20IP%20address%20to%20get%20the%20full%20story%20of%20actions%20that%20the%20attacker%20took.%20Filtering%20on%20the%20user%20agent%20on%20the%20other%20hand%20would%20result%20in%20activities%20bleeding%20into%20the%20search%20query%20from%20the%20day-to-day%20benign%20operations%20(from%20the%20organization%20itself)%20on%20that%20account%20which%20could%20be%20incredibly%20noisy.%20However%2C%20since%20a%20single%20AAD%20session%20can%20persist%20for%20as%20long%20as%20180%20days%2C%20filtering%20on%20the%20session%20ID%20will%20allow%20defenders%20to%20quickly%20and%20accurately%20filter%20and%20understand%20what%20the%20attacker%20had%20done%20during%20that%20session.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-988225844%22%20id%3D%22toc-hId-1021444797%22%3EScenario%3A%20Distinguish%20attacker%20actions%20when%20they%20have%20compromised%20the%20corporate%20VPN%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20common%20attack%20vector%20is%20the%20compromise%20of%20a%20corporate%20VPN.%20This%20compromise%20helps%20attackers%20get%20around%20a%20host%20of%20protections%20and%20detections%20that%20corporations%20set%20up%20against%20access%20from%20an%20external%20network.%20Furthermore%2C%20investigating%20these%20breaches%20can%20be%20challenging%20because%20the%20IP%20address%20cannot%20be%20used%20to%20distinguish%20between%20corporate%20and%20external%20traffic%20since%20it%20would%20be%20the%20IP%20address%20of%20the%20VPN%20service.%20In%20this%20case%2C%20defenders%20can%20distinguish%20between%20separate%20logon%20sessions%20by%20filtering%20on%20the%20session%20ID%3B%20this%20will%20allow%20defenders%20to%20remove%20the%20noise%20of%20the%20day-to-day%20organization%20activity%20and%20focus%20on%20the%20session%20during%20which%20the%20attacker%20operated.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20example%20below%2C%20there%20is%20a%20chronological%20list%20of%20audit%20records%20from%20a%20service%20account%20in%20exchange.%20One%20of%20the%20actions%2C%20AddInboxRules%2C%20would%20be%20an%20action%20of%20interest%20though%20not%20representative%20by%20a%20breach%20by%20itself.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20style%3D%22width%3A%20650px%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20colspan%3D%223%22%20width%3D%22539%22%3E%3CP%20style%3D%22text-align%3A%20center%3B%22%3E%E2%80%A6%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E3%3A42%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EMailboxLogin%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%233366FF%22%3Ebdcea574-5cfd-48b1-ab5b-d826f164da53%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E4%3A35%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EMailboxLogin%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%233366FF%22%3Ebdcea574-5cfd-48b1-ab5b-d826f164da53%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E4%3A45%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3ENew-MailboxAuditLogSearch%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%233366FF%22%3Ebdcea574-5cfd-48b1-ab5b-d826f164da53%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E4%3A59%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EAddInboxRules%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%23800080%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E5%3A12%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3ESet-Mailbox%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%233366FF%22%3Ebdcea574-5cfd-48b1-ab5b-d826f164da53%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E5%3A30%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3ESet-Mailbox%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%233366FF%22%3Ebdcea574-5cfd-48b1-ab5b-d826f164da53%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20colspan%3D%223%22%20width%3D%22539%22%3E%3CP%20style%3D%22text-align%3A%20center%3B%22%3E%E2%80%A6%3C%2FP%3E%0A%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%3ELet%E2%80%99s%20imagine%20that%20while%20investigating%20a%20breach%20a%20defender%20finds%20it%20odd%20that%20at%20some%20point%20that%20service%20account%20would%20create%20an%20inbox%20rule%2C%20especially%20over%20mail%20protocols%20rather%20than%20powershell.%20In%20this%20case%20the%20defender%20might%20be%20inclined%20to%20filter%20the%20mailbox%20audit%20records%20for%20all%20actions%20in%20that%20session%20and%20find%20the%20following%20list%20of%20actions.%3C%2FP%3E%0A%3CTABLE%20style%3D%22width%3A%20650px%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E1%3A00%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EAddInboxRules%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E1%3A34%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EAddFolderPermissions%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E1%3A42%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EAddFolderPermissions%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E4%3A59%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EAddInboxRules%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E12%3A34%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EAddFolderPermissions%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2286%22%3E%3CP%3E15%3A23%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22189%22%3E%3CP%3EAddFolderPermissions%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22264%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E12bce6d0-bfeb-4a82-abe6-98ccf3196a11%3C%2FFONT%3E%3C%2FP%3E%0A%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%3EAt%20this%20point%2C%20the%20defender%20might%20be%20very%20suspicious%20that%20they%20see%20so%20many%20AddInboxRules%20and%20AddFolderPermissions%20activities%20over%20mail%20protocols%20in%20a%20single%20session%20when%20they%20don%E2%80%99t%20have%20any%20automation%20to%20do%20this.%20Digging%20deeper%20into%20this%20session%2C%20the%20defender%20would%20reach%20out%20to%20the%20user%20responsible%20for%20all%20these%20actions%20through%20another%20medium%20(ie.%20phone)%20and%20find%20out%20that%20the%20user%20had%20no%20recollection%20of%20taking%20these%20actions.%20The%20defender%20might%20also%20look%20into%20the%20specific%20inbox%20rules%20being%20created%20and%20notice%20that%20they%20are%20forwarding%20mails%20to%20an%20external%20entity%20with%20the%20keyword%20%E2%80%9Cinvoice%E2%80%9D.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDuring%20this%20investigation%2C%20the%20defender%20moved%20from%20seeing%20something%20that%20is%20a%20little%20odd%2C%20to%20quickly%20understanding%20everything%20that%20occurred%20during%20that%20session%2C%20to%20recognizing%20that%20the%20session%20belongs%20to%20an%20attacker%20who%20has%20malicious%20motives.%20Now%20that%20the%20defender%20was%20able%20to%20quickly%20identify%20the%20session%20as%20malicious%2C%20they%20could%20close%20access%20to%20the%20account%20and%20move%20to%20study%20which%20accounts%20has%20the%20attacker%20compromised%2C%20scope%20the%20extent%20of%20the%20compromise%20and%20remediate%20by%20removing%20the%20inbox%20rules%2Ffolder%20permissions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--1367417612%22%20id%3D%22toc-hId--1334198659%22%3EAdditional%20Resources%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzxwtXdEF97M%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIgnite%20presentation%3C%2FA%3E%3C%2FSPAN%3E%20on%20investments%20in%20Exchange%20auditing%20and%20other%20Exchange%20security%20features%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fenable-mailbox-auditing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ETechNet%20article%3C%2FA%3E%3C%2FSPAN%3E%20on%20Exchange%20mailbox%20auditing%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FSecurity-Privacy-and-Compliance%2FExchange-Mailbox-Auditing-will-be-enabled-by-default%2Fba-p%2F215171%22%20target%3D%22_blank%22%3EBlogpost%3C%2FA%3E%3C%2FSPAN%3E%20on%20default%20enablement%20of%20Exchange%20mailbox%20auditing%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fsearch-the-audit-log-in-security-and-compliance%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ETechNet%20article%3C%2FA%3E%3C%2FSPAN%3E%20on%20auditing%20across%20Office%20365%20services%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWe%20hope%20this%20post%20has%20helped%20you%20understand%20more%20about%20how%20to%20use%20your%20audit%20data%20effectively%20to%20protect%20your%20organization.%20Leave%20us%20a%20comment%20below%20with%20feedback!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-308710%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20668px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64634iAB7BAE128EC50955%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22sessionIDDifferentiation.PNG%22%20title%3D%22sessionIDDifferentiation.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EToday%2C%20we%20are%20offering%20session%20context%20in%20the%20exchange%20audit%20logs%20to%20empower%20defenders%20to%20better%20understand%20account%20activity%20and%20better%20distinguish%20malicious%20attackers%20from%20regular%20employees.%20Session%20ID%20will%20be%20audited%20as%20a%20part%20of%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fenable-mailbox-auditing%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Emailbox%20audit%20logs%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eand%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fpolicy-and-compliance%2Fadmin-audit-logging%2Fadmin-audit-logging%3Fview%3Dexchserver-2019%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Eadmin%20audit%20logs%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%3E.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326001%22%20slang%3D%22en-US%22%3ERe%3A%20Contextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326001%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F78414%22%20target%3D%22_blank%22%3E%40Jeff%20Sun%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20awesome%20-%20however%20the%20SessionId%20is%20not%20available%20when%20forwarding%20logs%20to%20Azure%20Log%20Analytics.%26nbsp%3B%20I%20usually%20use%20the%20Log%20Analytics%20platform%20for%20query%20and%20search%20using%20the%20'OfficeActivity'%20table..%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20please%20send%20that%20field%20over%20with%20the%20rest%20of%20the%20UnifiedAuditLog%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-312815%22%20slang%3D%22en-US%22%3ERe%3A%20Contextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-312815%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F171574%22%20target%3D%22_blank%22%3E%40Michael%20Sampson%3C%2FA%3E%2C%20agree%20with%20you%20here.%20Working%20with%20other%20workloads%20to%20incorporate%20this.%20Your%20feedback%20will%20help%20motivate%20them!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-312634%22%20slang%3D%22en-US%22%3ERe%3A%20Contextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-312634%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F78414%22%20target%3D%22_blank%22%3E%40Jeff%20Sun%3C%2FA%3E%26nbsp%3BIs%20there%20a%20sense%20of%20when%20Session%20ID%20will%20be%20added%20to%20audit%20log%20entries%20for%20other%20workloads%20beyond%20Exchange%20Online%3F%20Surely%26nbsp%3Bthis%20is%20an%20idea%20with%20much%20wider%20applicability.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-312526%22%20slang%3D%22en-US%22%3ERe%3A%20Contextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-312526%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20confirmation%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F78414%22%20target%3D%22_blank%22%3E%40Jeff%20Sun%3C%2FA%3E.%20I%20thought%20you%20had%20done%20that%3B%20it%20was%20too%20much%20of%20a%20coincidence.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-310431%22%20slang%3D%22en-US%22%3ERe%3A%20Contextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-310431%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F171574%22%20target%3D%22_blank%22%3E%40Michael%20Sampson%3C%2FA%3E%2C%20I%20just%20needed%20a%20GUID%20and%20used%20the%20one%20from%20organization%20ID.%20It%20doesn't%20mean%20anything%2C%20pretend%20that%20the%20organization%20ID%20is%20some%20other%20random%20value.%20No%20connection%20between%20session%20ID%20and%20organization%20ID.%20I%20didn't%20think%20someone%20would%20have%20had%20the%20sharp%20eye%20to%20pick%20that%20out%20%3A)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-310409%22%20slang%3D%22en-US%22%3ERe%3A%20Contextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-310409%22%20slang%3D%22en-US%22%3E%3CP%3EWhy%20does%20the%20%22SessionId%22%20in%20images%202%2C%203%20and%204%20match%20the%20OrganizationId%20from%20image%201%3F%20Is%20that%20intentional%20as%20a%20demo%20value%2C%20or%20something%20else%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-309636%22%20slang%3D%22en-US%22%3ERe%3A%20Contextualizing%20Attacker%20Activity%20within%20Sessions%20in%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-309636%22%20slang%3D%22en-US%22%3E%3CP%3EFor%20those%20wondering%20how%20to%20get%20the%20audit%20records%20for%20a%20session%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Foffice365itpros.com%2F2019%2F01%2F07%2Fusing-exchange-session-identifiers-audit-log%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Foffice365itpros.com%2F2019%2F01%2F07%2Fusing-exchange-session-identifiers-audit-log%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Overview

 

The Exchange audit log is an important tool in the defender toolbox to understand the activity of users (or attackers masquerading as users) in an organization. Defenders can manually browse through their audit logs for user activity that indicates malicious activity. These audit logs feed many first-party and third-party protect, detect, and investigate capabilities in Security Information and Event Managers (SIEMs). This data can be consumed via both the Security and Compliance Center (SCC) and Microsoft Cloud App Security (MCAS) for their detections.

 

Today, we are offering session context in the exchange audit logs to empower defenders to better understand account activity and better distinguish malicious attackers from regular employees. Session ID will be audited as a part of mailbox audit logs and admin audit logs. Session ID is a guid identifier encoded in the Azure AD token. The session ID is preserved over token refreshes and can group all actions a user has taken in a single logon session (a user has to re-enter credentials in order for the session ID to change). A few of the ways that this contextualization becomes useful:

 

  • In the case of compromise coming through a corporate VLAN where the IP address of the attacker matches that of the user, you can still distinguish attacker activity from that of a user via the session ID.
  • In the case that attackers use a third-party VPN with hundreds of IPs and compromise credentials for an account, you can track the actions through the user session even across varying IP addresses.
  • You can build a profile of what actions users typically take during a session and compare each new session for signs of anomalous behavior that may be indicative of a compromise.
  • You can understand how many individual sessions are occurring at one time on a user’s account.

 

The case where session ID can no longer help is when the attacker manages to steal the token. Since they are using the exact same token as the user, you would no longer be able to distinguish between attacker and the user actions. Token theft usually requires the attacker to control the user endpoint, however, which has other implications for the severity of the breach.

 

Session ID

 

The session ID is encoded in the claims of the token; since the tokens can only be created by Azure AD, they offer protection against falsifying session information. For every action audited by Exchange, we are including the session ID in the audit logs. You can see an example of the audit log below.

session ID picture.pngSession ID in a MailboxLogin audit record

 

In the case that a user’s credentials get compromised and the attacker logs to execute malicious user activity, exchange auditing will log the actions with session IDs below: red (12bce…) denotes attacker with green (bdcea…) denoting the user. As shown in the table below, you can distinguish between two kinds of user activity simply based on the session ID below.

 

TimeStamp

Action

Session ID

3:42

MailboxLogin

bdcea574-5cfd-48b1-ab5b-d826f164da53

4:35

MailboxLogin

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

4:45

MoveToDeleted

bdcea574-5cfd-48b1-ab5b-d826f164da53

4:59

AddInboxRules

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

5:12

AddFolderPermissions

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

5:30

Set-Mailbox

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

 

Set up your organization to use Session ID

 

Turn on Auditing for your Organization

 

Turning on auditing is an important all-up security measure for your organization. Audit data is important to understand not only what actions were taken in the organization but in what context did the actions take place (IP address, user, session ID, etc.) To get the full range of audit data in Exchange, you need to make sure mailbox auditing is turned on. Starting from the 2019 calendar year, auditing will be enabled by default but you should check if your organization has auditing enabled from this blogpost.

 

You should also turn on Office 365 Unified Auditing to record audit data from workloads besides Exchange as well as enable Microsoft 365 detection capabilities and scalable consumption of audit data across your organization. You can find instructions to turn on Unified Auditing in this documentation.

 

Block Basic Authentication

 

One caveat to using the Session ID is that it is an AAD construct which does not exist in the case of legacy authentication; it can only be tracked when the logon occurs through modern authentication. Since the session ID is not present unless a user is authenticating via modern authentication through Azure AD, you need to disable legacy authentication throughout your organization. The benefits of blocking basic authentication cannot be overstated; they enable a host of protection capabilities. You can find more information about how to block legacy authentication and the benefits in this blogpost.

 

Investigating Attacker Activities using Session ID

 

When investigating an incident, defenders use pivots through with which they can identify attackers to link together actions and understand the full attack chain. Examples of pivots used are properties such as user account, IP address, target mailbox, activity pattern, resource/asset, etc.

 

Scenario: Correlate attacker action when they use third-party VPNs

 

In order to hide their tracks, attackers use VPNs or TOR to hide their IP addresses to avoid law enforcement retaliation. These networks regularly have thousands of servers with different IP addresses that attackers can constantly switch between; defenders cannot depend on simply filtering on a single IP address to get the full story of actions that the attacker took. Filtering on the user agent on the other hand would result in activities bleeding into the search query from the day-to-day benign operations (from the organization itself) on that account which could be incredibly noisy. However, since a single AAD session can persist for as long as 180 days, filtering on the session ID will allow defenders to quickly and accurately filter and understand what the attacker had done during that session.

 

Scenario: Distinguish attacker actions when they have compromised the corporate VPN

 

A common attack vector is the compromise of a corporate VPN. This compromise helps attackers get around a host of protections and detections that corporations set up against access from an external network. Furthermore, investigating these breaches can be challenging because the IP address cannot be used to distinguish between corporate and external traffic since it would be the IP address of the VPN service. In this case, defenders can distinguish between separate logon sessions by filtering on the session ID; this will allow defenders to remove the noise of the day-to-day organization activity and focus on the session during which the attacker operated.

 

In the example below, there is a chronological list of audit records from a service account in exchange. One of the actions, AddInboxRules, would be an action of interest though not representative by a breach by itself.

 

3:42

MailboxLogin

bdcea574-5cfd-48b1-ab5b-d826f164da53

4:35

MailboxLogin

bdcea574-5cfd-48b1-ab5b-d826f164da53

4:45

New-MailboxAuditLogSearch

bdcea574-5cfd-48b1-ab5b-d826f164da53

4:59

AddInboxRules

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

5:12

Set-Mailbox

bdcea574-5cfd-48b1-ab5b-d826f164da53

5:30

Set-Mailbox

bdcea574-5cfd-48b1-ab5b-d826f164da53

 

Let’s imagine that while investigating a breach a defender finds it odd that at some point that service account would create an inbox rule, especially over mail protocols rather than powershell. In this case the defender might be inclined to filter the mailbox audit records for all actions in that session and find the following list of actions.

1:00

AddInboxRules

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

1:34

AddFolderPermissions

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

1:42

AddFolderPermissions

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

4:59

AddInboxRules

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

12:34

AddFolderPermissions

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

15:23

AddFolderPermissions

12bce6d0-bfeb-4a82-abe6-98ccf3196a11

 

At this point, the defender might be very suspicious that they see so many AddInboxRules and AddFolderPermissions activities over mail protocols in a single session when they don’t have any automation to do this. Digging deeper into this session, the defender would reach out to the user responsible for all these actions through another medium (ie. phone) and find out that the user had no recollection of taking these actions. The defender might also look into the specific inbox rules being created and notice that they are forwarding mails to an external entity with the keyword “invoice”.

 

During this investigation, the defender moved from seeing something that is a little odd, to quickly understanding everything that occurred during that session, to recognizing that the session belongs to an attacker who has malicious motives. Now that the defender was able to quickly identify the session as malicious, they could close access to the account and move to study which accounts has the attacker compromised, scope the extent of the compromise and remediate by removing the inbox rules/folder permissions.

 

Additional Resources

 

We hope this post has helped you understand more about how to use your audit data effectively to protect your organization. Leave us a comment below with feedback!

 

 

 

7 Comments

For those wondering how to get the audit records for a session: https://office365itpros.com/2019/01/07/using-exchange-session-identifiers-audit-log/

Occasional Contributor

Why does the "SessionId" in images 2, 3 and 4 match the OrganizationId from image 1? Is that intentional as a demo value, or something else? 

Microsoft

@Michael Sampson, I just needed a GUID and used the one from organization ID. It doesn't mean anything, pretend that the organization ID is some other random value. No connection between session ID and organization ID. I didn't think someone would have had the sharp eye to pick that out :)

Occasional Contributor

Thanks for the confirmation @Jeff Sun. I thought you had done that; it was too much of a coincidence. 

Occasional Contributor

@Jeff Sun Is there a sense of when Session ID will be added to audit log entries for other workloads beyond Exchange Online? Surely this is an idea with much wider applicability. 

Microsoft

@Michael Sampson, agree with you here. Working with other workloads to incorporate this. Your feedback will help motivate them!

Frequent Contributor

@Jeff Sun 

This is awesome - however the SessionId is not available when forwarding logs to Azure Log Analytics.  I usually use the Log Analytics platform for query and search using the 'OfficeActivity' table.. 

 

Can you please send that field over with the rest of the UnifiedAuditLog?