For the complete documentation index, see llms.txt. This page is also available as Markdown.

AZ_MG_ADD_SECRET

Summary

Forestall ACL Alias

AZ_MG_ADD_SECRET

Entra ID (Azure AD) Alias

Add Secrets (Microsoft Graph)

Affected Object Types

App registrations & Service Principals

Exploitation Certainty

Certain

Graph Permission / Role

Ability to add password credentials via Microsoft Graph using application permission Application.ReadWrite.All and/or directory roles such as Application Administrator, Cloud Application Administrator, Global Administrator or explicit Owner on the Application / Service Principal

Description

AZ_MG_ADD_SECRET represents the ability for a principal to add a new client secret / password credential via Microsoft Graph to an App Registration (application) or a Service Principal.

Adding a secret gives an attacker or a controlled identity the ability to:

  • Exchange the application's client id + secret for tokens and act as that application, using any privileges granted to the app (delegated or application permissions).

  • If the application has broad application permissions, the attacker can perform tenant-wide actions or escalate further.

  • If the service principal represents infrastructure, cloud resources, or privileged automation, the new secret may be used to access production systems or pivot laterally.

Because secrets are persistent credentials that can be used from anywhere, the ability to add secrets is highly sensitive.

Identification

PowerShell (Microsoft Graph)

Enumerate service principals that have Microsoft Graph application permissions capable of adding secrets.

Azure Portal

  1. Enterprise applications (service principals) that can add secrets via Graph

    • Go to Enterprise applications -> select the application (service principal).

    • Open Permissions / API permissions.

    • Under Microsoft Graph -> review Application permissions for:

      • Application.ReadWrite.All

Note: For identification of directory roles (Application Administrator, Cloud Application Administrator, Global Administrator) and explicit owners that can add secrets, see AZ_ADD_SECRET.

Exploitation

An attacker with Application.ReadWrite.All permission or ownership of an application can add a client secret and then authenticate as that application to abuse its permissions.

PowerShell (Microsoft Graph)

Azure Portal

  • Go to Microsoft Entra admin center -> App registrations (or Enterprise applications).

  • Open the target object.

  • Go to Certificates & secrets.

  • Under Client secrets, create a new secret.

  • Copy the secret immediately and store it securely.

Mitigation

  • Minimize owners on applications and service principals.

  • Remove unnecessary Graph permissions from service principals:

    • Review and remove Application.ReadWrite.All when not required.

    • Prefer least-privilege patterns and narrow ownership boundaries.

  • Configure Application management policies to restrict credential operations:

    • Restrict or block password credential additions where possible.

    • Enforce maximum secret lifetimes.

    • Control exceptions with explicit scoping and approvals.

  • Use privileged access controls for admin roles (PIM where available).

  • Require change management for credential changes on production identities.

  • Regular access reviews:

    • Go to Identity Governance -> Access Reviews.

    • Review application owners and service principals with privileged permissions.

Detection

Use the Microsoft Entra admin center:

  1. Open Microsoft Entra ID -> Audit logs.

  2. Filter Category for ApplicationManagement.

  3. Filter Activity for Update application - Certificates and secrets management and Add service principal credentials.

  4. Review Initiated by (actor), Target resources, Date, Status, and modified credential properties for unexpected secret additions.

  5. Open the affected app registration or enterprise application and review Certificates & secrets, API permissions, and Owners.

References

Last updated

Was this helpful?