← All posts IAM

AWS IAM policy simulator: what it tests and its limits

Summary

  • The IAM policy simulator answers a precise question: is a given principal allowed or denied a given action on a given resource, and which statement decided it. It does not make the real call, so it is safe to run.
  • Two APIs back it: SimulatePrincipalPolicy for an existing principal and SimulateCustomPolicy for policies you pass in. It evaluates identity policies, service control policies, permission boundaries and, with caveats, resource policies.
  • Its limits are documented: results can differ from live, resource-policy and cross-account simulation run through the CLI or API rather than the console, and it does not cover resource control policies.
  • It evaluates one decision at a time. An attack path is a sequence of decisions across principals and accounts, which is where Pathbreak resolves the chains and gives the single change that breaks the most.

The AWS IAM policy simulator is the native way to answer a narrow, important question: for this principal, is this action on this resource allowed or denied, and which policy statement made the call. It runs the IAM evaluation logic against the policies without sending the real request, so you can test a change before it ships or confirm why an access is being denied, with no risk of touching production.

What the simulator evaluates

Given a principal, a list of actions and a resource, the simulator works through the policies that apply and returns an allow or deny per action with the matching statements. It evaluates:

  • Identity-based policies attached to the user, group or role.
  • Service control policies, including their condition keys and resource scoping, which are evaluated through the API or CLI rather than the console, and you can model an SCP hierarchy through the API.
  • Permission boundaries on the principal.
  • Resource-based policies, with conditions described below.

Condition keys matter to the result. Some are filled in automatically, and you supply the rest as simulation inputs, so a decision is only as right as the context you give it.

How you run it

In the IAM console you pick a user, group or role, choose actions and a resource, and read the allow or deny per action. Through the API or CLI you call simulate-principal-policy for an existing principal, or simulate-custom-policy to test policy documents you paste in before attaching them to anyone. The custom form takes an ordered list of organization policy inputs when you want to model an SCP hierarchy without a live principal.

What it covers and where

InputSupportedWhere
Identity-based policiesYesConsole and API
Service control policies, including a hierarchyYesAPI, with the ordered policy input list
Permission boundariesYesConsole and API
Resource-based policiesFor IAM users, with the resource and its policy includedCLI or API, not the console custom mode
Cross-account accessReturns a decision per policy typeAPI or CLI, not the console
Resource control policies (RCPs)Not supportedValidate against the live environment

AWS is clear that simulated results can differ from your live environment and recommends confirming critical policies against production. Resource-based policy simulation runs through the CLI or API rather than the console custom mode, applies to IAM users and not roles, and needs the resource and its policy included in the request. Cross-account access can be simulated through the API or CLI, which returns a decision per policy type, but not in the console. Resource control policies are outside what it models.

From one decision to the whole path

The simulator is precise about a single authorization decision. A privilege escalation or lateral-movement path is a sequence of decisions: this principal can create a function, pass this role, assume that role in another account, and reach administrator. To test a path with the simulator you would have to know the chain in advance, supply each policy, and simulate each hop, including the cross-account hops through the API. Each hop looks fine in isolation. The chain across them is what reaches administrator or data.

allow / denyone hopa single decisionadmin?Administrator
The policy simulator confirms each single decision: can this principal create a function, can it pass this role. Whether those decisions chain across principals and accounts into a route to administrator is a different question, one you would assemble hop by hop.

Building and resolving those chains is what Pathbreak does. It reads your AWS configuration with a read-only role, builds a graph of principals, roles, trust edges and resources, then an agent chains control-plane moves into candidate attack paths. It validates each path end to end against the authorization that applies, including identity and resource policies, permission boundaries, service control policies and trust policies, so the list is the paths that resolve rather than every path that might. Paths are ranked by how many of them each fix breaks, and each one comes with the single change that removes the most risk and the command to apply it. A rescan confirms the path is gone. Nothing is executed in your account.

Pathbreak does not replace the policy simulator. The simulator is the right tool for confirming a specific allow or deny and for testing a policy in CI. Pathbreak answers the question that spans many of those decisions: which chains across your accounts reach administrator or data.

How to use them together on AWS today

  1. Use the policy simulator to confirm specific allow and deny decisions, and wire simulate-custom-policy into CI to test a policy change before it is attached.
  2. For the cases it does not model, such as resource control policies, confirm against your live environment.
  3. Run pathbreak-audit, a free read-only CLI, to list the principals in one account that hold abusable permissions and toxic combinations. Install it with pip install pathbreak-audit.
  4. Validate the chains with Pathbreak on one account to see which paths reach admin or data, ranked by blast radius, with the one change that breaks the most.

For a reference of the specific AWS permissions attackers chain and the change that breaks each one, see the AWS privilege escalation map.

Frequently asked questions

What does the IAM policy simulator do?

The IAM policy simulator answers whether a specific principal is allowed or denied a specific action on a specific resource, and which policy statement decided it. It evaluates the policies without making the real API call, so it is safe to run. You use it from the IAM console or through the SimulatePrincipalPolicy and SimulateCustomPolicy APIs.

What is the difference between SimulatePrincipalPolicy and SimulateCustomPolicy?

SimulatePrincipalPolicy evaluates the policies already attached to an existing IAM user, group or role that you name. SimulateCustomPolicy evaluates policy documents you pass in directly, which lets you test a policy before it is attached to anyone. Both return an allow or deny decision per action with the matching statements.

Does the policy simulator support resource-based policies and cross-account access?

Partly. Resource-based policies can be simulated through the CLI or API, for IAM users and not roles, with the resource and its policy included. Cross-account access can also be simulated through the API or CLI, which returns a decision per policy type, though not in the console. The simulator does not support resource control policies, so confirm those against your live environment.

Is the policy simulator accurate?

It is accurate for the inputs you give it, and AWS warns that results can differ from your live environment, so it recommends checking critical policies against production. Accuracy also depends on the condition-key values you supply, since some keys are filled in automatically and the rest come from you. It answers one authorization decision at a time.

How do I test privilege escalation paths in AWS?

The policy simulator checks a single decision, so testing a chain means knowing the chain in advance and simulating each hop, supplying each policy, including across accounts through the API. Pathbreak builds the chains for you: it resolves the authorization across principals and accounts, validates which paths reach admin or data, and ranks the single change that breaks the most. Run pathbreak-audit, a free CLI, for a first read in one account.

Related posts

See which over-permissioned identities in your AWS accounts reach admin or data, and the one change that closes each path.

Request a demo Watch the demo