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
Before you begin
Section titled “Before you begin”- 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.
Run the check
Section titled “Run the check”-
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.
-
Describe the planned changes.
Send up to 200 changes. Each has a
kindand the Microsoft Entra object IDs it names:kindFields ROLE_ASSIGNMENTprincipal_id, one ofrole_definition_idorrole_definition_name(an Azure role by name), andscope(default/)APP_ROLE_ASSIGNMENTprincipal_id,app_role_idGROUP_MEMBERSHIPprincipal_id,group_idOWNERSHIPprincipal_id,owned_idFor a principal the plan itself creates, send
new_principal(your own short token) instead ofprincipal_id. The same token means the same principal. -
Send the request.
POST /v1/simulate/plan HTTP/1.1Host: <your AuditGraph host>X-API-Key: ag_xxxxxxxxxxxxxxxxContent-Type: application/json{"changes": [{"kind": "ROLE_ASSIGNMENT","principal_id": "<object id>","role_definition_name": "Owner","scope": "/subscriptions/<subscription id>"}]} -
Read the answer, and fail the pipeline if you choose to.
Field Meaning changesEach change with its outcome:MODELED, orNOT_COMPUTEDwith areasonelevationsPrincipals the plan moves to a higher tier, with from_tierandto_tierpaths,paths_totalThe new paths, each with its hops and the changes that cause it ( caused_by)new_paths_by_tierNew paths per tier (Tier-0, Tier-1) displayability,partial_reasonsPARTIALwhen the answer is a lower bound, and why
How to read the answer
Section titled “How to read the answer”- 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
PARTIALand 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_COMPUTEDwith 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.
Verify the setup
Section titled “Verify the setup”| 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 |
Troubleshooting
Section titled “Troubleshooting”| 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. |