Generate least-privilege IAM policies for S3, DynamoDB, Secrets Manager, SQS and role trust, each narrowed to a resource you name rather than a wildcard.
S3 read · 23 lines
The inspector finds nothing wrong with this, which is the intended result.
List a bucket and read the objects in it.
Every template here is narrowed to a resource you name, because "Resource": "*" is what most examples give you and it grants the action across every bucket, table or secret in the account. The S3 templates go further and split bucket-level actions from object-level ones, because s3:ListBucket acts on the bucket ARN while s3:GetObject acts on the object ARN — one statement covering both with a single resource silently fails one of them.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRead",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::example-bucket"
},
{
"Sid": "AllowRead",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::example-bucket/*"
}
]
}
What the inspector says about this
Nothing — no wildcards, no escalation path, every statement identified.
These are least-privilege starting points, not an authorisation design. What a principal can actually do depends on every other policy attached to it, on service control policies, permission boundaries and any resource policy at the other end — none of which this knows about. Nothing is applied: no AWS account is contacted, no credentials are needed or accepted, and the IAM policy simulator is where you check what a policy really permits.
IAM Policy Generator runs entirely on your device — no AWS account is contacted and no credentials are needed or accepted.
You’re on the Free plan. Compare plans
Every template names its resource rather than using a wildcard. That is the whole design: a generator whose default output would trip its own inspector is teaching the wrong lesson, and `"Resource": "*"` is what most policy examples give you.
The S3 templates go further and split bucket-level actions from object-level ones, because `s3:ListBucket` acts on the bucket ARN while `s3:GetObject` acts on the object ARN. One statement covering both with a single resource silently fails one of them, which is a confusing way to spend an hour.
The trust policy includes a confused-deputy guard — an `aws:SourceAccount` condition. Without it, any account that can persuade the service to act on its behalf can assume the role. That condition is almost always omitted from examples and is almost always wanted.
The Secrets Manager template uses the `secret:name-*` suffix wildcard, because Secrets Manager appends six random characters to every secret's ARN. A policy naming the exact ARN works until the secret is recreated, at which point it silently matches nothing.
Each generated policy is run back through the IAM policy inspector on the page, so you see what its sibling tool says before pasting it anywhere. Nothing is applied: no AWS account is contacted and no credentials are needed or accepted.
Because `s3:ListBucket` acts on the bucket ARN and `s3:GetObject` acts on the object ARN — they are different resources. A single statement with one resource grants one of them and silently refuses the other, which presents as an access-denied that looks like a permissions bug somewhere else.
It is a confused-deputy guard. A service principal like `lambda.amazonaws.com` acts on behalf of whoever asked it to, so without that condition any account able to invoke the service can assume your role. Most trust policy examples leave it out.
Secrets Manager appends six random characters to every secret's ARN, and they change when a secret is recreated. `secret:my-secret-*` keeps working; the exact ARN silently stops matching after a recreate.
It is a least-privilege starting point, not an authorisation design. What a principal can actually do depends on everything else attached to it and on any resource policy at the other end. The IAM policy simulator is where you check what it really permits.