AWS IAM Policy Linter & Explainer API
Lint and explain AWS IAM policies: expand wildcards to real actions, check ARNs and condition keys, flag admin, PassRole and privilege-escalation risks.
Send an identity-based policy, a resource-based policy (S3 bucket, KMS, SQS…), a role trust policy or an SCP (detected, or set type). The catalogue of ~460 services and ~22,500 actions with their access levels, resource types (ARN formats) and condition keys comes from the AWS Service Authorization Reference and is refreshed weekly. Nothing is sent to AWS and no credentials are needed.
Lint (action=lint, also part of the default analyze): grammar (Version, Effect, Action / NotAction, Resource / NotResource, Principal by policy type, Sid), unknown services and actions with "did you mean", wildcards that match nothing, ARN syntax, actions whose resource type does not match any Resource (classic: s3:GetObject on arn:aws:s3:::bucket without /*), actions that only work with Resource "*", condition operators, unknown or unsupported condition keys, value types, ForAllValues with Allow, * admin grants, service wildcards, Allow + NotAction / NotResource, iam:PassRole on "*", 27 known privilege-escalation paths, public principals and federated trust without conditions, size limits.
Explain (action=explain) lists every statement with the expanded actions and their access level (List / Read / Write / Permissions management / Tagging), resources, principals and conditions, plus a per-service summary. action=minimize rewrites Allow statements to explicit actions filtered by access_levels (e.g. list,read) and / or actions_used (from CloudTrail or IAM Access Analyzer).
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
policy | body | object | yes | Policy JSON (object or string; max 200 KB). | |
action | body|query | string | no | analyze | analyze (lint + explain), lint, explain or minimize (alias mode). |
type | body|query | string | no | identity, resource, trust or scp (default: detected). | |
max_actions | body|query | number | no | 200 | Expanded actions listed per statement. |
access_levels | body|query | string | no | minimize: keep only these levels, e.g. list,read. | |
actions_used | body | array | no | minimize: actions actually used (e.g. from CloudTrail). |
Example
curl -X POST "https://apibox.io.vn/v1/iam-policy" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"lint","policy":{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["s3:GetObject","s3:ListBucket"],"Resource":"arn:aws:s3:::my-bucket"},{"Effect":"Allow","Action":"iam:PassRole","Resource":"*"}]}}'const res = await fetch('https://apibox.io.vn/v1/iam-policy', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"action": "lint",
"policy": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::my-bucket"
},
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "*"
}
]
}
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/iam-policy",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"action": "lint", "policy": {"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Action": ["s3:GetObject", "s3:ListBucket"], "Resource": "arn:aws:s3:::my-bucket"}, {"Effect": "Allow", "Action": "iam:PassRole", "Resource": "*"}]}},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/iam-policy');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"action":"lint","policy":{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["s3:GetObject","s3:ListBucket"],"Resource":"arn:aws:s3:::my-bucket"},{"Effect":"Allow","Action":"iam:PassRole","Resource":"*"}]}}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"valid": true,
"errors": 0,
"warnings": 2,
"info": 0,
"summary": {
"type": "identity",
"statements": 2,
"allow_all": false,
"allowed_actions": 3,
"services": {
"iam": {
"Write": 1
},
"s3": {
"List": 1,
"Read": 1
}
}
},
"findings": [
{
"rule": "resource-mismatch",
"severity": "warning",
"message": "No Resource of this statement matches the resource types of s3:GetObject (object actions need arn:aws:s3:::bucket/*, bucket actions arn:aws:s3:::bucket): this action is never granted",
"statement": 0
},
{
"rule": "passrole-wildcard",
"severity": "warning",
"message": "iam:PassRole on Resource \"*\": the principal can hand any role (incl. admin roles) to a service; restrict Resource to specific role ARNs and add an iam:PassedToService condition",
"statement": 1
}
],
"source": {
"name": "AWS Service Authorization Reference (servicereference.us-east-1.amazonaws.com)",
"licence": "CC BY-SA 4.0 (AWS documentation)",
"url": "https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html"
},
"data_built": "2026-11-16"
}
Use cases
- Review IAM policies in Terraform / CloudFormation pull requests
- See what s3:Get* or ec2:Describe* really grants before approving it
- Turn a wildcard policy into a read-only least-privilege policy
- Audit customer accounts for public trust policies and escalation paths
FAQ
Does it call AWS?
No. Analysis is offline against the published Service Authorization Reference; send only the policy JSON.
Is the action list current?
It is rebuilt weekly from AWS’s machine-readable reference; data_built in the answer shows the date.
Is the effective-permission result exact?
It is an approximation: only unconditional Deny statements on "*" are subtracted, and permission boundaries / SCPs of the account are not known.
Related APIs
Hash Generator
Compute MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 of text or files in one call, as hex or base64, with optional HMAC signing.
B64Encode / Decode
Encode or decode text as Base64, Base64URL, hex, URL encoding, HTML entities, Unicode escapes, ROT13 or binary with one simple API call.
***Password Generator
Generate cryptographically secure random passwords (4–256 chars, up to 100 at once) or check a password’s strength, entropy and estimated crack time.