%3CLINGO-SUB%20id%3D%22lingo-sub-1457721%22%20slang%3D%22en-US%22%3EProtecting%20your%20GitHub%20assets%20with%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1457721%22%20slang%3D%22en-US%22%3E%3CP%3ESpecial%20thanks%20to%3CSPAN%3E%26nbsp%3B-ERR%3AREF-NOT-FOUND-%40Nicholas%20DiCola%20(SECURITY%20JEDI)%26nbsp%3B%3C%2FSPAN%3Eand%3CSPAN%3E%26nbsp%3BMor%20Rubin%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Bthat%20collaborated%20with%20me%20on%20this%20blog%20post.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGitHub%20online%20platform%20enables%20developers%20to%20find%2C%20share%2C%20build%2C%20and%20collaborate%20on%20software.%20Many%20organizations%20are%20using%20%3CEM%3EGitHub%3C%2FEM%3E%20as%20their%20software%20development%20version%20control%20mechanism%20and%20source%20code%20management.%20The%20site%20hosts%20public%20and%20private%20folders%2C%20or%20repositories%2C%20through%20which%20remote%20developers%20can%20upload%20source%20code%20and%20share%20it%20with%20collaborators.%3C%2FP%3E%0A%3CP%3EWith%20the%20increase%20usage%20of%20%3CEM%3EGitHub%2C%20%3C%2FEM%3Ethere%20was%20an%26nbsp%3Bincrease%20in%20the%20numbers%20of%20attacks%20against%20it.%20Example%20attacks%20campaigns%20usually%20starts%20with%20phishing%20email%20to%20users%2C%20which%20leads%20to%20compromised%20user%20account%20accessing%20the%20organization's%20%3CEM%3EGitHub%20%3C%2FEM%3Erepositories%20-%20cloning%20private%20repositories%20and%20exposing%20sensitive%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%26nbsp%3B-ERR%3AREF-NOT-FOUND-multiple%20features%26nbsp%3Bto%20help%20you%20secure%20your%20%3CEM%3EGitHub%3C%2FEM%3E%20organization%2C%20but%20in%20this%20blog%20we%20will%20introduce%20a%20solution%20which%20uses%20Logic%20Apps%20to%20pull%20%3CEM%3EGitHub%3C%2FEM%3E%20audit%20logs%20%26amp%3B%20ingest%20them%20into%20Sentinel.%20Helping%20SecOps%20gain%20visibility%20to%20their%26nbsp%3Borganization's%26nbsp%3B%3CEM%3EGitHub%3C%2FEM%3E%26nbsp%3Brepositories%2C%20which%20is%20often%20lacking%2C%20and%20provide%20SOC%20team%26nbsp%3Bhunting%20queries%20%26amp%3B%20detection%20which%20spans%20across%20Mitre%26nbsp%3B%3CEM%3EATT%26amp%3BCK%20%3C%2FEM%3Eframework%20to%20protect%20their%20%3CEM%3EGitHub%20data%2C%26nbsp%3B%3C%2FEM%3Eorganization%20and%20users.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3EThe%20following%20tables%20contains%20the%20various%20hunting%20%26amp%3B%20detection%20queries%20on%20top%20of%26nbsp%3B%3CEM%3EGitHub%3C%2FEM%3E%20data%3CTABLE%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2229px%22%3E%3CP%3E%3CSTRONG%3EScenario%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2229px%22%3E%3CP%3E%3CSTRONG%3EType%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2229px%22%3E%3CP%3E%3CSTRONG%3EMitre%20Tactic%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2229px%22%3E%3CP%3E%3CSTRONG%3EMitre%20Techniques%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FGitHub%2FBrute%2520Force%2520Attack%2520against%2520GitHub%2520Account.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EBrute%20Force%20Attack%20against%20GitHub%20Account%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EDetection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3ECredential%20Access%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1110%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1110%20-%20Brute%20Force%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FGitHub%2FGitHub%2520Activities%2520from%2520Infrequent%2520Country%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGitHub%20Activities%20from%20Infrequent%20Country%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EDetection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3EInitial%20Access%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1078%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1078%20-%20Valid%20Accounts%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FGitHub%2FSign-in%2520Burst%2520from%2520Multiple%2520Locations.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESign-in%20Burst%20from%20Multiple%20Locations%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EDetection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3ECredential%20Access%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1110%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1110%20-%20Brute%20Force%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FGitHub%2FThreat%2520Intel%2520Matches%2520to%2520GitHub%2520Audit%2520Logs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EThreat%20Intel%20Matches%20to%20GitHub%20Audit%20Logs%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EDetection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3EMitigation%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1212%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1212%20-%20Exploitation%20for%20Credential%20Access%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FGitHub%2FTwo%2520Factor%2520Authentication%2520Disabled.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ETwo%20Factor%20Authentication%20Disabled%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EDetection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3EDefense%20Evasion%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1089%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1089%20-%20Disable%20Security%20tools%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FGitHub%2FSecurity%2520Vulnerability%2520in%2520Repo.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESecurity%20Vulnerability%20in%20Repo%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EDetection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3EExecution%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1203%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1203%20-%20Exploitation%20for%20Client%20Execution%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2229px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FInactive%2520or%2520New%2520Account%2520Usage.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EInactive%20or%20New%20Account%20Usage%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2229px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2229px%22%3E%3CP%3EPersistence%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2229px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1136%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1136%20-%20Create%20Account%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FUnusual%2520Number%2520of%2520Repository%2520Clones%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUnusual%20Number%20of%20Repository%20Clones%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3ECollection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1213%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1213%20-%20Data%20from%20Information%20Repositories%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2282px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FUser%2520Grant%2520Access%2520and%2520Grants%2520Other%2520Access.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUser%20Grant%20Access%20and%20Grants%20Other%20Access%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2282px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2282px%22%3E%3CP%3EPersistence%3C%2FP%3E%0A%3CP%3EPrivilege%20Escalation%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2282px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1098%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1098%20-%20Account%20Manipulation%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1078%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1078%20-%20Valid%20Accounts%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2282px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FOauth%2520App%2520Restrictions%2520Disabled.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOath%20App%20Restrictions%20Disabled%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2282px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2282px%22%3E%3CP%3EPersistence%3C%2FP%3E%0A%3CP%3EDefense%20Evasion%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2282px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1100%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1100%20-%20Web%20Shell%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1089%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1089%20-%20Disabling%20Security%20Tools%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2229px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FMass%2520Deletion%2520of%2520Repositories%2520.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMass%20Deletion%20of%20Repositories%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2229px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2229px%22%3E%3CP%3EImpact%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2229px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1485%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1485%20-%20Data%20Destruction%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%22136px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FOrg%2520Repositories%2520Default%2520Permissions%2520Change.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOrg%20Repositories%20Default%20Permission%20Change%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%22136px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%22136px%22%3E%3CP%3EDefense%20Evasion%20Persistence%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%22136px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1098%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1098%20-%20Account%20Manipulation%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1089%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1089%20-%20Disabling%20Security%20Tools%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FRepository%2520Permission%2520Switched%2520to%2520Public.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ERepositories%20Permissions%20Switched%20to%20Public%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3ECollection%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1213%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1213%20-%20Data%20from%20Information%20Repositories%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FSuspicious%2520Fork%2520Activity.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESuspicious%20Fork%20Activity%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3EExfiltration%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1537%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1537-%20Transfer%20Data%20to%20Cloud%20Account%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FUser%2520First%2520Time%2520Repository%2520Delete%2520Activity.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUser%20First%20Time%20Repository%20Delete%20Activity%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3EImpact%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1485%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1485%20-%20Data%20Destruction%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2236.59574468085106%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FGitHub%2FFirst%2520Time%2520User%2520Invite%2520and%2520Add%2520Member%2520to%2520Org.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFirst%20Time%20User%20Add%20and%20Invite%20Member%20to%20Org%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2212.866349298876262%25%22%20height%3D%2256px%22%3E%3CP%3EHunting%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2221.920398976650798%25%22%20height%3D%2256px%22%3E%3CP%3EPersistence%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2228.61750704362188%25%22%20height%3D%2256px%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Ftechniques%2FT1136%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ET1136%20-%20Create%20Account%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3EThe%20following%20tables%20contains%20the%20various%20hunting%20%26amp%3B%20detection%20queries%20on%20top%20of%26nbsp%3BGitHub%20data%20Scenario%20Type%20Mitre%20Tactic%20Mitre%20Techniques%20Brute%20Force%20Attack%20against%20GitHub%20Account%20Detection%20Credential%20Access%20T1110%20-%20Brute%20Force%20GitHub%20Activities%20from%20Infrequent%20Country%20Detection%20Initial%20Access%20T1078%20-%20Valid%20Accounts%20Sign-in%20Burst%20from%20Multiple%20Locations%20Detection%20Credential%20Access%20T1110%20-%20Brute%20Force%20Threat%20Intel%20Matches%20to%20GitHub%20Audit%20Logs%20Detection%20Mitigation%20T1212%20-%20Exploitation%20for%20Credential%20Access%20Two%20Factor%20Authentication%20Disabled%20Detection%20Defense%20Evasion%20T1089%20-%20Disable%20Security%20tools%20Security%20Vulnerability%20in%20Repo%20Detection%20Execution%20T1203%20-%20Exploitation%20for%20Client%20Execution%20Inactive%20or%20New%20Account%20Usage%20Hunting%20Persistence%20T1136%20-%20Create%20Account%20Unusual%20Number%20of%20Repository%20Clones%20Hunting%20Collection%20T1213%20-%20Data%20from%20Information%20Repositories%20User%20Grant%20Access%20and%20Grants%20Other%20Access%20Hunting%20Persistence%20Privilege%20Escalation%20T1098%20-%20Account%20Manipulation%20T1078%20-%20Valid%20Accounts%20Oath%20App%20Restrictions%20Disabled%20Hunting%20Persistence%20Defense%20Evasion%20T1100%20-%20Web%20Shell%20T1089%20-%20Disabling%20Security%20Tools%20Mass%20Deletion%20of%20Repositories%20Hunting%20Impact%20T1485%20-%20Data%20Destruction%20Org%20Repositories%20Default%20Permission%20Change%20Hunting%20Defense%20Evasion%20Persistence%20T1098%20-%20Account%20Manipulation%20T1089%20-%20Disabling%20Security%20Tools%20%26nbsp%3B%20Repositories%20Permissions%20Switched%20to%20Public%20Hunting%20Collection%20T1213%20-%20Data%20from%20Information%20Repositories%20Suspicious%20Fork%20Activity%20Hunting%20Exfiltration%20T1537-%20Transfer%20Data%20to%20Cloud%20Account%20User%20First%20Time%20Repository%20Delete%20Activity%20Hunting%20Impact%20T1485%20-%20Data%20Destruction%20First%20Time%20User%20Add%20and%20Invite%20Member%20to%20Org%20Hunting%20Persistence%20T1136%20-%20Create%20Account%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3E%3CFONT%20size%3D%226%22%3ECollecting%26nbsp%3BGitHub%26nbsp%3BData%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThis%20section%20explains%20how%20to%20use%20the%20ARM%20template%20to%20deploy%20the%20Logic%20Apps%20playbooks%2C%20Key%20Vault%20and%20Storage%20Account%20to%20ingest%26nbsp%3B%3CEM%3EGitHub%20%3C%2FEM%3Elogs%20into%26nbsp%3BAzure%20Sentinel.%26nbsp%3B%20This%20is%20done%20by%20using%20three%20Logic%20Apps%20Playbooks.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22architecture.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F198373i812662083495FD2E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22architecture.png%22%20alt%3D%22architecture.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAll%20three%20playbooks%20use%20Key%20Vault%20to%20read%20a%20secret%20which%20is%20needed%20for%20API%20authentication.%26nbsp%3B%20They%20also%20use%20a%20storage%20account%20which%20holds%20two%20file%20types%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EORGS.json%20-%20contains%20is%20a%20list%20of%20GitHub%20Orgs%20you%20want%20the%20playbooks%20to%20query.%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3Elastrun-*.json%20-%20stores%20the%20last%20run%20time%20and%20a%20cursor%20string.%26nbsp%3B%20This%20string%20is%20used%20to%20calculate%20the%20last%20record%20that%20was%20received%20and%20only%20query%20newer%20records%20since%20then.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EPlaybooks%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-GitHubAuditEntry%20Playbook%3C%2FSTRONG%3E%20-%26nbsp%3B%20runs%20every%205%20minutes%20and%20uses%20GitHub%20v4%20API%20(GraphQL)%20to%20query%20for%20a%20set%20of%20-ERR%3AREF-NOT-FOUND-AuditEntry.%26nbsp%3B%20The%20GraphQL%20query%20doesn%E2%80%99t%20pull%20all%20of%20the%20Objects%20that%20implement%20AuditEntry%20Interface.%26nbsp%3B%20It%20pulls%20the%20most%20relevant%20used%20for%20the%20detections%20and%20hunting%20queries%20listed%20abpve.%26nbsp%3B%20The%20returned%20data%20is%20written%20to%20the%20Azure%20Sentinel%20Workspace%20in%20%3CSTRONG%3EGitHub_CL%3C%2FSTRONG%3E%20custom%20table.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EGet-GitHubRepoLogs%20Playbook%3C%2FSTRONG%3E%20-%20runs%20every%20hour%20and%20uses%20GitHub%20-ERR%3AREF-NOT-FOUND-v3%20API%20to%20query%20each%20repo%20in%20each%20Org%20for%20Forks%2C%20Clones%2C%20Commits%2C%20Referrers%2C%20Paths%2C%20Views%2C%20and%20Collaborators%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%26nbsp%3B%20The%20returned%20data%20is%20written%20to%20the%20Azure%20Sentinel%20Workspace%20in%20%3CSTRONG%3EGitHubRepoLogs_CL%3C%2FSTRONG%3E%20custom%20table.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CP%3E%3CSTRONG%3EGet-GitHubVulnerabilityAlerts%20Playbook%3C%2FSTRONG%3E%20-%20runs%20every%20hour%20and%20uses%20GitHub%20V4%20API%20to%20query%20for%20-ERR%3AREF-NOT-FOUND-SecurityVulnerabilities.%26nbsp%3BThe%20returned%20data%20is%20written%20to%20the%20Azure%20Sentinel%20Workspace%20in%20%3CSTRONG%3EGitHubRepoLogs_CL%3C%2FSTRONG%3E%20custom%20table.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EARM%20Template%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3ETo%20deploy%20the%20ARM%20template%20containing%20all%20the%20playbooks%2C%20connections%2C%20storage%20account%20and%20key%20vault%20and%20configure%20the%20resources%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EGenerate%20a%26nbsp%3B%3CEM%3EGitHub%3C%2FEM%3E%20Personal%20Access%20Token%20-ERR%3AREF-NOT-FOUND-%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fsettings%2Ftokens%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fsettings%2Ftokens%3C%2FA%3E.%3COL%3E%0A%3CLI%3EGitHub%20user%20settings%20-%26gt%3B%20Developer%20settings%20-%26gt%3B%20Personal%20access%20tokens.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EGet%20the%20objectId%20for%20a%20user%20that%20the%20Logic%20App%20can%20use.%3COL%3E%0A%3CLI%3EAzure%20Portal%20-%26gt%3B%20Azure%20Active%20Directory%20-%26gt%3B%20Users%20-%26gt%3B%20User.%20This%20user%20will%20be%20used%20to%20grant%20access%20to%20the%20Key%20Vault%20secret.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EDeploy%20the%20ARM%20template%20and%20fill%20in%20the%20parameters%3COL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FDataConnectors%2FGitHub%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FDataConnectors%2FGitHub%3C%2FA%3E.%26nbsp%3B%20Click%20the%20%3CSTRONG%3EDeploy%20to%20Azure%3C%2FSTRONG%3E%20Button.%3C%2FLI%3E%0A%3CLI%3E%22PersonalAccessToken%22%3A%20This%20is%20the%20%3CEM%3EGitHub%3C%2FEM%3E%20PAT%20from%20Step%201.%3C%2FLI%3E%0A%3CLI%3E%22UserName%22%3A%20A%20user%20that%20will%20be%20granted%20access%20to%20the%20key%20vault%20to%20read%20the%20PAT.%3C%2FLI%3E%0A%3CLI%3E%22principalId%22%3A%20The%20user%20object%20ID%20for%20the%20username%20above%3C%2FLI%3E%0A%3CLI%3E%22workspaceId%22%3A%20The%20Azure%20Sentinel%20Workspace%20ID%3C%2FLI%3E%0A%3CLI%3E%22workSpaceKey%22%3A%20The%20Azure%20Sentinel%20Workspace%20Key%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EThere%20are%20two%20json%20files%20(%3CSTRONG%3EORGS.json%3C%2FSTRONG%3E%20and%20%3CSTRONG%3Elastrun-Audit.json%3C%2FSTRONG%3E).%3C%2FLI%3E%0A%3CLI%3EDownload%20and%20edit%20the%20%3CSTRONG%3EORGS.json%3C%2FSTRONG%3E%20file%20and%20update%20%3CSTRONG%3E%22org%22%3A%20%22sampleorg%22%3C%2FSTRONG%3E%20and%20replace%20sampleorg%20with%20your%20org%20name.%20If%20you%20have%20additional%20orgs%2C%20add%20another%20line%20%7B%22org%22%3A%20%22sampleorg%22%7D%20for%20each%20org%20you%20want%20to%20monitor.%3C%2FLI%3E%0A%3CLI%3EUpload%20the%20%3CSTRONG%3EORGS.json%3C%2FSTRONG%3E%2C%20and%20%3CSTRONG%3Elastrun-Audit.json%3C%2FSTRONG%3E%20to%20the%20storage%20account%20%3CSTRONG%3Egithublogicapp%3C%2FSTRONG%3E%20container.%3C%2FLI%3E%0A%3CLI%3EGo%20to%20the%20keyvault%20-%20%3CSTRONG%3EGitHubPlaybooks%3C%2FSTRONG%3E%20connection%20resource.%3C%2FLI%3E%0A%3CLI%3EClick%20Edit%20API%20Connection.%3C%2FLI%3E%0A%3CLI%3EClick%20Authorize.%20Sign%20in%20as%20the%20user%20which%20was%20provided%20in%20the%20parameters.%20Click%20Save.%3C%2FLI%3E%0A%3CLI%3EThe%20playbooks%20are%20deployed%20as%20disabled%20since%20the%20json%20files%20and%20connection%20has%20to%20be%20authorized.%20Go%20to%20each%20playbook%20and%20click%20Enable.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CEM%3EGitHub%3C%2FEM%3E%20data%20will%20now%20be%20ingested%26nbsp%3B%3CSTRONG%3EGitHub_CL%2C%26nbsp%3BGitHubRepoLogs_CL%20%3C%2FSTRONG%3Ein%20Sentinel%26nbsp%3B%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%226%22%3EMonitoring%26nbsp%3BGitHub%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EUser%20identity%20is%26nbsp%3Ba%26nbsp%3Bkey%20attack%26nbsp%3Bvector%26nbsp%3Bwhen%20it%20comes%20to%26nbsp%3B%3CEM%3EGitHub%3C%2FEM%3E%26nbsp%3Band%20it%26nbsp%3Bshould%20be%20protected%20and%20monitored.%20Since%20you%20can%20implement%20SSO%20using%20Azure%20Active%20Directory%26nbsp%3B(Azure%20AD)%26nbsp%3Bfor%20authentication%20you%20can%26nbsp%3Bcollect%20Azure%20AD%20data%20into%20Azure%20Sentinel%20using%20the%26nbsp%3Bbuilt%20in%26nbsp%3Bconnector%20and%26nbsp%3Buse%20our%26nbsp%3B-ERR%3AREF-NOT-FOUND-detections%26nbsp%3Band%26nbsp%3B-ERR%3AREF-NOT-FOUND-hunting%20queries%26nbsp%3Bto%20monitor%26nbsp%3Bfor%20suspicious%20identity%20events%26nbsp%3Bwith%26nbsp%3BAzure%20Sentinel.%26nbsp%3BBut%20what%20about%26nbsp%3B%3CEM%3EGitHub%3C%2FEM%3E%26nbsp%3Bspecific%20threats%3F%20There%20are%26nbsp%3Ba%20number%20of%26nbsp%3Bscenarios%20that%20an%20attacker%20could%26nbsp%3Battempt%26nbsp%3Bexploit%20in%20order%20to%20gain%20access%20to%26nbsp%3Byour%20organizations%20sensitive%20data%20with%26nbsp%3B%3CEM%3EGitHub%3C%2FEM%3E%26nbsp%3Bthat%20wouldn%E2%80%99t%20appear%26nbsp%3Bin%20Azure%20AD%20logs.%26nbsp%3BBelow%20we%20will%20look%20at%20some%20of%20these%2C%20as%20well%20as%20ideas%20of%20how%20to%20hunt%20and%20monitor%20for%20them.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EParsing%26nbsp%3Bthe%26nbsp%3BData%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EBefore%20building%20detections%20or%20hunting%20queries%20on%20the%26nbsp%3B%3CEM%3EGitHub%26nbsp%3B%3C%2FEM%3Edata%20we%20collected%20we%20can%20use%20a%26nbsp%3BKQL%26nbsp%3BFunction%20to%20parse%20and%20normalize%20the%20data%26nbsp%3Bto%20make%20it%20easier%20to%20use.%20For%20more%20background%20on%20Functions%26nbsp%3Bplease%20read%26nbsp%3B-ERR%3AREF-NOT-FOUND-this%20blog.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20case%20of%26nbsp%3B%3CEM%3EGitHub%26nbsp%3B%3C%2FEM%3Edata%20we%20have%20a%20large%20number%20of%20fields%26nbsp%3Breturned%20from%20%3CEM%3EGitHub%3C%2FEM%3E%20REST%20API%20%26amp%3B%20GraphQL%20API%2C%26nbsp%3Bso%20the%20parser%20is%20going%20to%20help%20us%20select%20a%20subset%20of%26nbsp%3Bthe%26nbsp%3Bfields%20relevant%20to%26nbsp%3Bmonitor%20%3CEM%3EGitHub%3C%2FEM%3E.%26nbsp%3BYou%20can%20find%20our%20suggested%20parsers%20on%26nbsp%3Bbut%26nbsp%3Byou%26nbsp%3Bcan%26nbsp%3Balso%26nbsp%3Bmodify%20this%20parser%26nbsp%3Bto%20fit%20your%20needs%26nbsp%3Band%20preferences.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESince%20we%20separated%20the%20data%20into%20two%20tables%20we%20created%20two%20parsers.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGitHub_CL%20Table%20Parser%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EGitHub_CL%20%20%0A%7C%20project%20TimeGenerated%3Dnode_createdAt_t%2C%0A%20%20%20Organization%3Dcolumnifexists('node_organizationName_s'%2C%20%22%22)%2C%0A%20%20%20Action%3Dnode_action_s%2C%0A%20%20%20OperationType%3Dnode_operationType_s%2C%0A%20%20%20Repository%3Dcolumnifexists('node_repositoryName_s'%2C%22%22)%2C%0A%20%20%20Actor%3Dnode_actorLogin_s%2C%0A%20%20%20IPaddress%3Dnode_actorIp_s%2C%0A%20%20%20City%3Dnode_actorLocation_city_s%2C%0A%20%20%20Country%3Dnode_actorLocation_country_s%2C%0A%20%20%20ImpactedUser%3Dcolumnifexists('node_userLogin_s'%2C%20%22%22)%2C%0A%20%20%20ImpactedUserEmail%3Dcolumnifexists('node_user_email_s'%2C%20%22%22)%2C%0A%20%20%20InvitedUserPermission%3Dnode_permission_s%2C%0A%20%20%20Visability%3Dcolumnifexists('node_visibility_s'%2C%22%22)%2C%0A%20%20%20OauthApplication%3Dcolumnifexists('node_oauthApplicationName_s'%2C%22%22)%2C%0A%20%20%20OauthApplicationUrl%3Dcolumnifexists('node_applicationUrl_s'%2C%22%22)%2C%0A%20%20%20OauthApplicationState%3Dcolumnifexists('node_state_s'%2C%22%22)%2C%0A%20%20%20UserCanInviteCollaborators%3D('node_canInviteOutsideCollaboratorsToRepositories_b'%2C%22%22)%2C%0A%20%20%20MembershipType%3Dcolumnifexists('node_membershipTypes_s'%2C%22%22)%2C%0A%20%20%20CurrentPermission%3Dcolumnifexists('node_permission_s'%2C%22%22)%2C%0A%20%20%20PreviousPermission%3Dcolumnifexists('node_permissionWas_s'%2C%22%22)%2C%0A%20%20%20TeamName%3Dcolumnifexists('node_teamName_s'%2C%22%22)%2C%0A%20%20%20Reason%3Dcolumnifexists('node_reason_s'%2C%22%22)%2C%0A%20%20%20BlockedUser%3Dcolumnifexists('node_blockedUserName_s'%2C%22%22)%2C%0A%20%20%20CanCreateRepositories%3Dcolumnifexists('canCreateRepositories_b'%2C%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGitHubRepoLogs_CL%20Table%20Parser%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EGitHubRepoLogs_CL%0A%7C%20project%20TimeGenerated%20%3D%20created_at_t%2C%0A%20%20%20%20Organization%3Dcolumnifexists('Organization_s'%2C%20%22%22)%2C%0A%20%20%20%20Repository%3Dcolumnifexists('Repository_s'%2C%22%22)%2C%0A%20%20%20%20Action%3Dcolumnifexists('LogType_s'%2C%22%22)%2C%0A%20%20%20%20Actor%3Dcoalesce(login_s%2C%20owner_login_s)%2C%0A%20%20%20%20ActorType%3Dcoalesce(owner_type_s%2C%20type_s)%2C%0A%20%20%20%20IsPrivate%3Dcolumnifexists('private_b'%2C%22%22)%2C%0A%20%20%20%20ForksUrl%3Dcolumnifexists('forks_url_s'%2C%22%22)%2C%0A%20%20%20%20PushedAt%3Dcolumnifexists('pushed_at_t'%2C%22%22)%2C%0A%20%20%20%20IsDisabled%3Dcolumnifexists('disabled_b'%2C%22%22)%2C%0A%20%20%20%20AdminPermissions%3Dcolumnifexists('permissions_admin_b'%2C%22%22)%2C%0A%20%20%20%20PushPermissions%3Dcolumnifexists('permissions_push_b'%2C%22%22)%2C%0A%20%20%20%20PullPermissions%3Dcolumnifexists('permissions_pull_b'%2C%22%22)%2C%0A%20%20%20%20ForkCount%3Dcolumnifexists('forks_count_d'%2C%22%22)%2C%0A%20%20%20%20Count%3Dcolumnifexists('count_d%2C'%2C%22%22)%2C%0A%20%20%20%20UniqueUsersCount%3Dcolumnifexists('uniques_d'%2C%22%22)%2C%0A%20%20%20%20DismmisedAt%3Dcolumnifexists('dismissedAt_t'%2C%22%22)%2C%0A%20%20%20%20Reason%3Dcolumnifexists('dismissReason_s'%2C%22%22)%2C%0A%20%20%20%20vulnerableManifestFilename%20%3D%20columnifexists('vulnerableManifestFilename_s'%2C%22%22)%2C%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%26nbsp%3Bthe%20queries%20we%26nbsp%3Bwill%26nbsp%3Blook%20at%26nbsp%3Bin%20the%20following%26nbsp%3Bsections%2C%20we%26nbsp%3Bare%26nbsp%3Bgoing%20to%20save%20those%20parsers%20with%20an%20alias%20of%26nbsp%3B%3CEM%3E%3CSTRONG%3EGitHubAudit%3C%2FSTRONG%3E.%20%26amp%3B%20%3CSTRONG%3EGitHubRepo%3C%2FSTRONG%3E%3C%2FEM%3E.%26nbsp%3BDetails%20on%20configuring%20and%20using%20a%20Function%20as%20a%20parser%20can%20be%20found%20in%26nbsp%3B-ERR%3AREF-NOT-FOUND-this%20blog.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%226%22%3EDetection%20%26amp%3B%20Hunting%20Queries%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThe%20following%20queries%20are%20designed%20to%20help%20you%20find%20suspicious%20activity%20in%20your%26nbsp%3BGitHub%26nbsp%3Borganization%2C%20and%20whilst%20many%20are%20likely%20to%20return%20legitimate%20activity%20as%20well%20as%20potentially%20malicious%20activity%2C%20they%20can%20be%20useful%20in%20guiding%20your%20hunting.%20If%26nbsp%3Bafter%20running%20these%20queries%20you%20are%20confident%20with%20the%20results%20you%20could%20consider%20turning%20some%20or%20all%20of%20them%20into%20Azure%20Sentinel%20Analytics%20to%20alert%20on.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EBrute%20Force%20Attack%20against%20GitHub%20Account%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3ECredential%3C%2FSTRONG%3E%20%3CSTRONG%3EAccess%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1110%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EAttackers%20who%20are%20trying%20to%20guess%20your%20users'%20passwords%20or%20use%20brute-force%20methods%20to%20get%20in.%20If%20your%20organization%20is%20using%20SSO%20with%20Azure%20Active%20Directory%2C%20authentication%20logs%20to%20GitHub.com%20will%20be%20generated.%20Using%20the%20following%20query%20can%20help%20you%20identify%20a%20sudden%20increase%20in%20failed%20logon%20attempt%20of%20users.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%20%20let%20LearningPeriod%20%3D%207d%3B%20%0A%20%20let%20BinTime%20%3D%201h%3B%20%0A%20%20let%20RunTime%20%3D%201h%3B%20%0A%20%20let%20StartTime%20%3D%201h%3B%20%0A%20%20let%20NumberOfStds%20%3D%203%3B%20%0A%20%20let%20MinThreshold%20%3D%2010.0%3B%20%0A%20%20let%20EndRunTime%20%3D%20StartTime%20-%20RunTime%3B%20%0A%20%20let%20EndLearningTime%20%3D%20StartTime%20%2B%20LearningPeriod%3B%20%0A%20%20let%20GitHubFailedSSOLogins%20%3D%20(SigninLogs%20%0A%20%20%7C%20where%20AppDisplayName%20%3D%3D%20%22GitHub.com%22%20%0A%20%20%7C%20where%20ResultType%20%3D%3D%2050056)%3B%20%0A%20%20GitHubFailedSSOLogins%20%0A%20%20%7C%20where%20TimeGenerated%20between%20(ago(EndLearningTime)%20..%20ago(StartTime))%20%0A%20%20%7C%20summarize%20FailedLoginsCountInBinTime%20%3D%20count()%20by%20User%20%3D%20Identity%2C%20bin(TimeGenerated%2C%20BinTime)%20%0A%20%20%7C%20summarize%20AvgOfFailedLoginsInLearning%20%3D%20avg(FailedLoginsCountInBinTime)%2C%20StdOfFailedLoginsInLearning%20%3D%20stdev(FailedLoginsCountInBinTime)%20by%20User%20%0A%20%20%7C%20extend%20LearningThreshold%20%3D%20max_of(AvgOfFailedLoginsInLearning%20%2B%20StdOfFailedLoginsInLearning%20*%20NumberOfStds%2C%20MinThreshold)%20%0A%20%20%7C%20join%20kind%3Dinnerunique%20(%20%0A%20%20%20%20GitHubFailedSSOLogins%20%0A%20%20%20%20%7C%20where%20TimeGenerated%20between%20(ago(StartTime)%20..%20ago(EndRunTime))%20%0A%20%20%20%20%7C%20summarize%20FailedLoginsCountInRunTime%20%3D%20count()%20by%20User%20%3D%20Identity%20%0A%20%20)%20on%20User%20%0A%20%20%7C%20where%20FailedLoginsCountInRunTime%20%26gt%3B%20LearningThreshold%0A%20%20%7C%20extend%20AccountCustomEntity%20%3D%20UserPrincipalName%2C%20IPCustomEntity%20%3D%20IPAddress%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EGitHub%20Activities%20from%20Infrequent%20Country%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%20Tactic%20%3CSTRONG%3EInitial%20Access%3C%2FSTRONG%3E%26nbsp%3Btechnique%3C%2FEM%3E%20%3CEM%3E%3CSTRONG%3ET1078%3C%2FSTRONG%3E%3C%2FEM%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20query%20Detect%20activities%20from%20a%20location%20that%20was%20never%2Fnot%20recently%20connected%20by%20any%20user%20in%20your%20organization.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%2F%2F%20If%20you%20want%20to%20look%20at%20user%20added%20further%20than%207%20days%20ago%20adjust%20this%20value%20%0Alet%20LearningPeriod%20%3D%207d%3B%0A%20%20let%20RunTime%20%3D%201h%3B%0A%20%20let%20StartTime%20%3D%201h%3B%0A%20%20let%20EndRunTime%20%3D%20StartTime%20-%20RunTime%3B%0A%20%20let%20EndLearningTime%20%3D%20StartTime%20%2B%20LearningPeriod%3B%0A%20%20let%20GitHubCountryCodeLogs%20%3D%20(GitHubAudit%0A%20%20%7C%20where%20Country%20!%3D%20%22%22)%3B%0A%20%20%20%20GitHubCountryCodeLogs%0A%20%20%7C%20where%20TimeGenerated%20between%20(ago(EndLearningTime)%20..%20ago(StartTime))%0A%20%20%7C%20summarize%20makeset(Country)%20by%20Actor%0A%20%20%7C%20join%20kind%3Dinnerunique%20(%0A%20%20%20%20GitHubCountryCodeLogs%0A%20%20%20%20%7C%20where%20TimeGenerated%20between%20(ago(StartTime)%20..%20ago(EndRunTime))%0A%20%20%20%20%7C%20distinct%20Country%2C%20Actor%20%0A%20%20)%20on%20Actor%20%0A%20%20%7C%20where%20set_Country%20!contains%20Country%0A%20%20%7C%20extend%20AccountCustomEntity%20%3D%20Actor%2C%20IPCustomEntity%20%3D%20IPaddressactorLocation_countryCode_s%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3ESign-in%20Burst%20from%20Multiple%20Locations%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3ECredential%20Access%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1110%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20query%20over%20Azure%20Active%20Directory%20sign-in%20activity%20to%20GitHub.com%20highlights%20accounts%20associated%20with%20multiple%20authentications%20from%20different%20geographical%20locations%20in%20a%20short%20space%20of%20time.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20RunTime%20%3D%201h%3B%0ASigninLogs%0A%7C%20where%20TimeGenerated%20%26gt%3B%20ago(RunTime)%0A%7C%20where%20AppDisplayName%20%3D%3D%20%22GitHub.com%22%0A%7C%20where%20ResultType%20%3D%3D%200%0A%7C%20summarize%20CountOfLocations%20%3D%20dcount(Location)%2C%20Locations%20%3D%20make_set(Location)%20by%20User%20%3D%20Identity%0A%7C%20where%20CountOfLocations%20%26gt%3B%201%20%0A%20%20%7C%20extend%20AccountCustomEntity%20%3D%20UserPrincipalName%2C%20IPCustomEntity%20%3D%20IPAddress%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EThreat%20Intel%20Matches%20to%20GitHub%20Audit%20Logs%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%3C%2FEM%3E%26nbsp%3BMitigation%20%3CSTRONG%3EThreat%20Intelligence%20Program%26nbsp%3B%3C%2FSTRONG%3E%3CEM%3Etechnique%26nbsp%3B%3C%2FEM%3E%3CSTRONG%3ET1212%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAzure%20Sentinel%20integrates%20with%20Microsoft%20Graph%20Security%20API%20data%20sources%20for%20ingesting%20threat%20intelligence%20indicators.We%20identifies%20a%20match%20in%20GitHub%20Audit%20Logs%20data%20from%20any%20IP%20address%20IOC%20from%20TI.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EThreatIntelligenceIndicator%0A%20%20%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(24h)%0A%20%20%7C%20where%20Action%20%3D%3D%20true%0A%20%20%2F%2F%20Picking%20up%20only%20IOC's%20that%20contain%20the%20entities%20we%20want%0A%20%20%7C%20where%20isnotempty(NetworkIP)%20or%20isnotempty(EmailSourceIpAddress)%20or%20isnotempty(NetworkDestinationIP)%20or%20isnotempty(NetworkSourceIP)%0A%20%20%2F%2F%20Taking%20the%20first%20non-empty%20value%20based%20on%20potential%20IOC%20match%20availability%0A%20%20%7C%20extend%20TI_ipEntity%20%3D%20iff(isnotempty(NetworkIP)%2C%20NetworkIP%2C%20NetworkDestinationIP)%0A%20%20%7C%20extend%20TI_ipEntity%20%3D%20iff(isempty(TI_ipEntity)%20and%20isnotempty(NetworkSourceIP)%2C%20NetworkSourceIP%2C%20TI_ipEntity)%0A%20%20%7C%20extend%20TI_ipEntity%20%3D%20iff(isempty(TI_ipEntity)%20and%20isnotempty(EmailSourceIpAddress)%2C%20EmailSourceIpAddress%2C%20TI_ipEntity)%0A%20%20%7C%20join%20(%0A%20%20%20%20GitHubAudit%0A%20%20%20%20%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(24h)%0A%20%20%20%20%7C%20extned%20GitHubAudit_TimeGenerated%20%3D%20TimeGenerated%0A%20%20)%0A%20%20on%20on%20%24left.TI_ipEntity%20%3D%3D%20%24right.IPaddress%0A%20%20%7C%20summarize%20LatestIndicatorTime%20%3D%20arg_max(TimeGenerated%2C%20*)%20by%20IndicatorId%0A%20%20%7C%20project%20LatestIndicatorTime%2C%20Description%2C%20ActivityGroupNames%2C%20IndicatorId%2C%20ThreatType%2C%20Url%2C%20ExpirationDateTime%2C%20ConfidenceScore%2C%20GitHubAudit_TimeGenerated%2C%20TI_ipEntity%2C%20IPaddress%2C%20Actor%2C%20Action%2C%20Country%2C%20OperationType%2C%20NetworkIP%2C%20NetworkDestinationIP%2C%20NetworkSourceIP%2C%20EmailSourceIpAddress%0A%20%20%7C%20extend%20timestamp%20%3D%20GitHubAudit_TimeGenerated%2C%20IPCustomEntity%20%3D%20IPaddress%2C%20AccountCustomEntity%20%3D%20Actor%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3ETwo%20Factor%20Authentication%20Disabled%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EDefense%20Evasion%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1089%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3ETwo-factor%20authentication%20is%20a%20process%20where%20a%20user%20is%20prompted%20during%20the%20sign-in%20process%20for%20an%20additional%20form%20of%20identification%2C%20such%20as%20to%20enter%20a%20code%20on%20their%20cellphone%20or%20to%20provide%20a%20fingerprint%20scan.%20Two%20factor%20authentication%20reduces%20the%20risk%20of%20account%20takeover.%20Attacker%20will%20want%20to%20disable%20such%20security%20tools%20in%20order%20to%20go%20undetected.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20timeframe%20%3D%2014d%3B%0AGitHubAudit%0A%20%20%7C%20where%20TimeGenerated%20%26gt%3B%20ago(timeframe)%0A%20%20%7C%20where%20Action%20%3D%3D%20%22org.disable_two_factor_requirement%22%0A%20%20%7C%20project%20TimeGenerated%2C%20Action%2C%20Actor%2C%20Country%2C%20IPaddress%2C%20Repository%0A%20%20%7C%20extend%20AccountCustomEntity%20%3D%20Actor%2C%20IPCustomEntity%20%3D%20IPaddress%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3ESecurity%20Vulnerability%20in%20Repo%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EExecution%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1203%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20alerts%20when%20a%20new%20security%20vulnerability%20is%20discovered%20in%20a%20GitHub%20repository.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20timeframe%20%3D%2014d%3B%0Alet%20timeframe%20%3D%2014d%3B%0A%20%20GitHubRepo%0A%20%20%7C%20where%20TimeGenerated%20%26gt%3B%20ago(timeframe)%0A%20%20%7C%20where%20Action%20%3D%3D%20%22vulnerabilityAlert%22%0A%20%20%7C%20project%20TimeGenerated%2C%20DismmisedAt%2C%20Reason%2C%20vulnerableManifestFilename%2C%20Description%2C%20Link%2C%20PublishedAt%2C%20Severity%2C%20Summary%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EInactive%20or%20New%20Account%20Usage%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%20tactic%3C%2FEM%3E%20%3CEM%3E%3CSTRONG%3EPersistence%26nbsp%3B%3C%2FSTRONG%3Etechnique%20%3CSTRONG%3ET1136%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20query%20identifies%20Accounts%20that%20are%20new%20or%20inactive%20and%20have%20accessed%20or%20used%20GitHub%20that%20may%20be%20a%20sign%20of%20compromise.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%2F%2F%20If%20you%20want%20to%20look%20at%20user%20added%20further%20than%207%20days%20ago%20adjust%20this%20value%20%0Alet%20LearningPeriod%20%3D%207d%3B%0Alet%20RunTime%20%3D%201h%3B%0Alet%20StartTime%20%3D%201h%3B%0Alet%20EndRunTime%20%3D%20StartTime%20-%20RunTime%3B%0Alet%20EndLearningTime%20%3D%20StartTime%20%2B%20LearningPeriod%3B%0Alet%20GitHubActorLogin%20%3D%20(GitHub_CL%0A%7C%20where%20actorLogin_s%20!%3D%20%22%22)%3B%0Alet%20GitHubUser%20%3D%20(GitHub_CL%0A%7C%20where%20userLogin_s%20!%3D%20%22%22)%3B%0Alet%20GitHubNewActorLogin%20%3D%20(%20%20GitHubActorLogin%0A%7C%20where%20TimeGenerated%20between%20(ago(EndLearningTime)%20..%20ago(StartTime))%0A%7C%20summarize%20makeset(actorLogin_s)%0A%7C%20extend%20Dummy%20%3D%201%0A%7C%20join%20kind%3Dinnerunique%0A(%0A%20%20%20%20GitHubActorLogin%0A%20%20%20%20%7C%20where%20TimeGenerated%20between%20(ago(StartTime)%20..%20ago(EndRunTime))%0A%20%20%20%20%7C%20distinct%20actorLogin_s%0A%20%20%20%20%7C%20extend%20Dummy%20%3D%201%0A)%0Aon%20Dummy%0A%7C%20project-away%20Dummy%0A%7C%20where%20set_actorLogin_s%20%20!contains%20actorLogin_s)%3B%0Alet%20GitHubNewUser%20%3D%20(%20%20GitHubUser%0A%7C%20where%20TimeGenerated%20between%20(ago(EndLearningTime)%20..%20ago(StartTime))%0A%7C%20summarize%20makeset(userLogin_s)%0A%7C%20extend%20Dummy%20%3D%201%0A%7C%20join%20kind%3Dinnerunique%0A(%0A%20%20%20%20GitHubUser%0A%20%20%20%20%7C%20where%20TimeGenerated%20between%20(ago(StartTime)%20..%20ago(EndRunTime))%0A%20%20%20%20%7C%20distinct%20userLogin_s%0A%20%20%20%20%7C%20extend%20Dummy%20%3D%201%0A)%0Aon%20Dummy%0A%7C%20project-away%20Dummy%0A%7C%20where%20set_userLogin_s%20%20%20!contains%20userLogin_s)%3B%0Aunion%20GitHubNewActorLogin%2C%20GitHubNewUser%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EUnusual%20Number%20of%20Repository%20Clones%3C%2FSTRONG%3E%20%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3ECollection%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1213%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EAttacker%20can%20exfiltrate%20data%20from%20you%20GitHub%20repository%20after%20gaining%20access%20to%20it%20by%20performing%20clone%20action.%20This%20hunting%20queries%20allows%20you%20to%20track%20the%20clones%20activities%20for%20each%20of%20your%20repositories.%20The%20visualization%20allow%20you%20to%20quickly%20identify%20anomalies%2Fexcessive%20clone%2C%20to%20further%20investigate%20repo%20access%20%26amp%3B%20permissions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20min_t%20%3D%20toscalar(GitHubRepo%0A%7C%20summarize%20min(timestamp_t))%3B%0Alet%20max_t%20%3D%20toscalar(GitHubRepo%0A%7C%20summarize%20max(timestamp_t))%3B%0AGitHubRepo%0A%7C%20where%20Action%20%3D%3D%20%22Clones%22%0A%7C%20distinct%20TimeGenerated%2C%20Repository%2C%20Count%0A%7C%20make-series%20num%3Dsum(Count)%20default%3D0%20on%20TimeGenerated%20in%20range(min_t%2C%20max_t%2C%201h)%20by%20Repository%20%0A%7C%20extend%20(anomalies%2C%20score%2C%20baseline)%20%3D%20series_decompose_anomalies(num%2C%201.5%2C%20-1%2C%20'linefit')%0A%7C%20render%20timechart%20t%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EUser%20Grant%20Access%20and%20Grants%20Other%20Access%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EPersistence%2C%20Privilege%20Escalation%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1098%2C%20T1078%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EIdentifies%20when%20a%20new%20user%20is%20granted%20access%20and%20starts%20granting%20access%20to%20other%20users.%26nbsp%3B%20This%20can%20help%20you%20identify%20rogue%20or%20malicious%20user%20behavior.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EGitHubAudit%0A%7C%20where%20Action%20%3D%3D%20%22org.invite_member%22%20or%20Action%20%3D%3D%20%22org.add_member%22%20or%20Action%20%3D%3D%20%22team.add_member%22%20or%20Action%20%3D%3D%20%22repo.add_member%22%0A%7C%20distinct%20ImpactedUser%2C%20TimeGenerated%2C%20Actor%0A%7C%20project-rename%20firstUserAdded%20%3D%20ImpactedUser%2C%20firstEventTime%20%3D%20TimeGenerated%2C%20firstAdderUser%20%3D%20Actor%0A%7C%20join%20kind%3D%20innerunique%20(%0AGitHubAudit%0A%7C%20where%20ImpactedUser%20!%3D%20%22%22%0A%7C%20where%20Action%20%3D%3D%20%22org.invite_member%22%20or%20Action%20%3D%3D%20%22org.add_member%22%20or%20Action%20%3D%3D%20%22team.add_member%22%20or%20Action%20%3D%3D%20%22repo.add_member%22%0A%7C%20distinct%20ImpactedUser%2C%20TimeGenerated%2C%20Actor%0A%7C%20project-rename%20secondUserAdded%20%3D%20ImpactedUser%2C%20secondEventTime%20%3D%20TimeGenerated%2C%20secondAdderUser%20%3D%20Actor%0A)%20on%20%24right.secondAdderUser%20%3D%3D%20%24left.firstUserAdded%0A%7C%20where%20secondEventTime%20between%20(firstEventTime%20..%20(firstEventTime%20%2B%201h))%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EOauth%20App%20Restrictions%20Disabled%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EDefense%20Evasion%2C%20Persistence%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1089%2C%20T1100%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20query%20identifies%20GitHub%20OAuth%20Apps%20that%20have%20restrictions%20disabled%20that%20may%20be%20a%20sign%20of%20compromise.%20Attacker%20will%20want%20to%20disable%20such%20security%20tools%20in%20order%20to%20go%20undetected.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20timeframe%20%3D%2014d%3B%0A%20%20GitHubAudit%0A%20%20%7C%20where%20TimeGenerated%20%26gt%3B%20ago(timeframe)%0A%20%20%7C%20where%20Action%20%3D%3D%20%22org.disable_oauth_app_restrictions%22%0A%20%20%7C%20project%20TimeGenerated%2C%20Action%2C%20Actor%2C%20Location%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EMass%20Deletion%20of%20Repositories%3C%2FSTRONG%3E%20%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EImpact%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1485%3C%2FSTRONG%3E%20%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20queries%20identify%20an%20unusual%20increase%20of%20repo%20deletion%20activities%3C%2FP%3E%0A%3CP%3Eadversaries%20may%20want%20to%20disrupt%20availability%20or%20compromise%20integrity%20by%20deleting%20business%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20LearningPeriod%20%3D%207d%3B%0A%20%20let%20BinTime%20%3D%201h%3B%0A%20%20let%20RunTime%20%3D%201h%3B%0A%20%20let%20StartTime%20%3D%201h%3B%0A%20%20let%20NumberOfStds%20%3D%203%3B%0A%20%20let%20MinThreshold%20%3D%2010.0%3B%0A%20%20let%20EndRunTime%20%3D%20StartTime%20-%20RunTime%3B%0A%20%20let%20EndLearningTime%20%3D%20StartTime%20%2B%20LearningPeriod%3B%0A%20%20let%20GitHubRepositoryDestroyEvents%20%3D%20(GitHubAudit%0A%20%20%7C%20where%20Action%20%3D%3D%20%22repo.destroy%22)%3B%0A%20%20GitHubRepositoryDestroyEvents%0A%20%20%7C%20where%20TimeGenerated%20between%20(ago(EndLearningTime)%20..%20ago(StartTime))%0A%20%20%7C%20summarize%20count()%20by%20bin(TimeGenerated%2C%20BinTime)%0A%20%20%7C%20summarize%20AvgInLearning%20%3D%20avg(count_)%2C%20StdInLearning%20%3D%20stdev(count_)%0A%20%20%7C%20extend%20LearningThreshold%20%3D%20max_of(AvgInLearning%20%2B%20StdInLearning%20*%20NumberOfStds%2C%20MinThreshold)%0A%20%20%7C%20extend%20Dummy%20%3D%201%0A%20%20%7C%20join%20kind%3Dinnerunique%20(%0A%20%20%20%20GitHubRepositoryDestroyEvents%0A%20%20%20%20%7C%20where%20TimeGenerated%20between%20(ago(StartTime)%20..%20ago(EndRunTime))%0A%20%20%20%20%7C%20summarize%20CountInRunTime%20%3D%20count()%20by%20bin(TimeGenerated%2C%20BinTime)%0A%20%20%20%20%7C%20extend%20Dummy%20%3D%201%0A%20%20)%20on%20Dummy%0A%20%20%7C%20project-away%20Dummy%0A%20%20%7C%20where%20CountInRunTime%20%26gt%3B%20LearningThreshold%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EOrg%20Repositories%20Default%20Permissions%20Change%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EDefense%20Evasion%2C%20Persistence%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1089%2C%20T1098%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20query%20identifies%20a%20global%20change%20to%20the%20organization%20permission%20policy%20for%20repositories.%20The%20default%20is%20read%2C%20attacker%20may%20change%20this%20permission%20in%20order%20to%20gain%20persistence%20or%20evade%20detection.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EGitHubAudit%0A%7C%20where%20Action%20%3D%3D%20%22org.update_default_repository_permission%22%0A%7C%20project%20TimeGenerated%2C%20Action%2C%20Actor%2C%20Country%2C%20Repository%2C%20PreviousPermission%2C%20CurrentPermission%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ERepository%20Permission%20Switched%20to%20Public%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3ECollection%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1213%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20query%20identifies%20a%20change%20to%20the%20visibility%20state%20of%20a%20repository.%20This%20will%20help%20identify%20issues%20of%20data%20breaches.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20timeframe%20%3D%2014d%3B%0AGitHubAudit%0A%7C%20where%20TimeGenerated%20%26gt%3B%20ago(timeframe)%0A%7C%20where%20Action%20%3D%3D%20%22repo.access%22%0A%7C%20where%20OperationType%20%3D%3D%20%22MODIFY%22%0A%7C%20where%20node_visibility_s%20%3D%3D%20%22PUBLIC%22%20%0A%7C%20project%20TimeGenerated%2C%20Action%2C%20Actor%2C%20Country%2C%20Repository%2C%20Visabilitys%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESuspicious%20Fork%20Activity%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EExfiltration%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1537%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20query%20identifies%20a%20fork%20activity%20against%20a%20repository%20done%20by%20a%20user%20who%20is%20%3CSTRONG%3Enot%3C%2FSTRONG%3E%20the%20owner%20of%20the%20repo%20nor%20a%20contributor.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20RunTime%20%3D%201h%3B%20%0Alet%20CollaboratorsUserToRepoMapping%20%3D%20(%0AGitHubRepo%0A%7C%20where%20TimeGenerated%20%26lt%3B%20ago(RunTime)%0A%7C%20where%20Action%20%3D%3D%20%22Collaborators%22%0A%7C%20distinct%20Repository%20%2C%20Actor%2C%20Organization)%3B%0Alet%20UserCommitsInRepoMapping%20%3D%20(%0AGitHubRepo%0A%7C%20where%20Action%20%3D%3D%20%22Commits%22%0A%7C%20where%20TimeGenerated%20%26lt%3B%20ago(RunTime)%0A%7C%20distinct%20%20Repository%20%2CActor%2C%20Organization)%3B%0Aunion%20CollaboratorsUserToRepoMapping%2C%20UserCommitsInRepoMapping%0A%7C%20summarize%20ContributedToRepos%20%3D%20make_set(Repository)%20by%20Actor%2C%20Organization%0A%7C%20join%20kind%3Dinnerunique%20(%0AGitHubRepo%0A%7C%20where%20TimeGenerated%20%26gt%3B%20ago(RunTime)%0A%7C%20where%20Action%20%3D%3D%20%22Forks%22%0A%7C%20distinct%20Repository%20%2C%20Actor%2C%20Organization%0A)%20on%20Actor%2C%20Organization%0A%7C%20project-away%20Actor1%2C%20Organization1%0A%7C%20where%20ContributedToRepos%20!contains%20Repository%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EUser%20First%20Time%20Repository%20Delete%20Activity%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EImpact%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1485%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20query%20identifies%20a%20change%20to%20the%20visibility%20state%20of%20a%20repository.%20This%20will%20help%20identify%20issues%20of%20data%20breaches.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20LearningPeriod%20%3D%207d%3B%0Alet%20RunTime%20%3D%201h%3B%0Alet%20StartTime%20%3D%201h%3B%0Alet%20EndRunTime%20%3D%20StartTime%20-%20RunTime%3B%0Alet%20EndLearningTime%20%3D%20StartTime%20%2B%20LearningPeriod%3B%0Alet%20GitHubRepositoryDestroyEvents%20%3D%20(GitHubAudit%0A%7C%20where%20Action%20%3D%3D%20%22repo.destroy%22)%3B%0AGitHubRepositoryDestroyEvents%0A%7C%20where%20TimeGenerated%20between%20(ago(EndLearningTime)%20..%20ago(StartTime))%0A%7C%20distinct%20Actor%0A%7C%20join%20kind%3Drightanti%20(%0A%20%20GitHubRepositoryDestroyEvents%0A%20%20%7C%20where%20TimeGenerated%20between%20(ago(StartTime)%20..%20ago(EndRunTime))%0A%20%20%7C%20distinct%20Actor%0A)%20on%20Actor%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EFirst%20Time%20User%20Invite%20and%20Add%20Member%20to%20Org%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EMitre%26nbsp%3BATT%26amp%3BCK%26nbsp%3BTactic%20%3CSTRONG%3EPersistence%3C%2FSTRONG%3E%20technique%20%3CSTRONG%3ET1136%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EThis%20hunting%20query%20identifies%20a%20user%20that%20add%2Finvite%20a%20member%20to%20the%20organization%20for%20the%20first%20time.%20This%20technique%20can%20be%20leveraged%20by%20attackers%20to%20add%20stealth%20account%20access%20to%20the%20organization.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20LearningPeriod%20%3D%207d%3B%0A%20%20let%20RunTime%20%3D%201h%3B%0A%20%20let%20StartTime%20%3D%201h%3B%0A%20%20let%20EndRunTime%20%3D%20StartTime%20-%20RunTime%3B%0A%20%20let%20EndLearningTime%20%3D%20StartTime%20%2B%20LearningPeriod%3B%0A%20%20let%20GitHubOrgMemberLogs%20%3D%20(GitHubAudit%0A%20%20%20where%20Action%20%3D%3D%20%22org.invite_member%22%20or%20Action%20%3D%3D%20%22org.update_member%22%20or%20Action%20%3D%3D%20%22org.add_member%20Action%20%3D%3D%20%22repo.add_member%22%20Action%20%3D%3D%20%22team.add_member%22)%3B%0A%20%20GitHubOrgMemberLogs%0A%20%20%7C%20where%20TimeGenerated%20between%20(ago(EndLearningTime)%20..%20ago(StartTime))%0A%20%20%7C%20distinct%20Actor%0A%20%20%7C%20join%20kind%3Drightanti%20(%0A%20%20%20%20GitHubOrgMemberLogs%0A%20%20%20%20%7C%20where%20TimeGenerated%20between%20(ago(StartTime)%20..%20ago(EndRunTime))%0A%20%20%20%20%7C%20distinct%20Actor%0A%20%20)%20on%20Actor%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%26nbsp%3B%3CEM%3EGitHub%3C%2FEM%3E%26nbsp%3Bhunting%26nbsp%3Bqueries%26nbsp%3Bdetailed%20in%20this%20blog%26nbsp%3Bhave%20been%20shared%20on%26nbsp%3Bthe%20Azure%20Sentinel%26nbsp%3B-ERR%3AREF-NOT-FOUND-GitHub%26nbsp%3Balong%20with%20the%26nbsp%3B-ERR%3AREF-NOT-FOUND-parser%2C%26nbsp%3B-ERR%3AREF-NOT-FOUND-ARM%20template%20and%20a%20-ERR%3AREF-NOT-FOUND-workbook.%20We%20will%20be%26nbsp%3Bcontinuing%20to%20develop%20detections%20and%20hunting%20queries%20for%26nbsp%3B%3CEM%3EGitHub%26nbsp%3B%3C%2FEM%3Edata%26nbsp%3Bover%20time%26nbsp%3Bso%20make%20sure%20you%20keep%20an%20eye%20on%20GitHub%20-ERR%3AREF-NOT-FOUND-%26nbsp%3B%20As%20always%20if%20you%26nbsp%3Bhave%26nbsp%3Byour%20own%20ideas%20for%20queries%26nbsp%3Bor%20detections%20please%20feel%20free%20to%20contribute%20to%20the%26nbsp%3B-ERR%3AREF-NOT-FOUND-Azure%20Sentinel%20community.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1457721%22%20slang%3D%22en-US%22%3E%3CP%3ELearn%20how%20to%20get%20visibility%20to%20your%20GitHub%20environments%20and%20hunt%20for%20suspicious%20activities%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1457721%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Egithub%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInvestigation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1541386%22%20slang%3D%22en-US%22%3ERe%3A%20Protecting%20your%20GitHub%20assets%20with%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1541386%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22fxs-notificationmenu-notification-title%22%3E%3CDIV%20class%3D%22fxs-notificationmenu-notification-title-text%20msportalfx-tooltip-overflow%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F98230%22%20target%3D%22_blank%22%3E%40Itay%20Argoety%3C%2FA%3EThanks%20for%20sharing%20detailed%20article%20for%20GitHub%20integration.%3C%2FDIV%3E%3CDIV%20class%3D%22fxs-notificationmenu-notification-title-text%20msportalfx-tooltip-overflow%22%3EI%20tried%20exactly%20all%20commands%20but%20getting%20below%20error%20in%20keyvault%20playbook%2C%20can%20you%20please%20suggest%20how%20to%20correct%20it%3A%3CBR%20%2F%3E%3CBR%20%2F%3EError%3A%20Failed%20to%20edit%20API%20connection.%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22fxs-notificationmenu-notification-description%20fxs-portal-title%20msportalfx-tooltip-overflow%20%22%3EFailed%20to%20edit%20API%20connection%20'keyvault-GitHubPlaybooks'.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1555582%22%20slang%3D%22en-US%22%3ERe%3A%20Protecting%20your%20GitHub%20assets%20with%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1555582%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EAlso%20getting%20the%26nbsp%3B%20same%20error%20reported%20by%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F737949%22%20target%3D%22_blank%22%3E%40MIILLAANN%3C%2FA%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EError%3A%20Failed%20to%20edit%20API%20connection.%3C%2FP%3E%3CDIV%20class%3D%22lia-quilt-column%20lia-quilt-column-24%20lia-quilt-column-single%20lia-quilt-column-main%22%3E%3CDIV%20class%3D%22lia-quilt-column-alley%20lia-quilt-column-alley-single%22%3E%3CDIV%20class%3D%22lia-message-body-wrapper%20lia-component-message-view-widget-body%22%3E%3CDIV%20class%3D%22lia-message-body%22%3E%3CDIV%20class%3D%22lia-message-body-content%22%3E%3CDIV%20class%3D%22fxs-notificationmenu-notification-description%20fxs-portal-title%20msportalfx-tooltip-overflow%20%22%3EFailed%20to%20edit%20API%20connection%20'keyvault-GitHubPlaybooks'.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22abhi_Ram_0-1596109880318.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F208994i44DF2EECBBCD1630%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22abhi_Ram_0-1596109880318.png%22%20alt%3D%22abhi_Ram_0-1596109880318.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1563067%22%20slang%3D%22en-US%22%3ERe%3A%20Protecting%20your%20GitHub%20assets%20with%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1563067%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F737949%22%20target%3D%22_blank%22%3E%40MIILLAANN%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F744682%22%20target%3D%22_blank%22%3E%40abhi_Ram%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20one%20of%20you%20open%20a%20github%20issue%20here%3F%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fazure%2Fazure-sentinel%2Fissues%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fazure%2Fazure-sentinel%2Fissues.%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20share%20screenshots%20there%20and%20i%20can%20help%20look%20into%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Special thanks to @Nicholas DiCola (SECURITY JEDI) and Mor Rubin that collaborated with me on this blog post.

 

GitHub online platform enables developers to find, share, build, and collaborate on software. Many organizations are using GitHub as their software development version control mechanism and source code management. The site hosts public and private folders, or repositories, through which remote developers can upload source code and share it with collaborators.

With the increase usage of GitHub, there was an increase in the numbers of attacks against it. Example attacks campaigns usually starts with phishing email to users, which leads to compromised user account accessing the organization's GitHub repositories - cloning private repositories and exposing sensitive data.

 

There are multiple features to help you secure your GitHub organization, but in this blog we will introduce a solution which uses Logic Apps to pull GitHub audit logs & ingest them into Sentinel. Helping SecOps gain visibility to their organization's GitHub repositories, which is often lacking, and provide SOC team hunting queries & detection which spans across Mitre ATT&CK framework to protect their GitHub data, organization and users.

 

Spoiler
The following tables contains the various hunting & detection queries on top of GitHub data

Scenario

Type

Mitre Tactic

Mitre Techniques

Brute Force Attack against GitHub Account

Detection

Credential Access

T1110 - Brute Force

GitHub Activities from Infrequent Country

Detection

Initial Access

T1078 - Valid Accounts

Sign-in Burst from Multiple Locations

Detection

Credential Access

T1110 - Brute Force

Threat Intel Matches to GitHub Audit Logs

Detection

Mitigation

T1212 - Exploitation for Credential Access

Two Factor Authentication Disabled

Detection

Defense Evasion

T1089 - Disable Security tools

Security Vulnerability in Repo

Detection

Execution

T1203 - Exploitation for Client Execution

Inactive or New Account Usage

Hunting

Persistence

T1136 - Create Account

Unusual Number of Repository Clones

Hunting

Collection

T1213 - Data from Information Repositories

User Grant Access and Grants Other Access

Hunting

Persistence

Privilege Escalation

T1098 - Account Manipulation

T1078 - Valid Accounts

Oath App Restrictions Disabled

Hunting

Persistence

Defense Evasion

T1100 - Web Shell

T1089 - Disabling Security Tools

Mass Deletion of Repositories

Hunting

Impact

T1485 - Data Destruction

Org Repositories Default Permission Change

Hunting

Defense Evasion Persistence

T1098 - Account Manipulation

T1089 - Disabling Security Tools

 

Repositories Permissions Switched to Public

Hunting

Collection

T1213 - Data from Information Repositories

Suspicious Fork Activity

Hunting

Exfiltration

T1537- Transfer Data to Cloud Account

User First Time Repository Delete Activity

Hunting

Impact

T1485 - Data Destruction

First Time User Add and Invite Member to Org

Hunting

Persistence

T1136 - Create Account

Collecting GitHub Data 

This section explains how to use the ARM template to deploy the Logic Apps playbooks, Key Vault and Storage Account to ingest GitHub logs into Azure Sentinel.  This is done by using three Logic Apps Playbooks.

 

architecture.png

 

All three playbooks use Key Vault to read a secret which is needed for API authentication.  They also use a storage account which holds two file types:

  • ORGS.json - contains is a list of GitHub Orgs you want the playbooks to query. 
  • lastrun-*.json - stores the last run time and a cursor string.  This string is used to calculate the last record that was received and only query newer records since then.

Playbooks

Get-GitHubAuditEntry Playbook -  runs every 5 minutes and uses GitHub v4 API (GraphQL) to query for a set of AuditEntry.  The GraphQL query doesn’t pull all of the Objects that implement AuditEntry Interface.  It pulls the most relevant used for the detections and hunting queries listed abpve.  The returned data is written to the Azure Sentinel Workspace in GitHub_CL custom table.

  • Get-GitHubRepoLogs Playbook - runs every hour and uses GitHub v3 API to query each repo in each Org for Forks, Clones, Commits, Referrers, Paths, Views, and Collaborators  The returned data is written to the Azure Sentinel Workspace in GitHubRepoLogs_CL custom table.
  • Get-GitHubVulnerabilityAlerts Playbook - runs every hour and uses GitHub V4 API to query for SecurityVulnerabilities. The returned data is written to the Azure Sentinel Workspace in GitHubRepoLogs_CL custom table.

 

ARM Template

To deploy the ARM template containing all the playbooks, connections, storage account and key vault and configure the resources:

  1. Generate a GitHub Personal Access Token https://github.com/settings/tokens.
    1. GitHub user settings -> Developer settings -> Personal access tokens.
  2. Get the objectId for a user that the Logic App can use.
    1. Azure Portal -> Azure Active Directory -> Users -> User. This user will be used to grant access to the Key Vault secret.
  3. Deploy the ARM template and fill in the parameters
    1. https://github.com/Azure/Azure-Sentinel/tree/master/DataConnectors/GitHub.  Click the Deploy to Azure Button.
    2. "PersonalAccessToken": This is the GitHub PAT from Step 1.​
    3. "UserName": A user that will be granted access to the key vault​ to read the PAT.
    4. "principalId": The user object ID​ for the username above
    5. "workspaceId": The Azure Sentinel Workspace ID​
    6. "workSpaceKey": The Azure Sentinel Workspace Key
  4. There are two json files (ORGS.json and lastrun-Audit.json).
  5. Download and edit the ORGS.json file and update "org": "sampleorg" and replace sampleorg with your org name. If you have additional orgs, add another line {"org": "sampleorg"} for each org you want to monitor.
  6. Upload the ORGS.json, and lastrun-Audit.json to the storage account githublogicapp container.
  7. Go to the keyvault - GitHubPlaybooks connection resource.
  8. Click Edit API Connection.
  9. Click Authorize. Sign in as the user which was provided in the parameters. Click Save.
  10. The playbooks are deployed as disabled since the json files and connection has to be authorized. Go to each playbook and click Enable.

GitHub data will now be ingested GitHub_CL, GitHubRepoLogs_CL in Sentinel  :cool:

 

Monitoring GitHub 

User identity is a key attack vector when it comes to GitHub and it should be protected and monitored. Since you can implement SSO using Azure Active Directory (Azure AD) for authentication you can collect Azure AD data into Azure Sentinel using the built in connector and use our detections and hunting queries to monitor for suspicious identity events with Azure Sentinel. But what about GitHub specific threats? There are a number of scenarios that an attacker could attempt exploit in order to gain access to your organizations sensitive data with GitHub that wouldn’t appear in Azure AD logs. Below we will look at some of these, as well as ideas of how to hunt and monitor for them.

 

Parsing the Data 

Before building detections or hunting queries on the GitHub data we collected we can use a KQL Function to parse and normalize the data to make it easier to use. For more background on Functions please read this blog

In the case of GitHub data we have a large number of fields returned from GitHub REST API & GraphQL API, so the parser is going to help us select a subset of the fields relevant to monitor GitHub. You can find our suggested parsers on but you can also modify this parser to fit your needs and preferences. 

 

Since we separated the data into two tables we created two parsers.

 

GitHub_CL Table Parser:

 

 

 

GitHub_CL  
| project TimeGenerated=node_createdAt_t,
   Organization=columnifexists('node_organizationName_s', ""),
   Action=node_action_s,
   OperationType=node_operationType_s,
   Repository=columnifexists('node_repositoryName_s',""),
   Actor=node_actorLogin_s,
   IPaddress=node_actorIp_s,
   City=node_actorLocation_city_s,
   Country=node_actorLocation_country_s,
   ImpactedUser=columnifexists('node_userLogin_s', ""),
   ImpactedUserEmail=columnifexists('node_user_email_s', ""),
   InvitedUserPermission=node_permission_s,
   Visability=columnifexists('node_visibility_s',""),
   OauthApplication=columnifexists('node_oauthApplicationName_s',""),
   OauthApplicationUrl=columnifexists('node_applicationUrl_s',""),
   OauthApplicationState=columnifexists('node_state_s',""),
   UserCanInviteCollaborators=('node_canInviteOutsideCollaboratorsToRepositories_b',""),
   MembershipType=columnifexists('node_membershipTypes_s',""),
   CurrentPermission=columnifexists('node_permission_s',""),
   PreviousPermission=columnifexists('node_permissionWas_s',""),
   TeamName=columnifexists('node_teamName_s',""),
   Reason=columnifexists('node_reason_s',""),
   BlockedUser=columnifexists('node_blockedUserName_s',""),
   CanCreateRepositories=columnifexists('canCreateRepositories_b',"")

 

 

 

GitHubRepoLogs_CL Table Parser:

 

 

 

GitHubRepoLogs_CL
| project TimeGenerated = created_at_t,
    Organization=columnifexists('Organization_s', ""),
    Repository=columnifexists('Repository_s',""),
    Action=columnifexists('LogType_s',""),
    Actor=coalesce(login_s, owner_login_s),
    ActorType=coalesce(owner_type_s, type_s),
    IsPrivate=columnifexists('private_b',""),
    ForksUrl=columnifexists('forks_url_s',""),
    PushedAt=columnifexists('pushed_at_t',""),
    IsDisabled=columnifexists('disabled_b',""),
    AdminPermissions=columnifexists('permissions_admin_b',""),
    PushPermissions=columnifexists('permissions_push_b',""),
    PullPermissions=columnifexists('permissions_pull_b',""),
    ForkCount=columnifexists('forks_count_d',""),
    Count=columnifexists('count_d,',""),
    UniqueUsersCount=columnifexists('uniques_d',""),
    DismmisedAt=columnifexists('dismissedAt_t',""),
    Reason=columnifexists('dismissReason_s',""),
    vulnerableManifestFilename = columnifexists('vulnerableManifestFilename_s',""),

 

 

 

For the queries we will look at in the following sections, we are going to save those parsers with an alias of GitHubAudit. & GitHubRepo. Details on configuring and using a Function as a parser can be found in this blog

 

Detection & Hunting Queries

The following queries are designed to help you find suspicious activity in your GitHub organization, and whilst many are likely to return legitimate activity as well as potentially malicious activity, they can be useful in guiding your hunting. If after running these queries you are confident with the results you could consider turning some or all of them into Azure Sentinel Analytics to alert on. 

 

Brute Force Attack against GitHub Account

Mitre ATT&CK Tactic Credential Access technique T1110

Attackers who are trying to guess your users' passwords or use brute-force methods to get in. If your organization is using SSO with Azure Active Directory, authentication logs to GitHub.com will be generated. Using the following query can help you identify a sudden increase in failed logon attempt of users.

 

 

 

  let LearningPeriod = 7d; 
  let BinTime = 1h; 
  let RunTime = 1h; 
  let StartTime = 1h; 
  let NumberOfStds = 3; 
  let MinThreshold = 10.0; 
  let EndRunTime = StartTime - RunTime; 
  let EndLearningTime = StartTime + LearningPeriod; 
  let GitHubFailedSSOLogins = (SigninLogs 
  | where AppDisplayName == "GitHub.com" 
  | where ResultType == 50056); 
  GitHubFailedSSOLogins 
  | where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime)) 
  | summarize FailedLoginsCountInBinTime = count() by User = Identity, bin(TimeGenerated, BinTime) 
  | summarize AvgOfFailedLoginsInLearning = avg(FailedLoginsCountInBinTime), StdOfFailedLoginsInLearning = stdev(FailedLoginsCountInBinTime) by User 
  | extend LearningThreshold = max_of(AvgOfFailedLoginsInLearning + StdOfFailedLoginsInLearning * NumberOfStds, MinThreshold) 
  | join kind=innerunique ( 
    GitHubFailedSSOLogins 
    | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime)) 
    | summarize FailedLoginsCountInRunTime = count() by User = Identity 
  ) on User 
  | where FailedLoginsCountInRunTime > LearningThreshold
  | extend AccountCustomEntity = UserPrincipalName, IPCustomEntity = IPAddress

 

 

 

GitHub Activities from Infrequent Country

Mitre ATT&CK Tactic Initial Access technique T1078 

This query Detect activities from a location that was never/not recently connected by any user in your organization.

 

 

 

// If you want to look at user added further than 7 days ago adjust this value 
let LearningPeriod = 7d;
  let RunTime = 1h;
  let StartTime = 1h;
  let EndRunTime = StartTime - RunTime;
  let EndLearningTime = StartTime + LearningPeriod;
  let GitHubCountryCodeLogs = (GitHubAudit
  | where Country != "");
    GitHubCountryCodeLogs
  | where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime))
  | summarize makeset(Country) by Actor
  | join kind=innerunique (
    GitHubCountryCodeLogs
    | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime))
    | distinct Country, Actor 
  ) on Actor 
  | where set_Country !contains Country
  | extend AccountCustomEntity = Actor, IPCustomEntity = IPaddressactorLocation_countryCode_s 

 

 

 

Sign-in Burst from Multiple Locations

Mitre ATT&CK Tactic Credential Access technique T1110

This query over Azure Active Directory sign-in activity to GitHub.com highlights accounts associated with multiple authentications from different geographical locations in a short space of time.

 

 

 

let RunTime = 1h;
SigninLogs
| where TimeGenerated > ago(RunTime)
| where AppDisplayName == "GitHub.com"
| where ResultType == 0
| summarize CountOfLocations = dcount(Location), Locations = make_set(Location) by User = Identity
| where CountOfLocations > 1 
  | extend AccountCustomEntity = UserPrincipalName, IPCustomEntity = IPAddress

 

 

 

Threat Intel Matches to GitHub Audit Logs

Mitre Mitigation Threat Intelligence Program technique T1212

Azure Sentinel integrates with Microsoft Graph Security API data sources for ingesting threat intelligence indicators.We identifies a match in GitHub Audit Logs data from any IP address IOC from TI. 

 

 

 

ThreatIntelligenceIndicator
  | where TimeGenerated >= ago(24h)
  | where Action == true
  // Picking up only IOC's that contain the entities we want
  | where isnotempty(NetworkIP) or isnotempty(EmailSourceIpAddress) or isnotempty(NetworkDestinationIP) or isnotempty(NetworkSourceIP)
  // Taking the first non-empty value based on potential IOC match availability
  | extend TI_ipEntity = iff(isnotempty(NetworkIP), NetworkIP, NetworkDestinationIP)
  | extend TI_ipEntity = iff(isempty(TI_ipEntity) and isnotempty(NetworkSourceIP), NetworkSourceIP, TI_ipEntity)
  | extend TI_ipEntity = iff(isempty(TI_ipEntity) and isnotempty(EmailSourceIpAddress), EmailSourceIpAddress, TI_ipEntity)
  | join (
    GitHubAudit
    | where TimeGenerated >= ago(24h)
    | extned GitHubAudit_TimeGenerated = TimeGenerated
  )
  on on $left.TI_ipEntity == $right.IPaddress
  | summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by IndicatorId
  | project LatestIndicatorTime, Description, ActivityGroupNames, IndicatorId, ThreatType, Url, ExpirationDateTime, ConfidenceScore, GitHubAudit_TimeGenerated, TI_ipEntity, IPaddress, Actor, Action, Country, OperationType, NetworkIP, NetworkDestinationIP, NetworkSourceIP, EmailSourceIpAddress
  | extend timestamp = GitHubAudit_TimeGenerated, IPCustomEntity = IPaddress, AccountCustomEntity = Actor

 

 

 

Two Factor Authentication Disabled

Mitre ATT&CK Tactic Defense Evasion technique T1089

Two-factor authentication is a process where a user is prompted during the sign-in process for an additional form of identification, such as to enter a code on their cellphone or to provide a fingerprint scan. Two factor authentication reduces the risk of account takeover. Attacker will want to disable such security tools in order to go undetected. 

 

 

 

let timeframe = 14d;
GitHubAudit
  | where TimeGenerated > ago(timeframe)
  | where Action == "org.disable_two_factor_requirement"
  | project TimeGenerated, Action, Actor, Country, IPaddress, Repository
  | extend AccountCustomEntity = Actor, IPCustomEntity = IPaddress 

 

 

 

Security Vulnerability in Repo

Mitre ATT&CK Tactic Execution technique T1203

This alerts when a new security vulnerability is discovered in a GitHub repository. 

 

 

 

let timeframe = 14d;
let timeframe = 14d;
  GitHubRepo
  | where TimeGenerated > ago(timeframe)
  | where Action == "vulnerabilityAlert"
  | project TimeGenerated, DismmisedAt, Reason, vulnerableManifestFilename, Description, Link, PublishedAt, Severity, Summary 

 

 

 

Inactive or New Account Usage

Mitre ATT&CK tactic Persistence technique T1136

This hunting query identifies Accounts that are new or inactive and have accessed or used GitHub that may be a sign of compromise.

 

 

 

// If you want to look at user added further than 7 days ago adjust this value 
let LearningPeriod = 7d;
let RunTime = 1h;
let StartTime = 1h;
let EndRunTime = StartTime - RunTime;
let EndLearningTime = StartTime + LearningPeriod;
let GitHubActorLogin = (GitHub_CL
| where actorLogin_s != "");
let GitHubUser = (GitHub_CL
| where userLogin_s != "");
let GitHubNewActorLogin = (  GitHubActorLogin
| where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime))
| summarize makeset(actorLogin_s)
| extend Dummy = 1
| join kind=innerunique
(
    GitHubActorLogin
    | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime))
    | distinct actorLogin_s
    | extend Dummy = 1
)
on Dummy
| project-away Dummy
| where set_actorLogin_s  !contains actorLogin_s);
let GitHubNewUser = (  GitHubUser
| where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime))
| summarize makeset(userLogin_s)
| extend Dummy = 1
| join kind=innerunique
(
    GitHubUser
    | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime))
    | distinct userLogin_s
    | extend Dummy = 1
)
on Dummy
| project-away Dummy
| where set_userLogin_s   !contains userLogin_s);
union GitHubNewActorLogin, GitHubNewUser 

 

 

 

Unusual Number of Repository Clones

Mitre ATT&CK Tactic Collection technique T1213

Attacker can exfiltrate data from you GitHub repository after gaining access to it by performing clone action. This hunting queries allows you to track the clones activities for each of your repositories. The visualization allow you to quickly identify anomalies/excessive clone, to further investigate repo access & permissions.

 

 

 

let min_t = toscalar(GitHubRepo
| summarize min(timestamp_t));
let max_t = toscalar(GitHubRepo
| summarize max(timestamp_t));
GitHubRepo
| where Action == "Clones"
| distinct TimeGenerated, Repository, Count
| make-series num=sum(Count) default=0 on TimeGenerated in range(min_t, max_t, 1h) by Repository 
| extend (anomalies, score, baseline) = series_decompose_anomalies(num, 1.5, -1, 'linefit')
| render timechart t 

 

 

 

User Grant Access and Grants Other Access

Mitre ATT&CK Tactic Persistence, Privilege Escalation technique T1098, T1078

Identifies when a new user is granted access and starts granting access to other users.  This can help you identify rogue or malicious user behavior.

 

 

 

GitHubAudit
| where Action == "org.invite_member" or Action == "org.add_member" or Action == "team.add_member" or Action == "repo.add_member"
| distinct ImpactedUser, TimeGenerated, Actor
| project-rename firstUserAdded = ImpactedUser, firstEventTime = TimeGenerated, firstAdderUser = Actor
| join kind= innerunique (
GitHubAudit
| where ImpactedUser != ""
| where Action == "org.invite_member" or Action == "org.add_member" or Action == "team.add_member" or Action == "repo.add_member"
| distinct ImpactedUser, TimeGenerated, Actor
| project-rename secondUserAdded = ImpactedUser, secondEventTime = TimeGenerated, secondAdderUser = Actor
) on $right.secondAdderUser == $left.firstUserAdded
| where secondEventTime between (firstEventTime .. (firstEventTime + 1h))

 

 

 

Oauth App Restrictions Disabled

Mitre ATT&CK Tactic Defense Evasion, Persistence technique T1089, T1100

This hunting query identifies GitHub OAuth Apps that have restrictions disabled that may be a sign of compromise. Attacker will want to disable such security tools in order to go undetected.

 

 

 

let timeframe = 14d;
  GitHubAudit
  | where TimeGenerated > ago(timeframe)
  | where Action == "org.disable_oauth_app_restrictions"
  | project TimeGenerated, Action, Actor, Location 

 

 

 

Mass Deletion of Repositories

Mitre ATT&CK Tactic Impact technique T1485

This hunting queries identify an unusual increase of repo deletion activities

adversaries may want to disrupt availability or compromise integrity by deleting business data.

 

 

 

let LearningPeriod = 7d;
  let BinTime = 1h;
  let RunTime = 1h;
  let StartTime = 1h;
  let NumberOfStds = 3;
  let MinThreshold = 10.0;
  let EndRunTime = StartTime - RunTime;
  let EndLearningTime = StartTime + LearningPeriod;
  let GitHubRepositoryDestroyEvents = (GitHubAudit
  | where Action == "repo.destroy");
  GitHubRepositoryDestroyEvents
  | where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime))
  | summarize count() by bin(TimeGenerated, BinTime)
  | summarize AvgInLearning = avg(count_), StdInLearning = stdev(count_)
  | extend LearningThreshold = max_of(AvgInLearning + StdInLearning * NumberOfStds, MinThreshold)
  | extend Dummy = 1
  | join kind=innerunique (
    GitHubRepositoryDestroyEvents
    | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime))
    | summarize CountInRunTime = count() by bin(TimeGenerated, BinTime)
    | extend Dummy = 1
  ) on Dummy
  | project-away Dummy
  | where CountInRunTime > LearningThreshold

 

 

 

Org Repositories Default Permissions Change

Mitre ATT&CK Tactic Defense Evasion, Persistence technique T1089, T1098

This hunting query identifies a global change to the organization permission policy for repositories. The default is read, attacker may change this permission in order to gain persistence or evade detection.

 

 

 

GitHubAudit
| where Action == "org.update_default_repository_permission"
| project TimeGenerated, Action, Actor, Country, Repository, PreviousPermission, CurrentPermission

 

 

 

Repository Permission Switched to Public

Mitre ATT&CK Tactic Collection technique T1213

This hunting query identifies a change to the visibility state of a repository. This will help identify issues of data breaches.

 

 

 

let timeframe = 14d;
GitHubAudit
| where TimeGenerated > ago(timeframe)
| where Action == "repo.access"
| where OperationType == "MODIFY"
| where node_visibility_s == "PUBLIC" 
| project TimeGenerated, Action, Actor, Country, Repository, Visabilitys

 

 

 

Suspicious Fork Activity

Mitre ATT&CK Tactic Exfiltration technique T1537

This hunting query identifies a fork activity against a repository done by a user who is not the owner of the repo nor a contributor.

 

 

 

let RunTime = 1h; 
let CollaboratorsUserToRepoMapping = (
GitHubRepo
| where TimeGenerated < ago(RunTime)
| where Action == "Collaborators"
| distinct Repository , Actor, Organization);
let UserCommitsInRepoMapping = (
GitHubRepo
| where Action == "Commits"
| where TimeGenerated < ago(RunTime)
| distinct  Repository ,Actor, Organization);
union CollaboratorsUserToRepoMapping, UserCommitsInRepoMapping
| summarize ContributedToRepos = make_set(Repository) by Actor, Organization
| join kind=innerunique (
GitHubRepo
| where TimeGenerated > ago(RunTime)
| where Action == "Forks"
| distinct Repository , Actor, Organization
) on Actor, Organization
| project-away Actor1, Organization1
| where ContributedToRepos !contains Repository

 

 

 

User First Time Repository Delete Activity

Mitre ATT&CK Tactic Impact technique T1485

This hunting query identifies a change to the visibility state of a repository. This will help identify issues of data breaches.

 

 

 

let LearningPeriod = 7d;
let RunTime = 1h;
let StartTime = 1h;
let EndRunTime = StartTime - RunTime;
let EndLearningTime = StartTime + LearningPeriod;
let GitHubRepositoryDestroyEvents = (GitHubAudit
| where Action == "repo.destroy");
GitHubRepositoryDestroyEvents
| where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime))
| distinct Actor
| join kind=rightanti (
  GitHubRepositoryDestroyEvents
  | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime))
  | distinct Actor
) on Actor

 

 

 

First Time User Invite and Add Member to Org

Mitre ATT&CK Tactic Persistence technique T1136

This hunting query identifies a user that add/invite a member to the organization for the first time. This technique can be leveraged by attackers to add stealth account access to the organization.

 

 

 

let LearningPeriod = 7d;
  let RunTime = 1h;
  let StartTime = 1h;
  let EndRunTime = StartTime - RunTime;
  let EndLearningTime = StartTime + LearningPeriod;
  let GitHubOrgMemberLogs = (GitHubAudit
   where Action == "org.invite_member" or Action == "org.update_member" or Action == "org.add_member Action == "repo.add_member" Action == "team.add_member");
  GitHubOrgMemberLogs
  | where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime))
  | distinct Actor
  | join kind=rightanti (
    GitHubOrgMemberLogs
    | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime))
    | distinct Actor
  ) on Actor 

 

 

 

The GitHub hunting queries detailed in this blog have been shared on the Azure Sentinel GitHub along with the parser, ARM template and a workbook. We will be continuing to develop detections and hunting queries for GitHub data over time so make sure you keep an eye on GitHub :smile:  As always if you have your own ideas for queries or detections please feel free to contribute to the Azure Sentinel community.

3 Comments
Occasional Visitor
@Itay ArgoetyThanks for sharing detailed article for GitHub integration.
I tried exactly all commands but getting below error in keyvault playbook, can you please suggest how to correct it:

Error: Failed to edit API connection.
Failed to edit API connection 'keyvault-GitHubPlaybooks'.
Frequent Visitor

Also getting the  same error reported by @MIILLAANN 

 

Error: Failed to edit API connection.

Failed to edit API connection 'keyvault-GitHubPlaybooks'.

abhi_Ram_0-1596109880318.png

@MIILLAANN and @abhi_Ram 

Could one of you open a github issue here? https://github.com/azure/azure-sentinel/issues.

 

Please share screenshots there and i can help look into it.