Cloud IAM explained: roles, policies and the principle of least privilege
Identity and access management (IAM) decides who or what can do which actions on which resources. It's also where many serious cloud security incidents start.
Core concepts
- Principals: users, groups and machine identities (service accounts, roles assumed by servers or functions).
- Permissions / actions: specific operations, like reading an object or deleting a database.
- Policies: documents that grant or deny actions on resources, sometimes with conditions (time, IP, tags).
- Roles: bundles of permissions that a principal can assume, often temporarily.
Least privilege
Grant only the permissions needed for the job, on only the resources involved. A function that reads one bucket shouldn't be able to delete every bucket in the account.
Practical habits
- Prefer roles and short-lived credentials over long-lived access keys.
- Give workloads their own identities instead of sharing one powerful account.
- Avoid wildcard permissions in production policies.
- Use separate accounts or projects for dev and prod.
- Review unused permissions; most providers offer tools that show what a role actually used.
- Protect the root/owner account with strong MFA and don't use it day to day.
Why it's hard
Getting least privilege exactly right is tedious, so teams start broad "for now." Tightening later is where intentions often stall.
How do you approach permission design: start strict and loosen, or start broad and tighten? Any tooling that made it manageable?
Comments · 3
What does "least privilege" look like in practice for a small project? I tend to give things admin access just to make errors go away.
We learned the hard way. An over-permissioned key leaked and the blast radius was everything. Scoping credentials per service is boring work that pays off.
Rule of thumb: start with no access, add only what the error message says you need, and review it every few months.