Why This Matters#

Identity is the new perimeter. In cloud and remote-work environments, controlling WHO can access WHAT is the primary security control. IAM failures are behind most breaches — stolen credentials, excessive permissions, and broken authentication.


Core Concepts#

flowchart LR
    Subject["Subject<br/>(user, service, device)"]
    Subject -->|"AuthN: Who are you?"| Identity["Identity<br/>Verification"]
    Identity -->|"AuthZ: What can you do?"| Access["Access<br/>Decision"]
    Access -->|"Allow/Deny"| Resource["Protected<br/>Resource"]
ConceptQuestionMechanism
IdentificationWho claims to be?Username, email, certificate CN
Authentication (AuthN)Prove itPassword, MFA, certificate, biometric
Authorization (AuthZ)What’s allowed?Roles, policies, attributes
Accounting/AuditingWhat did they do?Logs, audit trail

Authentication Protocols#

SAML 2.0 (Security Assertion Markup Language)#

XML-based SSO protocol, common in enterprise:

sequenceDiagram
    participant U as User
    participant SP as Service Provider
    participant IdP as Identity Provider
    
    U->>SP: Access resource
    SP->>U: Redirect to IdP
    U->>IdP: Authenticate (login)
    IdP->>U: SAML Assertion (signed XML)
    U->>SP: Forward assertion
    SP->>SP: Validate signature + claims
    SP->>U: Access granted

OAuth 2.0#

Authorization framework — delegates access without sharing credentials:

Grant TypeUse CaseClient Type
Authorization Code + PKCEWeb apps, mobile, SPAPublic
Client CredentialsMachine-to-machineConfidential
Device CodeSmart TVs, CLI toolsInput-limited
Refresh TokenExtend session without re-authAny

OpenID Connect (OIDC)#

Authentication layer built on OAuth 2.0. Adds an ID Token (JWT) with user identity:

OAuth 2.0 = "App X can access your photos" (authorization)
OIDC      = "You are alice@example.com" (authentication)

SAML vs OIDC#

AspectSAML 2.0OIDC
FormatXMLJSON (JWT)
TransportBrowser redirects (POST/Redirect)HTTP API calls
Token sizeLarge (XML)Compact (JWT)
Mobile-friendlyNoYes
Modern appsLegacyStandard
Use caseEnterprise SSOWeb, mobile, APIs

FIDO2 / WebAuthn (Passwordless)#

Hardware-based authentication — eliminates passwords entirely:

sequenceDiagram
    participant U as User
    participant B as Browser
    participant S as Server
    participant K as Security Key
    
    U->>B: Click "Login"
    B->>S: Request challenge
    S->>B: Random challenge
    B->>K: Sign challenge (touch key)
    K->>B: Signed response
    B->>S: Send signed response
    S->>S: Verify with stored public key
    S->>B: Authenticated

Phishing-resistant: The key is bound to the origin (domain) — it won’t respond to a phishing site.


Multi-Factor Authentication (MFA)#

FactorTypeExamplesStrength
Something you knowKnowledgePassword, PINWeakest (phishable)
Something you havePossessionTOTP app, hardware key, phoneStrong
Something you areBiometricFingerprint, face, irisStrong

MFA Methods Ranked#

MethodPhishing ResistantConvenienceSecurity
SMS OTPNo (SIM swap)HighLow
Email OTPNoMediumLow
TOTP (Authenticator app)No (phishable)MediumMedium
Push notificationPartially (fatigue attacks)HighMedium
Hardware key (FIDO2)YesMediumVery High
PasskeysYesHighVery High

Recommendation: FIDO2 hardware keys or passkeys for high-value accounts. TOTP as minimum baseline.


Authorization Models#

RBAC (Role-Based Access Control)#

Assign permissions to roles, assign roles to users:

flowchart LR
    U1["Alice"] --> R1["Admin"]
    U2["Bob"] --> R2["Editor"]
    U3["Carol"] --> R3["Viewer"]
    
    R1 --> P1["Create"]
    R1 --> P2["Read"]
    R1 --> P3["Update"]
    R1 --> P4["Delete"]
    
    R2 --> P1
    R2 --> P2
    R2 --> P3
    
    R3 --> P2

Pros: Simple, auditable, widely supported. Cons: Role explosion in complex systems, no context awareness.

ABAC (Attribute-Based Access Control)#

Decisions based on attributes of subject, resource, action, and environment:

Policy: ALLOW IF
  subject.department == resource.department
  AND subject.clearance >= resource.classification
  AND environment.time BETWEEN 09:00 AND 18:00
  AND action IN ["read", "list"]

Pros: Fine-grained, context-aware, flexible. Cons: Complex to manage, harder to audit.

ReBAC (Relationship-Based Access Control)#

Authorization based on relationships between entities (used by Google Zanzibar, OpenFGA):

document:readme#viewer@user:alice     (Alice can view readme)
folder:docs#owner@user:bob            (Bob owns docs folder)
document:readme#parent@folder:docs    (readme is in docs)
→ Bob can view readme (inherited from folder ownership)

Comparison#

ModelBest ForComplexityGranularity
RBACMost applicationsLowRole-level
ABACComplex policies, complianceHighAttribute-level
ReBACDocument/resource sharing, socialMediumRelationship-level

Privileged Access Management (PAM)#

High-privilege accounts (admin, root, service accounts) are the highest-value targets:

PAM Controls#

ControlPurpose
Credential vaultingStore privileged creds centrally, never on endpoints
Just-in-time (JIT) accessElevate only when needed, auto-revoke after
Session recordingFull audit trail of admin actions
Approval workflowsRequire manager/peer approval for sensitive access
Break-glassEmergency access with full audit + post-incident review

Service Account Security#

RiskMitigation
Shared credentialsUnique account per service
Never-rotated passwordsAutomated rotation (Secrets Manager)
Excessive permissionsLeast privilege, scoped to specific resources
No audit trailLog all service account actions
Orphaned accountsRegular access reviews, auto-disable unused

Identity Federation#

Single identity, multiple services:

flowchart TD
    IdP["Identity Provider<br/>(Okta, Azure AD, Google)"]
    IdP --> App1["App 1 (SAML)"]
    IdP --> App2["App 2 (OIDC)"]
    IdP --> App3["App 3 (OIDC)"]
    IdP --> AWS["AWS (SAML/OIDC)"]
    IdP --> GCP["GCP (OIDC)"]

Benefits#

  • Single source of truth — disable user once, access revoked everywhere
  • Reduced password fatigue — one login for all services
  • Centralized MFA — enforce at IdP level
  • Audit trail — all access decisions logged centrally

Workload Identity Federation#

For machine-to-machine (no human credentials):

CI/CD Pipeline (GitLab) → OIDC token → AWS STS → Temporary credentials

No long-lived secrets stored in CI/CD — the pipeline proves its identity via OIDC.


Session Management#

ControlPurposeImplementation
Session timeoutLimit exposure windowIdle timeout (15–30 min)
Absolute timeoutForce re-authenticationMax session (8–24 hours)
Secure cookiesPrevent theftSecure; HttpOnly; SameSite=Strict
Session invalidationLogout worksServer-side session destruction
Concurrent session limitsDetect account sharingAlert or block on multiple sessions
Token rotationLimit stolen token usefulnessShort-lived access + refresh tokens

Key Takeaways#

  1. Identity is the new perimeter — in cloud/remote, IAM is your primary control
  2. Passwordless (FIDO2/passkeys) is the goal — phishing-resistant by design
  3. MFA is mandatory — SMS is weak, hardware keys are strongest
  4. Least privilege always — start with zero access, grant only what’s needed
  5. Federation centralizes control — one IdP, revoke once, done everywhere
  6. PAM for privileged accounts — vault, JIT, record, review
  7. Short-lived tokens > long-lived credentials — reduce blast radius of theft