EntraGoat: Hands-on vulnerable Microsoft Entra ID lab for training
EntraGoat automates deployment of vulnerable configurations in an isolated Entra ID test tenant using PowerShell and Microsoft Graph, providing realistic privilege-escalation exercises and CTF-style scenarios for security training and red/blue team practice.
GitHub Semperis/EntraGoat Updated 2025-12-23 Branch main Stars 801 Forks 80
PowerShell Microsoft Graph API Node.js frontend Identity Security Training Deliberately Vulnerable Lab CTF/Hands-on Scenarios Microsoft Entra ID

💡 Deep Analysis

4
Why does EntraGoat use PowerShell + Microsoft Graph instead of other implementations? What are the advantages of this technical choice?

Core Analysis

Core Question: EntraGoat uses PowerShell + Microsoft.Graph to maximize fidelity to real administrator/attacker interactions while minimizing external dependencies.

Technical Characteristics and Advantages

  • High fidelity: Microsoft.Graph is Microsoft’s official API for Entra ID management, enabling app registration, permission grants, role assignments, and certificate uploads—accurately reproducing real misconfiguration flows.
  • Administrator-friendly: PowerShell is a common tool among Azure/Windows administrators and security teams, lowering the learning curve for target users.
  • Minimal external dependencies: Scripts run locally and call Graph APIs directly—no extra cloud services required—making deployment in controlled tenants straightforward and auditable.
  • Auditable and cleanable: Scripts explicitly create resources, which helps tracking and cleanup.

Practical Recommendations

  1. Keep Microsoft.Graph up-to-date to avoid reproducibility issues from API or module changes.
  2. Review scripts line-by-line before execution to understand the impact of each Graph call and permission scope.
  3. Treat the frontend as a management helper; the PowerShell scripts are the authoritative execution units.

Caveats

  • Tenant policies can block Graph calls (Conditional Access, PIM, licensing).
  • High privilege requirements: Many scenarios require Global Administrator — enforce strict authorization and auditing.

Important Notice: This choice yields realistic scenarios but requires PowerShell/Graph competence and execution in an isolated test tenant.

Summary: The PowerShell + Microsoft.Graph combination provides realism, auditability, and low-dependency deployment—making it a suitable technical choice for EntraGoat.

85.0%
What is the learning curve and common pitfalls when using EntraGoat? How to reduce the onboarding difficulty?

Core Analysis

Core Issue: EntraGoat has a moderate-to-high learning curve. Key challenges are understanding the Entra ID permission model, PowerShell/Microsoft.Graph usage, and correct environment isolation and cleanup.

Technical Analysis (Common Pitfalls)

  • Risk of running in production: Running in non-isolated tenants can change production configurations or trigger enterprise policies.
  • Tooling and policy incompatibilities: PowerShell versions, Microsoft.Graph module differences, or tenant policies (Conditional Access, PIM) can cause scripts to fail or behave unexpectedly.
  • Cleanup failures or residual artifacts: Ownership or reference chains can prevent cleanup scripts from removing resources.
  • Credential/key leakage risk: Certificates or secrets created during testing may be improperly stored or exposed.

Practical Steps to Reduce Onboarding Difficulty

  1. Prepare a pre-check checklist: Validate PowerShell and Graph module versions, availability of Global Admin, potential impact of Conditional Access/MFA, and logging configuration.
  2. Use a dedicated test tenant template: Create an isolated test tenant and record configuration snapshots when possible.
  3. Run scenarios in stages: Perform dry-runs or read-only inspections of Graph requests with limited accounts before deploying with elevated privileges.
  4. Track created objects: Ensure scripts log all created resource IDs to facilitate cleanup or rollback.
  5. Lock versions and automate small rehearsals: Standardize PowerShell/Graph versions in your environment and run small-scale tests to ensure reproducibility.

Important Notice: Always execute in authorized, isolated test tenants; never commit generated keys/certs to public repos or shared stores.

Summary: Standardized preparation, staged execution, and strict logging significantly reduce EntraGoat’s operational risk and onboarding overhead.

85.0%
In a real enterprise setting, how can EntraGoat be used to validate detection and response capabilities? (Include concrete operational steps)

Core Analysis

Core Issue: Use EntraGoat as a controlled “attack generator” to validate enterprise detection (SIEM/UEBA) and response (IR) capabilities. The exercise requires clear orchestration of deployment, execution, monitoring, and cleanup phases.

Technical Analysis and Operational Steps (Concrete)

  1. Preparation (Isolation & Auditing)
    - Deploy a scenario in a dedicated test tenant via Setup. Ensure audit logging is enabled: AuditLogs, SignInLogs, ProvisioningLogs, AppConsentLogs.
    - Record all resource IDs and permissions created.

  2. Trigger (Execute Exploit)
    - Execute the scenario’s exploit/automation scripts within a controlled time window and timestamp the activity sequence.
    - Limit attacker activity to observable nodes (e.g., specific service principal or IP range).

  3. Monitor & Validate
    - Query SIEM for logs in the test window and confirm expected events (abnormal app registration, delegated/app permission use, unusual token issuance, cert/key uploads, admin role changes).
    - Verify that alerts were generated, the alert content maps to root cause, and the IR playbook was initiated.

  4. Recovery (Cleanup & Audit)
    - Run Cleanup and verify deletion of created objects. If cleanup fails, use recorded resource IDs for manual rollback.
    - Export logs from the test for rule tuning and documentation.

Practical Tips

  • Validate log sources first to ensure Graph operations are being captured by SIEM.
  • Create a test run record documenting scenario, timestamps, resource IDs, and operator identity.
  • Feed POC findings into detection rules and IR playbooks.

Important Notice: Execute only in authorized test tenants and prevent any activity from spilling into production or activating enterprise-wide automations.

Summary: EntraGoat enables a repeatable and cleanable simulation of identity attacks, suitable for end-to-end detection and response validation.

85.0%
What are common root causes for cleanup failures in EntraGoat? How to ensure tenant state can be restored after experiments?

Core Analysis

Core Issue: Cleanup failures typically stem from resource references/dependencies, insufficient permissions, tenant policies, or script issues. Ensuring tenant restoreability requires designing rollbackability and logging during deployment.

Common Root Causes

  • Unresolved references/dependencies: A service principal used as an owner or referenced in access policies cannot be deleted directly.
  • Insufficient permissions or approval delays: The account running cleanup lacks necessary delete privileges or PIM approvals are pending.
  • API rate limits or transient errors: Bulk deletes can hit Graph rate limits leading to partial failures.
  • Scripts lacking idempotency and retries: Scripts don’t retry or log failed items for manual intervention.

Practical Steps to Ensure Restoreability

  1. Record resource inventory at creation: Scripts should log every created resource ID, displayName, and timestamp to local logs or CSV.
  2. Delete in dependency order: Cleanup should first remove references (owners, role assignments) then delete primary resources (apps, service principals, certificates).
  3. Implement idempotency and retries: Add exponential backoff retries for failed deletions and log final outcomes for manual follow-up.
  4. Verify deletions and produce a report: Compare cleanup results against the creation log and list residuals for manual cleanup.
  5. Pre-validate permissions: Ensure the cleanup runner has the necessary rights or pre-grant delete privileges to avoid approval delays.

Important Notice: Retain complete test logs; if automated cleanup fails, use recorded resource IDs for manual rollback.

Summary: Make recoverability a first-class concern—log creation, resolve references, perform dependency-aware deletions, and verify—this minimizes residual artifacts and restores tenant state.

85.0%

✨ Highlights

  • Realistic multi-path privilege escalation scenarios
  • Automated deployment and cleanup via PowerShell and Graph API
  • Requires Global Administrator privileges and a dedicated test tenant
  • Solutions contain full attack walkthroughs; misuse and legal/compliance risks exist

🔧 Engineering

  • Scenario-based deployment of vulnerable Entra ID configurations with setup, cleanup, and solution walkthroughs
  • Provides an interactive web UI plus scripted workflows suitable for classroom and self-paced practice

⚠️ Risks

  • Operation requires Global Administrator privileges; accidental use in production can cause severe impact
  • Repository metadata shows incomplete license and activity data; README claims MIT while metadata marks license as unknown
  • Includes full attack solutions (spoilers); public exposure may reduce learning value or enable misuse

👥 For who?

  • Suitable for identity security researchers, red/blue teams, and academic/corporate training labs
  • Requires basic familiarity with Entra ID, PowerShell, and Microsoft Graph API