Privacy and Security

How to Review a Cloud IAM Policy for Least Privilege

Review AWS, Google Cloud and Azure permissions step by step: wildcards, public access, escalation paths and a least-privilege policy built from logs.

Saizul Amin
Saizul Amin3 Nov 2026 · 4 min read
How to Review a Cloud IAM Policy for Least Privilege

How to Review a Cloud IAM Policy for Least Privilege

Most cloud breaches involve permissions that were wider than they needed to be. A developer attaches s3:* to unblock a deployment, a contractor gets the Editor role on a project, and months later a leaked key turns into full access. Reviewing identity and access policies is tedious because the JSON hides how much each line grants. This guide walks through a repeatable review for AWS, Google Cloud and Azure.

Collect the right document

Review the actual JSON, not a console summary. In AWS that is the policy document, inline or managed, plus any resource policy such as a bucket policy. In Google Cloud, a custom role lists includedPermissions, and the IAM policy of a project or resource lists bindings of roles to members. In Azure, a custom role definition lists Actions, NotActions, DataActions and AssignableScopes.

Step 1: find the obvious over-grants

Look for these first, because they are the most common and the most serious.

  • Action * on Resource * in AWS, which is full administrator access.
  • Service wildcards such as s3:, iam: or kms:*. Wildcards over identity and key services are the most dangerous.
  • Allow statements that use NotAction or NotResource. They grant everything except a list, including services AWS adds next year.
  • Write actions on Resource *. Even a narrow list of actions becomes wide when it applies to every bucket or table.
  • Basic roles in Google Cloud: Owner and Editor carry thousands of permissions.
  • Actions * or provider wildcards in Azure, and roles assignable at the root scope.

Step 2: check for public access

Resource policies can grant access to everyone. In AWS, Principal * without a restricting condition means anyone on the internet. In Google Cloud, allUsers means anonymous access and allAuthenticatedUsers means any Google account in the world, which is not the same as your company. These findings deserve immediate attention unless the resource is deliberately public, like a website's static assets.

Step 3: look for escalation paths

Some permissions let a holder grant themselves more. Researchers have documented many in AWS: creating a new policy version, attaching a managed policy to your own user, writing inline policies, creating access keys for another user, changing a role's trust policy, and passing a role to a service that runs code, such as iam:PassRole with lambda:CreateFunction or ec2:RunInstances. In Google Cloud, iam.serviceAccounts.actAs, token creation and setIamPolicy are the usual suspects. In Azure, roleAssignments/write, VM run command and storage key listing. A policy that looks limited can be effectively administrative because of one of these.

Step 4: build least privilege from evidence

Guessing which actions a workload needs leads to either breakage or over-grants. Use evidence instead: CloudTrail events or IAM Access Advisor in AWS, the IAM recommender and audit logs in Google Cloud, activity logs in Azure. List the actions actually called over a representative period, including monthly jobs, and build the policy from that list. Keep resource ARNs and conditions as narrow as possible.

Using the analyzer

The Cloud IAM Policy Analyzer automates the first three steps and helps with the fourth. Paste any of the four supported JSON shapes and it explains every permission with its service and an access level read from the verb, flags wildcards, NotAction allows, public principals and known escalation permissions, and gives the document a simple risk grade. On the least-privilege tab, paste the observed actions, in service:Action form or straight from CloudTrail as eventSource and eventName, and it writes a trimmed policy or role that keeps only those actions, together with a list of observed actions the current policy does not allow. It never contacts your cloud account and needs no credentials.

Step 5: test before you switch

Attach the new policy to a test role first, run the workload, and watch for access-denied errors. In AWS, the IAM policy simulator helps; in all three clouds, logs will show denied calls. Only then replace the old policy.

Keep the scope in mind

One document is rarely the whole story. Service control policies, permission boundaries, organization policies, group memberships and resource policies all change effective access. A clean result for one policy is a good sign, not a guarantee. Review regularly, especially after incidents and team changes.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages