The principle of least privilege (PoLP) says that every person, application and process should have only the access it needs to do its job, and no more. NIST’s glossary defines it as granting each entity the minimum system resources and authorizations needed to perform its function. It is one of the oldest ideas in security and one of the most consistently under-applied.
The principle sounds simple. The difficulty is that “the access it needs” has two dimensions that most programs only address one of. Scope is how much an identity can reach. Time is how long it can reach it. A role scoped to one S3 bucket is better than a role scoped to every bucket. A role that exists only for the hour in which it is used is better than one that exists forever. A strong least-privilege program controls both.
This guide explains what least privilege means in practice, why access drifts away from it, how to measure the gap, and how to close it. It also covers the related ideas that people often confuse with it, such as zero trust, role-based access control and just-in-time access.
What least privilege covers
Least privilege applies to every kind of identity:
- Human users, such as engineers, analysts, support staff and administrators
- Non-human identities, such as service accounts, pipelines, serverless functions and service principals. See understanding non-human identities.
- AI agents and coding assistants, which act with the permissions you hand them. See agentic AI access control.
- Third parties, such as vendors, contractors and integrations
And it applies to every surface where access exists: cloud consoles and APIs, databases, servers, Kubernetes clusters, SaaS applications and CI/CD pipelines.
Why it matters
Most cloud breaches do not require an exploit. They need a valid credential and enough permission to do damage. When an attacker steals a login, the blast radius of the breach is whatever that identity could do. See credential theft and blast radius.
Least privilege limits that blast radius in three ways:
- It shrinks the prize. A stolen credential for a narrowly scoped role can reach little.
- It slows the attacker. Reaching sensitive data takes more steps, and each step is a chance to be detected. See lateral movement in the cloud.
- It limits mistakes. A person who cannot delete a production table cannot delete it by accident.
It is also an explicit requirement in many frameworks. NIST SP 800-53 includes a control (AC-6) for least privilege, and audit standards such as SOC 2, ISO 27001 and PCI DSS expect you to show that access is limited and reviewed.
Why access drifts away from least privilege
Almost nobody starts with excess access. It builds up over time for predictable reasons.
- Broad grants are faster. Giving a team
AdministratorAccesstakes a minute. Working out the exact permissions it needs takes hours. - Temporary becomes permanent. Access is granted for a project or a debugging session, and nobody removes it. See orphaned credentials.
- Roles accumulate. People change jobs and keep the access from the old one.
- Inheritance hides excess. In the cloud, access comes from groups, roles, trust policies and resource policies. Nobody sees the total.
- Unused permissions look harmless. A permission that has never been used feels free to keep, until it is the one that an attacker uses.
- Automation is over-trusted. Pipelines and service accounts often hold broad, long-lived permissions because nobody is reviewing them.
Industry research on cloud identities repeatedly finds that a large majority of granted permissions are never used. The exact figure varies by study, so measure your own environment instead of relying on a quoted number.
Scope and time: the two dimensions
Scope: how much can the identity do?
- Actions. Allow the specific API calls needed (
s3:GetObject), not a wildcard (s3:*). - Resources. Limit to the specific bucket, table, cluster or account, not “all.”
- Conditions. Add restrictions such as source network, required MFA, or time of day.
- Boundaries. Use permission boundaries or organization-level policies as a ceiling that no one can exceed. See AWS IAM permission boundaries.
Time: how long can the identity do it?
This is the dimension most programs miss. A permission that is correctly scoped but always on is still available to anyone who steals the credential at 2 a.m.
- Standing access exists whether or not it is being used.
- Just-in-time access is requested for a reason, approved, valid for a limited window and then revoked. See just-in-time access.
- Zero standing privilege is the goal state in which no one holds elevated access when they are not actively using it. See zero standing privilege.
Think of scope as the width of the door and time as how long it stays open. Least privilege means a narrow door that opens only when needed.
Related concepts, and how they differ
| Concept | What it is | Relationship to least privilege |
|---|---|---|
| Role-based access control (RBAC) | Grants permissions through roles assigned to people | A way to implement least privilege. It does not guarantee it, because roles are often too broad. |
| Zero trust | Never trust by default, always verify | A wider strategy. Least privilege is one of its pillars. See zero trust security. |
| Zero standing privilege | No always-on elevated access | Least privilege applied to the time dimension. |
| Privileged access management (PAM) | Controls and records use of high-risk accounts | A control family that enforces least privilege for the most powerful identities. See understanding PAM. |
| CIEM | Discovers and right-sizes cloud entitlements | The measurement and cleanup tool. See CIEM. |
| Separation of duties | No single person can complete a sensitive process alone | A complement. It limits combinations of access, not the amount. |
How to apply least privilege: a step-by-step approach
Step 1: Inventory identities and what they can do
List every human, service account, role, key and third-party integration across your clouds. For each, record what it can do and who owns it. In AWS, start with the IAM credential report:
aws iam generate-credential-report
aws iam get-credential-report --query Content --output text | base64 -d | cut -d, -f1,4,5,9,11,14,16
You will usually find identities nobody remembers creating.
Step 2: Find what is unused
AWS shows when each service was last accessed for a role or user. The same idea applies elsewhere.
# Start a last-accessed report for a role, then read it
JOB=$(aws iam generate-service-last-accessed-details --arn arn:aws:iam::123456789012:role/app-role --query JobId --output text)
aws iam get-service-last-accessed-details --job-id "$JOB" \
--query 'ServicesLastAccessed[?LastAuthenticated==`null`].ServiceNamespace'
Services that appear with no recent access are candidates to remove from the policy.
Step 3: Tighten scope, starting with the riskiest
Prioritize identities that are administrators, reach production, reach sensitive data, or are internet-facing. Replace wildcards with specific actions and resources, and remove permissions that were never used. Test changes in a lower environment first.
Step 4: Replace standing human access with time-boxed access
For high-impact access, such as production consoles, databases and Kubernetes clusters, move from permanent grants to requests that carry a reason, an approver and an end time. Match approvals to risk: auto-approve read-only, require an approver for staging, require more than one for production administration.
Step 5: Shorten the life of machine credentials
Replace long-lived keys with roles and short-lived tokens. For pipelines and AI agents, give a credential that exists for the task and then disappears. See secret rotation.
Step 6: Review on a schedule, and automate where possible
Access reviews are an audit requirement, and they are also where drift is caught. Quarterly review of everything is slow and tends to be rubber-stamped, so combine it with automated detection of unused and over-broad permissions.
Step 7: Monitor use, not just grants
Alert on privilege changes, new keys, and identities acting unlike themselves. Least privilege defines what should happen. Monitoring tells you when something else does. See cloud UEBA.
Common mistakes
- Treating a role rename as a review. Check the permissions inside the role, not its name.
- Only reviewing humans. Machine identities usually outnumber people and are reviewed less.
- Cutting access without a safety net. Remove permissions in stages, with logging, so you find the dependency before it breaks production.
- Forgetting third parties. Vendor and contractor access is often the broadest and least reviewed.
- Equating least privilege with friction. If getting access is slow, people will route around it. Make the safe path the fast one.
How Cloudanix helps
Cloudanix addresses both dimensions, scope and time, across clouds and access surfaces.
- Measuring scope. CIEM shows which identities across AWS, Azure and GCP hold powerful, unused or excessive permissions and what they could reach. Findings are ranked by exposure, environment, data sensitivity and identity with contextual severity. See CIEM for multi-account AWS.
- Controlling time. Cloud JIT, Database JIT, VM JIT, Kubernetes JIT and SaaS JIT replace standing access with a request, approve, time-boxed grant, auto-revoke lifecycle. Agentic JIT and Coding Agent JIT apply the same model to pipelines and AI agents. Approvals are configurable by risk, and every request, approval and revocation is logged with the real human identity to storage you own.
- Closing the loop. Over-privileged identities that CSPM and CIEM flag can feed into JIT policy, so the finding and the fix are connected. For a worked case, see correlating identity with misconfigurations and the least-privilege use case.
The honest limit: Cloudanix does not decide what your roles should be. You still define policy and approval rules. What it removes is the manual work of finding the excess and the standing access that keeps it dangerous.
Further reading
- NIST glossary: least privilege
- AWS: IAM security best practices
- MITRE ATT&CK: Valid Accounts, Cloud Accounts
Frequently asked questions
What is the principle of least privilege?
It is the rule that every identity should hold only the permissions it needs to do its job, for only as long as it needs them.
What is the difference between least privilege and zero standing privilege?
Least privilege covers both how much access an identity has and how long it has it. Zero standing privilege is the time-based end state, in which no one holds elevated access when not actively using it.
Is least privilege the same as role-based access control?
No. RBAC is a way to assign permissions through roles. It can support least privilege, but a role that is too broad still violates it.
How do I find excess permissions in AWS?
Use the IAM credential report for keys and users, and the service last accessed data for roles and users to see which permissions are unused. A CIEM tool automates this across accounts and clouds.
Does least privilege slow engineers down?
It can if it is implemented as manual tickets. Auto-approving low-risk requests and delivering access through tools engineers already use, such as Slack and single sign-on, keeps the safe path fast.