Services

Resources

Company

/

Least privilege

Least privilege

Least privilege is the security principle that every user, program and service should run with the smallest set of permissions it needs to do its job, for only as long as it needs them. A reporting job that reads one bucket should not be able to delete it.

How it works

In the cloud this means scoping identity and access management (IAM) policies by action and resource. Compare two grants for the same job:

  • Broad: s3:* on *, which can read, write and delete every bucket in the account.

  • Least privilege: s3:GetObject on arn:aws:s3:::reports-prod/*, which can only read objects in one bucket.

Short-lived credentials, separate roles per service, and access reviews keep the grant small over time. Unused permissions are found from access logs and removed.

Why it matters in production

Permissions decide the blast radius of a mistake or a leaked key. A stolen key that can only read one bucket is an incident. A stolen admin key can become the whole company's outage. Least privilege also makes audits shorter, because each role has a clear purpose.

See also

On the One2N blog

Further reading

Table comparing two IAM grants for the same job. The broad grant s3:* on * can read, write and delete, reaches all six buckets, and if the key leaks the damage, shown in red, is the whole account. The least privilege grant s3:GetObject on reports-prod/* can only read, reaches one of the six buckets, and a leaked key exposes one bucket, read only.

Putting this into practice?

Talk to One2N about our DevSecOps services

Talk to One2N about our DevSecOps services