Skip to content
Pwnversity
DEF-IAMintermediate · 10 min · upd. 2026-11

Identity management (IAM)

T1078T1621T1110.003

Identity and access management (IAM) decides who is who, how they prove it, what they can do and for how long. In environments with cloud, SaaS and remote work, most access no longer goes through a network perimeter: it goes through an identity provider (IdP). That’s why compromising a valid identity (T1078) usually gives more reach than compromising a machine, and most modern intrusions start or escalate there: passwords tried at scale, relayed MFA codes, stolen sessions, or a help desk technician convinced over the phone.

  • Authentication that resists phishing: a stolen credential or a relayed code shouldn’t be enough.
  • Least privilege over time: privileges only when needed and only for as long as needed.
  • Lifecycle: joiners, movers and, above all, leavers handled on time; every orphaned account is a door.
  • Visibility: knowing who accessed what, from where and with which method, to detect and respond.
Method Phishing-resistant? Typical attack
Password only No Spraying (T1110.003), reuse, infostealers
SMS or voice call No SIM swap, code forwarding, social engineering of the carrier
TOTP (code app) No The code is relayed in real time through a proxy (AiTM, T1111)
Push with number matching Partial MFA fatigue (T1621), mitigated by requiring the displayed number
FIDO2 / passkeys (WebAuthn) Yes Theft of the already established session (T1539), not of the factor
Certificate or smart card Yes Certificate theft if it isn’t hardware-protected

The difference is what gets bound. A TOTP code is a number the user types anywhere, including on a fake page. A passkey signs a challenge that includes the origin (the real domain), so a fake page on another domain gets no valid signature: the browser doesn’t even offer the credential.

TOTP (RFC 6238) computes the code with an HMAC over the current time and a secret shared by the server and the app. With the RFC’s own test vectors (ASCII secret 12345678901234567890, SHA-1, 8 digits):

Ventana de terminal
S=$(python3 -c "print(b'12345678901234567890'.hex())")
for t in 59 1111111109 20000000000; do oathtool --totp -d 8 -N "@$t" $S; done
94287082
07081804
65353130

All three match the RFC’s appendix B. What it shows: anyone who has the secret (on the server, in a phone backup, in a captured QR code) generates the same codes, and anyone who has one code can use it within its 30-second window. An AiTM phishing proxy doesn’t need to break anything: it relays the password and the code to the real service and keeps the session cookie. That’s why the MFA target for privileged accounts and remote access is FIDO2 or certificates, not TOTP.

Revision 4 (final in July 2025) changed several habits:

Rule Requirement
Minimum length when the password is the only factor 15 characters
Minimum length when part of MFA 8 characters
Maximum length allowed At least 64 characters
Composition rules (uppercase, digit, symbol) Must not be imposed
Mandatory periodic change No; only on evidence of compromise
Blocklist Check against common, breached or context-specific passwords (service name, company name)
AAL2 / AAL3 AAL2 must offer at least one phishing-resistant option; AAL3 requires it

In Active Directory this translates into length policies (with Fine-Grained Password Policies for privileged and service accounts), a banned-password filter (Entra Password Protection or similar), and removing periodic expiry for users who already have MFA.

  • Context-based policies: device state (managed and compliant), location, session and account risk, and the application being accessed.
  • Block legacy authentication (IMAP, POP, basic SMTP): it doesn’t support MFA and is the favorite path for spraying.
  • Short sessions for administration and token protection (device binding where the platform supports it): stealing a session cookie bypasses any MFA already completed.
  • MFA and password resets: the help desk process is part of IAM. Verify identity through an independent channel, not through the caller.

Privileges: tiered, time-bound and never permanent

Section titled “Privileges: tiered, time-bound and never permanent”
flowchart LR
    U(("Administrator")) --> PAW["Dedicated<br/>administration<br/>workstation"]
    PAW --> REQ["JIT request<br/>reason and duration"]
    REQ --> APR{"Approval<br/>and strong MFA"}
    APR -->|"granted"| ROL["Temporary<br/>privileged role"]
    ROL --> T0["Tier 0<br/>identity: AD, IdP, PKI"]
    ROL --> T1["Tier 1<br/>servers and applications"]
    ROL -.->|"expires"| FIN["Privilege removed"]
    ROL --> LOG[("Audit<br/>and recording")]
  • Tiering: credentials that administer identity (tier 0: domain controllers, IdP, PKI) are never used on servers or lower-tier workstations, where an attacker could steal them.
  • Privileged access workstations (PAW): the privileged account doesn’t read email or browse.
  • JIT / PIM: nobody is permanently admin; the privilege is activated with a reason, strong MFA and an expiry.
  • PAM: credential vault, checkout and session recording for unavoidable shared accounts.
  • Break-glass accounts: at least two, excluded from conditional access that could lock them out, with FIDO2 credentials stored physically and an alert on every use.

Service accounts, service principals, OAuth applications, API keys and CI/CD tokens often outnumber people, have broad privileges and nobody reviews their sign-ins.

  • Inventory with an owner for every service account and application.
  • In AD, gMSA (a long password rotated automatically) instead of service accounts with fixed passwords and kerberoastable SPNs (Kerberos).
  • In the cloud, managed identities and short-lived credentials instead of long-lived secrets.
  • Restricted application consent: users shouldn’t be able to grant broad permissions to third-party apps without review.
  • Alerts for new credentials added to an application and for elevated application permissions (read all mailboxes, directory administration).
  • Joiner, mover, leaver processes tied to HR: a departure disables the account and revokes sessions the same day.
  • Periodic access reviews by each resource’s owner, not by IT.
  • Named accounts: shared ones make it impossible to know who did what.
Signal Source
Many authentication failures spread across accounts from few IPs 4625 / 4771, IdP sign-in logs (spraying, SIEM correlation)
Sign-in without MFA on an account that should have it IdP sign-in logs
Bursts of rejected push requests followed by an accepted one MFA logs (fatigue, T1621)
New MFA method or MFA reset IdP audit
Additions to privileged groups 4728, 4732, 4756; IdP audit
New credentials on an application or service principal IdP audit
Use of a break-glass account or honeytoken Any use is an alert (honeypots)
  1. Revoke sessions and tokens (changing the password doesn’t invalidate an already stolen cookie).
  2. Reset the password and review registered MFA methods: attackers usually add their own.
  3. Review mailbox rules, consented applications, added credentials and group changes.
  4. If the account was privileged, treat it as a tier 0 incident (incident management, cloud).
  • Considering MFA solved with SMS or TOTP on administrator accounts.
  • Leaving legacy authentication on “for one printer”.
  • Test and service accounts without MFA or an owner, forgotten in a secondary tenant.
  • Permanent administrators “for convenience”.
  • A help desk process that resets MFA after a convincing phone call.
  • Midnight Blizzard vs Microsoft (2023-2024): a low-volume password spray through residential proxies compromised an account in a legacy test tenant without MFA. From there, the actor took over a test OAuth application with elevated permissions in the corporate environment and used it to access executives’ mailboxes. Weak password, missing MFA and a forgotten non-human identity, in a single chain.
  • MGM Resorts (2023): access started with a call to the help desk to reset an employee’s credentials (vishing). The missing control was a process, not a technology.
  • Snowflake / UNC5537 (2024): credentials stolen by infostealers were enough to get into customer instances that had no MFA.
  • Phishing-resistant MFA (FIDO2 or certificates) for administration and remote access
  • Push with number matching for everyone else; SMS only as a last resort
  • Password policy per NIST 800-63B-4 with a blocklist
  • Legacy authentication blocked
  • Conditional access by device, risk and application
  • Administration tiers, PAWs and JIT privileges; no permanent admins
  • Two protected and monitored break-glass accounts
  • Inventory of non-human identities with owners; gMSA and managed identities
  • Same-day offboarding and periodic access reviews
  • Alerts for spraying, MFA changes, privileged groups and application credentials