Back to Home

IAM (Identity and Access Management) - Deep Technical Breakdown

IAM is the most critical control in cloud and SaaS security.

80-90% of cloud breaches start with IAM misconfiguration.

What Is IAM?

IAM controls who can access your systems, what they can access, what actions they can perform, and under what conditions.

IAM = Authentication + Authorization + Policy Enforcement

The 4 Core Components of IAM

1) Identity (Who are you?)

Each identity must be unique and traceable.

2) Authentication (Prove who you are)

Best practice: enforce MFA for all privileged accounts.

3) Authorization (What can you do?)

After authentication, the system evaluates roles, permissions, and policies.

4) Policy Engine (How rules are enforced)

Allow: Action: read Resource: /crm/tenant/123/* Condition: user.tenantId == 123

IAM in Cloud (Azure/AWS/GCP)

IAM governs who can create VMs, delete databases, read storage, deploy code, and change network/firewall rules.

ConceptMeaning
UserHuman identity
GroupCollection of users
RoleSet of permissions
PolicyRules that define access
Service AccountNon-human identity

Least Privilege (Most Important)

Grant only minimum permissions needed.

Access Control Models

1) RBAC (Role-Based Access Control)

User -> Role -> Permissions (simple and widely adopted).

2) ABAC (Attribute-Based Access Control)

Uses attributes from user/resource/context.

Allow if: user.department == resource.department AND time between 9am-6pm

3) PBAC (Policy-Based Access Control)

Cloud-heavy model: policy defines action, resource, and condition.

Common IAM Vulnerabilities

IAM in Microservices Architecture

For NestJS microservices, Keycloak auth, and SaaS multi-tenancy:

Application-Level IAM

Flow: User -> Login -> Keycloak -> JWT.

JWT should include userId, role, tenantId. Backend must verify signature, expiry, and issuer.

Authorization in SaaS

Always enforce tenant filter at query level:

WHERE tenant_id = currentTenant

Never trust tenant from frontend body/query/URL. Derive from token claims.

Service-to-Service IAM

Example: order service can read order DB, but cannot access payroll DB.

Cloud IAM Governance Best Practices

Conditional Access (Advanced)

Secrets Management

Secrets are part of IAM.

Privilege Escalation (Major Risk)

Attack path: low privilege compromised account -> escalation -> admin compromise.

Audit permissions regularly to prevent escalation paths.

IAM Security Checklist (Production-Ready)

Identity

  • MFA enforced
  • No shared accounts
  • Disable unused accounts
  • Rotate keys

Authorization

  • Least privilege
  • Role-based access
  • No wildcard policies (*)

Service Accounts

  • Scoped access
  • Short-lived tokens
  • Separate identity per service

Governance

  • Audit logs enabled
  • Quarterly permission reviews
  • Separation of duties

Workshop Narrative

"If attacker gets one admin credential, your entire cloud is gone."

Show how one over-permissioned IAM role can delete DB, create admin users, and disable logging.

IAM failures can become total compromise.

The Big Insight

IAM is the control plane of security.