Skip to content

[FEATURE] Azure containment: disable Entra users and service principals, revoke sessions (follow-up to #168) #214

Backlog

Description

@OkiriGabriel

Context

disable_access_key (#168) supports AWS and GCP only. For Azure it returns "rotate them manually", because service principal client secrets can only be deleted, which the agent never does. That leaves Azure tenants without approval-gated containment for compromised identities.

Proposal (approval-gated, reversible, no deletes)

  • Entra ID user: az ad user update --id <upn> --account-enabled false and revoke refresh tokens (az rest --method POST --uri https://graph.microsoft.com/v1.0/users/<id>/revokeSignInSessions). Reverse: --account-enabled true.
  • Service principal / app: disable sign-in (az ad sp update --id <appId> --set accountEnabled=false). Reverse: accountEnabled=true. This stops a leaked client secret working without deleting it.
  • Storage account key leak: az storage account update --allow-shared-key-access false (reversible), with key rotation left to a human.
  • Evidence first: az ad user show, sign-in logs (az rest Graph auditLogs/signIns?$filter=userId eq …&$top=50), app credentials list (metadata only).
  • Strict validation (UPN/GUID formats), shlex quoting, emergency stop and the injection lock, the same as the existing tools.
  • Tests and docs, as in tests/test_containment.py.

Files

tools/containment.py, agent/core.py (schema: provider enum adds azure, principal_type), docs/THREAT_DETECTION.md

Activity

  1. added
    enhancement
    security
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions