Skip to content
Least Privilege Principle

Ten least privilege examples, each shown as a before and an after permission

Ten concrete cloud examples of least privilege, four on AWS, three on Azure and three on Google Cloud, each with the permission before, the permission after and the provider documentation that supports it. The examples are illustrative configurations, and the cited pages were read on 16 Nov 2026.

Open the calculator ยท The field guide

The ten examples at a glance

The before column is a common starting grant. The after column is the narrower form the cited page supports. Names such as example-bucket are placeholders. Check each change against your own usage first, with the steps in the first 90 days.

#CloudBeforeAfterDocumentation
1AWSAction s3:* on Resource *s3:GetObject on one bucket prefixIAM best practices
2AWSAdministratorAccess on a developer roleA job function managed policy such as Developer power userJob function policies
3AWSIAM user with a long-term access key in a pipelineIAM role with temporary credentialsIAM best practices
4AWSLambda execution role with broad managed policyPolicy limited to the function's own actions and resourcesLambda execution role
5AzureOwner at subscription scopeA narrower role at resource group scopeAzure RBAC best practices
6AzurePermanent privileged assignmentTime-bound eligible assignment in PIMPrivileged Identity Management
7AzureBlob read granted on the whole storage accountRead granted with a condition on a blob tagAzure ABAC
8Google Cloudroles/editor on a projectPredefined roles for the services usedUsing IAM securely
9Google CloudDefault service account with Editor on the projectA dedicated service account per applicationService account practices
10Google CloudService account key stored outside Google CloudWorkload identity federationWorkload identity federation

AWS examples narrow actions, resources and credentials

Example 1 follows AWS's advice to define the actions allowed on specific resources under specific conditions. A policy that allows s3:* on every resource lets the identity read, write and delete in any bucket. Replacing it with s3:GetObject on arn:aws:s3:::example-bucket/reports/* limits the identity to reading one set of objects.

Example 2 swaps a full administrator policy for a job function policy, which AWS says aligns to common roles and carries filters that limit access. Example 3 removes a long-term key: AWS says workloads outside AWS can still use temporary credentials, which removes a secret that can leak. Example 4 follows the Lambda guidance to adjust the execution role before production, since permissions granted beyond what is required during development are common.

Azure examples narrow scope, time and data

Example 5 applies Microsoft's advice that, if a privileged administrator role must be assigned, a narrow scope such as a resource group or resource is better than a management group or subscription. Microsoft also suggests no more than three subscription owners. Example 6 replaces a standing assignment with one that is eligible, so the person activates it for a time-bound period and the access ends on its own.

Example 7 uses a role assignment condition. Microsoft's own illustration is read access to blobs only if the blobs are tagged with a given project. It filters the permissions the role grants, so the assignment can stay at a wider scope while the effect is narrow. See least privilege access control for how conditions fit with roles.

Google Cloud examples remove broad roles and keys

Example 8 follows Google's guidance that basic roles include thousands of permissions across all services, and that role recommendations plus Policy Simulator can be used to decide which roles to grant instead and to confirm the change will not affect access. Example 9 addresses a default: Google says certain services create a default service account with the Editor role on the project, and recommends dedicated service accounts for each application.

Example 10 removes the key altogether. Google says to avoid service account keys whenever possible, and workload identity federation lets an external workload use short-lived credentials instead. Each of the ten changes narrows one of the four properties on least privilege access: action, resource, condition or time. The provider-by-provider view is on IAM least privilege.

Two cautions apply to all ten. First, a narrower permission can break a job that runs rarely, so check the usage window before each change, as described on privilege creep. Second, the after column is a target, not a template: replace the placeholder bucket, role and project names with your own, and test the result in a non-production account before it reaches production.

Sources

  1. AWS, security best practices in IAM, read 16 Nov 2026
  2. AWS, managed policies for job functions, read 16 Nov 2026
  3. AWS Lambda, execution role, read 16 Nov 2026
  4. Microsoft, best practices for Azure RBAC, read 16 Nov 2026
  5. Microsoft, what is Privileged Identity Management, read 16 Nov 2026
  6. Microsoft, what is Azure attribute-based access control, read 16 Nov 2026
  7. Google Cloud, using IAM securely, read 16 Nov 2026
  8. Google Cloud, best practices for service accounts, read 16 Nov 2026
  9. Google Cloud, workload identity federation, read 16 Nov 2026

Last reviewed 16 Nov 2026.