feat: add legacy-auth Conditional Access bypass scenario#14
Open
ChrisJr404 wants to merge 1 commit into
Open
Conversation
Adds a Beginner-tier scenario that teaches the classic legacy-auth gap
in Conditional Access. The setup script provisions a CA policy that
requires MFA for all users on all cloud apps, but with clientAppTypes
scoped to browser + modern desktop/mobile only. exchangeActiveSync and
'other' (ROPC, IMAP, POP, SMTP AUTH) are silently out of scope, so the
target admin account is reachable via legacy auth without an MFA
prompt. The walkthrough recovers the flag via a ROPC token request to
the v2.0 token endpoint.
Defender takeaway: an MFA-only Conditional Access policy without
'Block legacy authentication' (or per-protocol disable via
Authentication Methods / Set-CASMailbox) leaves the side door open.
Files:
- scenarios/EntraGoat-Scenario7-Setup.ps1
- cleanups/EntraGoat-Scenario7-Cleanup.ps1
- solutions/EntraGoat-Scenario7-Solution.ps1
- frontend/public/scripts/challenge7/{setup,cleanup}.ps1
- EntraGoatGUI/Data/Challenges.ps1: register challenge 7
- frontend/src/App.js: register challenge 7
- README.md, docs/challenges.md: list new scenario
Requires Entra ID P1 (Conditional Access).
WORKFLOW-1 · PR Annotation (Risks)Policies: "Secret with unknown validity in public, applicative code added" Secrets
Repository: EntraGoat |
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Scenario 7 – Legacy Loophole: When MFA Forgot the Side Door, a new Beginner-tier challenge that teaches the classic legacy-auth gap in Conditional Access. An MFA-only CA policy that does not also block legacy authentication leaves a real, regularly-exploited path past MFA, and this scenario lets defenders practice spotting it end-to-end.
What the lesson teaches
Conditional Access
clientAppTypesis an allow-list, not deny-all. If a CA author leaves the policy scoped tobrowser+mobileAppsAndDesktopClientsonly (the modern-auth defaults), every legacy-auth path — Resource Owner Password Credentials (ROPC), IMAP, POP, SMTP AUTH, Exchange ActiveSync, "Other clients" — falls outside policy scope and is never challenged for MFA. An attacker holding a valid password can sign in via ROPC or SMTP AUTH and never see the MFA prompt.Defender objectives
clientAppTypescoverage.Set-CASMailbox/Set-OrganizationConfig) to disable basic auth per-protocol where business-justified (SMTP AUTH, POP, IMAP, MAPI, OAB, RPC, ActiveSync).Client app == Other clients / IMAP4 / POP3 / SMTP / Exchange ActiveSyncusing the Microsoft-published "Sign-ins using Legacy Authentication" workbook before flipping the block.Red-team walkthrough summary
raj.patel).clientAppTypesdoes not includeexchangeActiveSyncorother.EntraGoat-admin-s7), still using a stale Helpdesk-reset password.https://login.microsoftonline.com/<tenant>/oauth2/v2.0/token— ROPC is classified as "Other clients" and is unscoped by the policy.onPremisesExtensionAttributes.extensionAttribute1and recover the flag.MITRE ATT&CK mapping
Files added
scenarios/EntraGoat-Scenario7-Setup.ps1– provisions the vulnerable CA policy + admin account.cleanups/EntraGoat-Scenario7-Cleanup.ps1– removes the policy + users.solutions/EntraGoat-Scenario7-Solution.ps1– step-by-step walkthrough with defender remediation checklist.frontend/public/scripts/challenge7/{setup,cleanup}.ps1– Web UI mirrors of the scenario scripts.Files modified
EntraGoatGUI/Data/Challenges.ps1– register challenge 7 (PowerShell GUI).frontend/src/App.js– register challenge 7 (Web UI default state).README.md,docs/challenges.md– add the new row to the scenario tables.Prerequisites
Microsoft.GraphPowerShell SDK, includingMicrosoft.Graph.Identity.SignInsfor the CA cmdlets.Notes
EntraGoat-admin-s7@<tenant>, flag inextensionAttribute1,=====separator,Write-Hostcolour scheme, optional-Verboseoutput).PSScriptAnalyzeron the new files surfaces the same baseline rule classes (PSAvoidUsingWriteHost,PSAvoidUsingPlainTextForPassword) as the existing scenarios — no new rule classes were introduced.Test plan
scenarios/EntraGoat-Scenario7-Setup.ps1against a P1 trial tenant and verify the CA policy is created withclientAppTypes = browser, mobileAppsAndDesktopClientsonly.EntraGoat-admin-s7with no MFA prompt.onPremisesExtensionAttributes.extensionAttribute1returns the flag.cleanups/EntraGoat-Scenario7-Cleanup.ps1and verify the CA policy + both users are gone.