Docs / Check a policy

Check a policy

Check an IAM policy, CloudFormation template or Terraform plan with AccessLens's rules before you deploy it, offline, and see the trust it would add.

Updated

Check a policy runs AccessLens's policy and trust rules on something you haven't deployed yet. Everything happens on your computer: nothing is sent to AWS.

What you can check

Paste JSON into the page:

InputWhat's checked
An IAM policy documentAs an identity policy attached to a role, or, if it has a Principal and allows sts:AssumeRole, as a role trust policy
A CloudFormation template, in JSONAWS::IAM::Role, AWS::IAM::User, AWS::IAM::Policy, AWS::IAM::ManagedPolicy, AWS::IAM::RolePolicy and AWS::IAM::UserPolicy, including policies attached with Ref
A Terraform plan, from terraform show -json plan.outaws_iam_role, aws_iam_role_policy, aws_iam_policy, aws_iam_user, aws_iam_user_policy and the policy attachments, in child modules too

For a CloudFormation template in YAML, convert it to JSON first, for example with cfn-flip. Groups, resource-based policies other than role trust policies, and Terraform values only known after apply aren't checked yet; the result says when something was skipped.

What you get

The findings a scan would raise for those roles, users and policies: wildcard and NotAction grants, AWS-managed admin attachments, broad inline policies, the privilege-escalation methods, and trust-policy rules such as trusting *, cross-account trusts without an ExternalId and loose OIDC or SAML trusts. Each comes with its severity, description and remediation.

Compare with a scanned account

Choose an account to check against. AccessLens then uses that account's ID, organization and service control policies, merges the change into the account's latest scan, and lists the new trust relationships it would add, such as a role a new principal could assume. Roles and users with the same name as existing ones are treated as replacements.

Checking makes no AWS calls, so it doesn't need the account's role to be set up beyond the scan you already have.