# Cloud IAM

> Control who and what can do what in the cloud using roles, policies, least privilege and short-lived credentials. Free notes, key concepts, resources and a...

Canonical: https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-iam
Last updated: 2026-11-28

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](https://www.internhack.in/roadmaps/tracks/cybersecurity/shared-responsibility), [Authorization and Least Privilege](https://www.internhack.in/roadmaps/tracks/cybersecurity/access-control-models)

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](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) (AWS)
- [Azure role-based access control](https://learn.microsoft.com/en-us/azure/role-based-access-control/overview) (Microsoft Learn)
- [IAM overview](https://cloud.google.com/iam/docs/overview) (Google Cloud)

Previous: [Shared Responsibility in the Cloud](https://www.internhack.in/roadmaps/tracks/cybersecurity/shared-responsibility) · Next: [Cloud Logging and Monitoring](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-logging)

## More in Cloud Security

- [Shared Responsibility in the Cloud](https://www.internhack.in/roadmaps/tracks/cybersecurity/shared-responsibility)
- [Cloud IAM](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-iam)
- [Cloud Logging and Monitoring](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-logging)
- [Misconfiguration Prevention and CSPM](https://www.internhack.in/roadmaps/tracks/cybersecurity/cspm-misconfiguration)
- [Cloud Encryption and Key Management](https://www.internhack.in/roadmaps/tracks/cybersecurity/cloud-encryption-kms)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
