Cloud IAM
Control who and what can do what in the cloud using roles, policies, least privilege and short-lived credentials.
Intermediate · about 8 hours · difficulty 3/5
Learn first: Shared Responsibility in the Cloud, Authorization and Least Privilege
In the cloud, identity is the perimeter. Anyone holding valid credentials with broad permissions can reach your data from anywhere, so cloud IAM is the most important control you configure.
Core concepts (AWS names, others are similar)
- Principals: users, groups, roles and service identities.
- Policies: JSON documents that allow or deny actions on resources under conditions.
- Roles provide temporary credentials and should be the default for workloads and humans alike.
- Azure uses Entra ID plus role-based access control at scopes; Google Cloud uses IAM roles bound at organisation, folder and project levels.
Good practices
- Protect the root / global admin account: hardware MFA, no access keys, used almost never.
- Humans sign in through SSO with MFA and assume roles; avoid long-lived IAM user keys.
- Workloads use instance roles, managed identities or workload identity, not embedded keys.
- Least privilege: start from managed job-function roles, then narrow with tools like IAM Access Analyzer that suggest policies from actual usage.
- Use conditions (source network, MFA present, tags) to tighten access.
- Review permissions regularly and remove unused roles and keys.
Pitfalls
- Wildcards like
"Action": "*"with"Resource": "*"on everyday roles. - Access keys for people who left months ago.
- Overlooking cross-account trust policies that let external accounts assume your roles.
Move on when you can write a least-privilege policy for a function that reads one bucket, set up SSO-based role access in a free-tier account and explain every statement.
Key concepts
- Principals, policies, roles
- Policy evaluation and explicit deny
- Root account protection
- SSO and role assumption
- Workload identities
- Least privilege with Access Analyzer
- Azure RBAC and GCP IAM equivalents
- Cross-account trust
Mini project
In a free-tier AWS account, lock down root with MFA, create an SSO or IAM Identity Center user, and write a least-privilege role for a Lambda that reads one S3 prefix; test that other actions are denied.
Check yourself
Why are IAM roles with temporary credentials safer than long-lived access keys?
Free resources
- Security best practices in IAM (AWS)
- Azure role-based access control (Microsoft Learn)
- IAM overview (Google Cloud)