Identity and Access Management (IAM) is the security backbone of every cloud environment. Think of IAM as the bouncer at a club who checks your ID and decides which rooms you can enter. In cloud, every API request must answer two questions: "Who are you?" (authentication) and "What can you do?" (authorization).
IAM misconfigurations are the #1 cause of cloud breaches. Overly permissive policies, unused credentials, and confused deputy problems have led to massive data breaches. Understanding IAM deeply is essential for both defending and attacking cloud environments.
IAM ≠ Just Users
IAM covers users, groups, roles, service accounts, policies, and permissions. In cloud, "identity" often means a service or application, not just human users. A Lambda function or EC2 instance has an identity just like a user does.
Core IAM Concepts
AWS IAM Deep Dive
Wildcards Are Dangerous
Policies with "Action": "*" or "Resource": "*" are overly permissive. Even "s3:*" on a specific bucket allows deletion. Always use least privilege - grant only what's needed.
Azure IAM (Entra ID)
Managed Identities
Azure Managed Identities eliminate the need for credentials in code. System-assigned identities are tied to a resource's lifecycle. User-assigned identities can be shared across resources. Always prefer managed identities over service principal secrets.
GCP IAM
IAM Misconfigurations
IAM Privilege Escalation
Over 20 AWS IAM permissions can lead to privilege escalation if granted carelessly. Examples: iam:CreatePolicyVersion, iam:AttachUserPolicy, iam:PassRole + lambda:CreateFunction. Always audit IAM carefully!
IAM Best Practices
IAM Assessment Methodology
IAM Security Assessment
1
Identity InventoryList all users, groups, roles, service accounts. Identify inactive identities and unused credentials.
2
Policy AnalysisReview attached policies for wildcards (*), overly broad permissions, and missing conditions. Check for privilege escalation paths.
3
Cross-Account TrustAudit trust relationships. Verify external ID conditions, check for overly permissive principals.
4
Credential HygieneCheck access key age, last used dates, MFA status. Identify long-term credentials in code/configs.
5
Monitoring GapsVerify CloudTrail/audit logs are enabled, alerting is configured for IAM changes, access analyzer is running.
6
Privilege Escalation TestingTest if current permissions allow escalation: creating policies, assuming roles, modifying resources.
Knowledge Check
Challenges
Key Takeaways
- IAM answers: Who are you? What can you do? On which resources?
- Roles provide temporary credentials - prefer over long-term keys
- Wildcards (*) in policies are dangerous - always use least privilege
- Multiple IAM permissions enable privilege escalation - audit carefully
- Enable MFA, especially on privileged accounts
- Regular access reviews prevent credential sprawl