The principle of least privilege states that every user, service account and process should have only the permissions required for its task, for no longer than necessary. It limits the damage of mistakes, compromised credentials and malicious insiders, because a single account cannot reach everything. Least privilege is implemented with roles, scoped permissions, time-limited access and regular reviews, and it is a core element of zero trust.
What is least privilege?
The principle of least privilege (PoLP) is one of the oldest ideas in computer security. Jerome Saltzer and Michael Schroeder listed it in 1975 among their design principles for protecting information: every program and every user should operate with the smallest set of privileges necessary to complete the job. The idea applies at every level, from human accounts and cloud IAM roles to database users, Kubernetes service accounts and operating system processes.
The reasoning is simple. Attackers rarely need a zero-day vulnerability; they use the access that already exists. A stolen API key with administrator rights is a far bigger problem than one that can only read a single bucket. MITRE ATT&CK reflects this with techniques such as Valid Accounts (T1078) and Abuse Elevation Control Mechanism (T1548).
Why least privilege matters
- Smaller blast radius: a compromised account or workload can only reach what it was allowed to reach.
- Fewer accidents: an engineer without delete rights in production cannot drop the wrong table by mistake.
- Clearer accountability: narrow, personal permissions make audit logs meaningful, because each action maps to a specific identity and purpose.
- Compliance: many frameworks and audits ask for evidence that access is restricted and reviewed.
How to implement least privilege
- Role-based access control (RBAC): define roles per job function, assign permissions to roles and people to roles, instead of granting rights one by one.
- Scoped permissions: limit actions and resources, for example read-only access to one namespace rather than cluster-wide rights.
- Just-in-time access: grant elevated rights only for a limited time and with an approval, instead of permanent administrator accounts.
- Separate identities: one service account or API key per application or script, so access can be revoked precisely.
- Least privilege in code: define IAM policies and roles in infrastructure as code so they can be reviewed like any other change.
- Regular reviews: remove unused accounts, roles and keys. Permissions tend to grow over time, a pattern known as privilege creep.
A Kubernetes Role that only allows reading pods in one namespace is a typical example:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: checkout
name: pod-reader
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
Common violations
- Wildcard permissions such as
"Action": "*"or"Resource": "*"in cloud IAM policies. - Applications that connect to the database as the owner or superuser instead of a restricted user.
- Containers that run as root or with privileged mode without a clear need.
- Shared administrator accounts and long-lived keys that nobody owns.
- Emergency access granted during an incident and never removed afterwards, which becomes a form of configuration drift.
Detecting privilege misuse
Least privilege reduces risk, but it does not remove it. Teams also need to see when privileges change or are abused. Useful signals include new privileged accounts or role assignments, use of sudo or other elevation mechanisms by unusual users, access to resources an identity has never touched before, and changes to IAM policies outside the usual deployment process. Collected in a SIEM or log analytics platform, these events can be correlated and, if confirmed, treated as indicators of compromise. Least privilege is also a building block of zero trust, where every request is verified and only the minimum access is granted.
The observability perspective
Permissions and operations are closely linked. A role that is too narrow produces access denied errors that look like an application bug, and a role that is too broad stays invisible until it is misused. Observability helps in both directions: error rates and logs show which calls fail due to missing permissions, and audit and authentication logs show which permissions are actually used. That evidence makes it much easier to remove rights that nobody needs without breaking production.
How Obseria helps
Obseria helps you see whether least privilege holds; it does not manage or enforce permissions in your systems. Cloud security posture management checks AWS, Azure and Google Cloud accounts for misconfigurations such as overly broad access rights, and IaC security reviews Terraform and Kubernetes manifests before deployment. Workload threat detection flags privilege escalation via sudo and new privileged accounts on hosts, detection only. Within Obseria, roles, permissions and API keys let you give each person and script only the access it needs, and the audit trail shows who did what, including refused requests.