Skip to content

Check a change before you deploy it

The pre-change impact check tells you which new attack paths to Tier-0 and Tier-1 a planned change would create, and which identities it would make Tier-0 or Tier-1. Run it from a pipeline before a Terraform or Bicep change is applied.

Time
One API key to create; each check is one API call
Who
An Admin creates the API key; your pipeline calls the check
Access granted
Read-only. AuditGraph stores nothing but an audit entry with counts
Plans
Essentials, Professional and Enterprise
Outcome
The new paths and elevations your change would cause, modeled on your current snapshot
  • Your organization has at least one published snapshot. The check models your change on the newest one.
  • You can read the planned changes: for example the output of terraform show -json, or an Azure what-if result.
  • You have a secret store for the API key in your pipeline.
  1. Create an API key for the pipeline.

    Under Administration › API & Exports, create a read-only key with the Security Reader or Security Admin role. See API keys.

    Result: the key is shown once. Store it in your pipeline’s secret store.

  2. Describe the planned changes.

    Send up to 200 changes. Each has a kind and the Microsoft Entra object IDs it names:

    kind Fields
    ROLE_ASSIGNMENT principal_id, one of role_definition_id or role_definition_name (an Azure role by name), and scope (default /)
    APP_ROLE_ASSIGNMENT principal_id, app_role_id
    GROUP_MEMBERSHIP principal_id, group_id
    OWNERSHIP principal_id, owned_id

    For a principal the plan itself creates, send new_principal (your own short token) instead of principal_id. The same token means the same principal.

  3. Send the request.

    POST /v1/simulate/plan HTTP/1.1
    Host: <your AuditGraph host>
    X-API-Key: ag_xxxxxxxxxxxxxxxx
    Content-Type: application/json
    {"changes": [{"kind": "ROLE_ASSIGNMENT",
    "principal_id": "<object id>",
    "role_definition_name": "Owner",
    "scope": "/subscriptions/<subscription id>"}]}
  4. Read the answer, and fail the pipeline if you choose to.

    Field Meaning
    changes Each change with its outcome: MODELED, or NOT_COMPUTED with a reason
    elevations Principals the plan moves to a higher tier, with from_tier and to_tier
    paths, paths_total The new paths, each with its hops and the changes that cause it (caused_by)
    new_paths_by_tier New paths per tier (Tier-0, Tier-1)
    displayability, partial_reasons PARTIAL when the answer is a lower bound, and why
  • It is a model. The answer is computed from your current snapshot with the same attack-path search the product uses. Nothing is deployed, and your tenant is never touched.
  • “No new path” needs a complete answer. When the search hits its bounds, a change cannot be modeled, or some rules ran on partial collection, the answer is PARTIAL and its counts are a lower bound.
  • A change may not be modeled. For example, a role your snapshot holds no grant of, or a scope it does not know, returns NOT_COMPUTED with the reason.
  • Inbound paths are searched from direct owners only. For a principal the plan makes Tier-0 or Tier-1, new paths into it are searched from its direct owners.
Check Where Expected result
The key works Send one known role assignment 200 with modeled: true and the change’s outcome
The call is recorded Administration › Audit History One entry for the check, with counts only
Symptom Cause Fix
403 Your plan does not include the API, or the key’s role or scope does not allow the check. Use a Security Reader or Security Admin key on Essentials or above. Keys scoped to export:read or detection:read cannot call it.
422 The body has an unknown field, or a change misses a required field. Send only the fields in step 2.
429 Over 30 requests per minute per key. Wait a minute, then retry.