PRACTITIONERCHAPTER 08

Identity, access and secrets

Every breach story has a credential in it: who gets one, what it opens, how long it lives, and who notices when it is used

45 MINSECURITYUPDATED 2026-11-05
PREDICT

An attacker runs a real-time phishing proxy: the victim types into a fake login page and the proxy relays everything to the real site within seconds. Which second factor still stops the login?

Identity and access management, IAM, is the part of security that decides who and what can act in your systems. It covers three populations: the people who work for you, the services and machines that call each other, and a small number of emergency accounts that exist for the day everything else is broken. Secrets, the passwords, API keys, tokens and private keys that prove those identities, are the thing attackers want most, because a valid credential walks past almost every other control.

As a Security Engineer who owns this domain, you are judged on findings fixed, not findings filed. The work is less about choosing products than about making the right path the default: every new hire arrives through single sign-on, every leaver is gone within hours, every service gets a credential that expires, and the access review produces removals rather than signatures.

The model: identities, lifecycles, blast radius

Think about IAM as three questions you ask of every credential in the company.

Who or what does it represent? A credential with no clear owner cannot be reviewed, rotated or revoked with confidence. Shared accounts, the admin@ login five people know, fail this test, which is why every audit framework dislikes them.

What does it open? The blast radius. A read-only analytics role and the production database’s superuser are both credentials; one is a footnote if stolen and the other is a breach notification. Least privilege is the discipline of shrinking this answer.

How long does it live? A password set in 2021 and an access token that expires in an hour are not the same risk, even with the same permissions. The shorter a credential lives, the less a theft is worth and the less your detection has to be perfect.

Population Source of truth How it authenticates Typical failure
Employees and contractors HR system feeding the identity provider SSO with MFA Leavers who keep access; movers who accumulate it
Services and workloads Infrastructure code and the platform Workload identity, tokens, keys Long-lived keys copied into config and never rotated
Customers Your product’s own auth Passwords, passkeys, OAuth Credential stuffing, weak recovery
Break-glass A written procedure Sealed credentials, hardware key Untested, so it fails on the one day it is needed

Customer identity is a product question with its own threat model, and the harden-login lesson covers it, and auth for SaaS and public APIs covers customer logins, API keys and tenant isolation. This chapter is about the other three.

Google’s BeyondCorp paper, in the reading, is the idea that reorganised this field: the corporate network is not a trust boundary, and access depends on the user and the state of their device, checked on every request. Security philosophies covers where it came from and what zero trust does and does not mean. The consequence for IAM: once the network grants nothing, identity and device posture are the whole perimeter, and IAM becomes the most important control you run.

Joiner, mover, leaver

Every human identity goes through three events, and the process that handles them is called joiner, mover, leaver, JML.

Joiner. The HR system, the HRIS, is the source of truth. When HR marks a hire, the identity provider (Okta, Microsoft Entra ID, Google Workspace and similar) creates the account, and SCIM, the System for Cross-domain Identity Management (RFC 7643 and 7644), pushes it into the downstream apps with the right groups. SSO, over SAML or OpenID Connect, means the person has one login and one MFA enrolment instead of thirty. Access comes from role-based groups: an engineer on the payments team gets the payments group, which carries the repositories, the cloud roles and the dashboards that team needs. Anything outside the group is an access request with an approver and an expiry.

Mover. This is where most programmes fail. A joiner and a leaver are events HR records. A move from support to engineering, or from one team to another, often is not, and even when it is, the old groups rarely come off. People accumulate access the way houses accumulate cupboards, and five years in, your longest-serving staff have the widest blast radius. The fix is to treat a move as a leave-and-join for access: remove the old role’s groups, grant the new ones, and let the person request back anything they still need, with an expiry.

Leaver. When HR marks a departure, the identity provider disables the account, kills active sessions, and SCIM deprovisions downstream. The things that survive this are the things to hunt: personal access tokens on the code host, API keys the person created, SSH keys on servers, entries in a shared password manager, and accounts in apps that were never behind SSO. Set a target for removal, written in your policy; same day for involuntary leavers and within one working day for the rest is a common rule of thumb, and the number your auditor will test you against is the one you wrote.

The quiet enemy is the app outside SSO. Many SaaS vendors put SAML and SCIM in their most expensive tier, the so-called SSO tax, so finance buys the cheaper plan and the app gets local accounts. Keep an inventory of these and review them by hand, because no automated leaver process will reach them.

MFA, and which kind

MFA is not one control. The question that matters is whether a real-time phishing proxy can relay it, and NIST SP 800-63B-4, the authentication volume of the current Digital Identity Guidelines (SP 800-63-4, final in July 2025, superseding 800-63-3), draws the line clearly: only cryptographic authenticators bound to the channel or the verifier’s name are phishing-resistant. It requires phishing resistance at authenticator assurance level 3 (AAL3), the highest, requires that a phishing-resistant option be offered at AAL2, and treats SMS, one-time codes and out-of-band approvals as not phishing-resistant. The same volume forbids composition rules and forced periodic password changes; compliance and audits covers what to do when an auditor’s template still asks for them.

Method Phishing-resistant? Main weakness
SMS code No Relayed by a proxy; SIM swap
Authenticator app code (TOTP) No Relayed by a proxy within its 30-second window
Push approval No Push fatigue, as at Uber
Push with number matching No Stops blind approvals; still relayable through a proxy
Passkey (synced via a platform account) Yes Security now rests on the platform account that syncs it
FIDO2 security key or device-bound passkey Yes Cost, and the process for lost keys
Smart card (PIV) Yes Hardware and middleware overhead

Passkeys are FIDO credentials. Synced passkeys copy between a person’s devices through their platform account; device-bound passkeys, including those on hardware security keys, never leave one device. The 800-63B-4 text allows exportable, syncable keys at AAL2 and forbids them at AAL3. For most workforce access, synced passkeys are a large improvement over codes. For administrators of production, money movement and the identity provider itself, a device-bound key is the stronger choice.

Two things undo good MFA. The first is recovery: if a help desk will reset MFA for anyone who sounds stressed on the phone, your phishing-resistant factor has a phishable bypass. Recovery needs identity proofing, such as a video call with the manager or re-enrolment in person, and an alert to the security team. The second is exceptions: the executive who will not carry a key, the legacy VPN that only does codes. Each exception is a documented risk with an owner and an end date, or it becomes the way in.

Authorisation and the access review

Authentication proves who you are; authorisation decides what you may do. The practitioner’s tools are role-based groups, just-in-time (JIT) access for dangerous permissions, and the access review.

Just-in-time access means nobody holds production admin by default. An engineer requests it for a reason, for an hour or a shift, with approval or an on-call rule, and the grant expires on its own. Removing standing access to production is often the largest single cut in blast radius a team can make, and it turns every privileged session into a logged, attributable event.

The access review, also called user access review or access recertification, is the periodic check that every account and every permission is still needed. SOC 2 and ISO 27001 auditors will ask for evidence of it, and PCI DSS requirement 7.2.4 requires review of user accounts and privileges in the cardholder data environment at least every six months; compliance and audits shows how one quarterly review answers all three. Done badly, it is a spreadsheet emailed to managers, who approve every row because rejecting one means a conversation. A 100% approval rate is the signature of a review that did not happen.

Done well, an access review has four properties. It is scoped by risk: production, money movement, customer data and the identity provider itself are reviewed quarterly; low-risk SaaS less often. It is reviewed by the person who knows: the resource owner reviews who has their system, as well as the manager reviewing what their reports hold. It uses evidence: last-used dates from the identity provider or the cloud (AWS IAM’s last-accessed data is one example) let the reviewer see that a permission has not been used in 90 days. And it produces removals that happen: every revoke has a ticket and a date, and the next review checks it was done.

Service identities and secrets

Services outnumber people in most companies, and their credentials are where secrets sprawl. The order of preference is the core of any secrets policy.

  1. No stored secret. The workload proves who it is through the platform: cloud IAM roles attached to compute, Kubernetes service accounts federated to the cloud, CI pipelines that exchange an OIDC token for short-lived cloud credentials instead of holding access keys. AWS’s IAM best practices state this directly: workloads should use temporary credentials through roles.
  2. Short-lived dynamic secrets. Where a system needs a username and password, such as a database, a secrets manager issues one per consumer with a lease. HashiCorp Vault’s database secrets engine creates credentials on request and revokes them when the lease expires; revoking by prefix kills a whole class at once during an intrusion.
  3. Static secrets in a manager, rotated. Third-party API keys, webhook signing secrets and other values you cannot make dynamic live in Vault, AWS Secrets Manager, Google Secret Manager or Azure Key Vault, are read at runtime, and rotate on a schedule. The secrets-rotation-replay lesson covers how to rotate without downtime, and why a signed request needs more than a valid key.
  4. Never in source code, in a container image, in a shared document or in a chat message.

Machine-to-machine OAuth, the client credentials grant covered in the oauth lesson, gives services scoped, expiring tokens rather than one master key. For what a signing key or an HMAC secret actually proves, and why the private half must never leave its service, see hashes, MACs and signatures.

Secret scanning is the safety net: pre-commit hooks, scanning in CI, and the code host’s own push protection. When a secret leaks, the order is fixed. Revoke first, because deleting a commit does not remove copies already cloned or scraped. Then find what it opened, search the logs for its use, and record the incident. A leak that is rotated in ten minutes is a ticket; one that waits for the investigation is a breach.

Break-glass accounts

Your identity provider is now a single point of failure. When it has an outage, or when a misconfigured policy locks every administrator out, you need a way in that does not depend on it. That is the break-glass account.

A break-glass account is a small number of highly privileged accounts, usually two, held for emergencies. It works without SSO, by design. Its credentials are stored so that no single person can use them unseen: a hardware key in a safe, a password split between two people, or a sealed envelope with a tamper log. Any use pages the security on-call at once, every time, because a legitimate use is rare enough that each one deserves a look. It is excluded from conditional-access policies that could lock it out, and documented in the runbook with who may invoke it. And it is tested, quarterly as a rule of thumb, because a break-glass procedure that has never been run will fail on the day it is needed: the password expired, the key holder left, the MFA device is in a drawer in a closed office.

Cloud root accounts are break-glass accounts in all but name. Protect them the same way: hardware MFA, no access keys, alerts on any sign-in.

Where practitioners disagree

Synced passkeys or hardware keys. One camp says synced passkeys are phishing-resistant and people do not lose them, so roll them out to everyone now. The other says a synced credential is only as strong as the consumer cloud account it syncs through, and administrators need device-bound keys. Most mature teams do both: passkeys for the workforce, hardware keys for privileged roles.

Periodic access reviews or continuous ones. Critics say quarterly reviews are audit theatre and the real control is automation: JML driven by HR, access that expires by default, alerts on unused permissions. Defenders say automation misses what nobody modelled, and a human looking at the list catches it. Both are right; automate the routine and keep the human review for the high-risk systems.

Vault or the cloud’s own manager. Vault does dynamic secrets across clouds and databases, at the cost of running a critical service yourself or paying for the managed one. A single-cloud company is often better served by the native secrets manager plus workload identity, which needs no new infrastructure.

Day to day

As a Security Engineer owning identity, your week looks like this.

Daily. Triage identity alerts: impossible travel, MFA resets, new admin grants, break-glass sign-ins, secret-scanning hits. Most are benign; each gets a disposition. Approve or decline access requests that route to security, mostly for production and customer data. A leaked-secret alert jumps the queue.

Weekly. Review the JML exceptions: leavers whose deprovisioning failed in some app, contractors whose end date has passed, accounts in apps outside SSO. Meet the IT or workplace team for half an hour, because they run the identity provider day to day and you need them as allies. Pick one service with a static credential and move it a rung up the secrets order.

Monthly. Report a small set of measures: share of apps behind SSO, share of staff on phishing-resistant MFA, median leaver deprovisioning time, count of long-lived cloud access keys, open secret-scanning findings. Trend matters more than level.

Quarterly. Run the access review for high-risk systems and chase the removals to done. Test break-glass. Review MFA exceptions and expire the ones past their date. Feed the results to the GRC team for the audit evidence, and to engineering leadership as one page.

The meetings that matter are the ones where access gets designed: the architecture review for a new service, where you ask how it authenticates before it ships with a static key, and the procurement review for a new SaaS tool, where you ask whether SSO and SCIM are in the tier being bought.

BY ORG SIZE
STARTUPunder 30 people

Under 30 people there is no security team, and identity is often a Google Workspace admin, a shared password manager and a root cloud login three founders know. Your highest-value moves are cheap: SSO for every app that supports it, phishing-resistant MFA on the identity provider and the cloud console, no shared logins for anything with production or money access, cloud access keys replaced by roles. Write a one-page leaver checklist, because the leaver process is a person remembering. Skip the formal access review; a founder reading the admin list monthly is enough.

SCALE-UP30 to 300

Between 30 and 300 people, IAM becomes a programme. You connect the HR system to the identity provider so joiners and leavers are automatic, introduce SCIM where the vendor tier allows it, and fight the SSO tax in procurement. The first SOC 2 audit forces a written access policy and a quarterly review, and the first review finds the movers. Secrets move from environment files into a manager, CI loses its long-lived cloud keys, and break-glass gets written down for the first time. Most of the work is persuading IT and engineering to own pieces of it.

ENTERPRISE300 and up

At 300 and up the function exists, and the problem is scale and politics. An identity governance tool runs certification campaigns across thousands of entitlements, and reviewer fatigue is the main failure. Mergers bring second identity providers and directories that take years to merge. Privileged access management is a platform with its own team. Your job is to keep the controls real: chase the removals, measure the rubber-stamp rate, retire legacy MFA, and negotiate with business units whose systems cannot do SSO without a costly upgrade.

ARTEFACT Run an access review and write a secrets policy ~75 MIN
YOU PRODUCEAccess review record and secrets policy

Template

# Access review: <scope> · <quarter>
Owner · Date · Status: open | removals in progress | closed

## Scope
| System | Owner | Risk tier (1-3) | Reviewer | Evidence source |
|---|---|---|---|---|

## Findings
| Account | Person / owner | Access held | Last used | Decision (keep/reduce/remove) | Ticket | Due |
|---|---|---|---|---|---|---|

## Shared, orphaned and service accounts
| Account | Why it exists | Human owner | Action |
|---|---|---|---|

## Summary
Accounts reviewed: <n> · Kept: <n> · Reduced: <n> · Removed: <n>
Removals verified done on: <date>

---

# Secrets and access policy
Version · Approved by · Review date

## 1. Human access
- All apps that support it use SSO via <identity provider>. Apps outside SSO are listed in <inventory>.
- MFA: <roles> must use phishing-resistant authenticators (FIDO2 key or passkey). Others: <minimum>.
- MFA recovery requires: <identity-proofing step>, and alerts <team>.
- Leavers: access removed within <time>; involuntary leavers within <time>.
- Movers: old role access removed at the move; re-request with expiry.
- Privileged production access is just-in-time (JIT), maximum <duration>.

## 2. Service credentials, in order of preference
1. Workload identity / federation (no stored secret)
2. Dynamic secrets with a lease of <= <TTL>
3. Static secrets in <secrets manager>, rotated every <interval>
4. Prohibited: secrets in source code, images, tickets, chat, shared docs

| Secret class | Where it lives | Rotation | Owner |
|---|---|---|---|

## 3. Leaked secrets
Revoke or rotate within <time> of detection, then investigate use. Log as a security incident.

## 4. Break-glass
Accounts: <n> · Stored: <how> · Use alerts: <who> · Tested: <cadence> · Last test: <date>

## 5. Review cadence
Tier 1 systems: quarterly · Tier 2: half-yearly · Tier 3: yearly
WORKED EXAMPLE

Sanderling is a fictional remittance company, 180 people, sending money from the UK and EU to eleven corridors in Africa and South Asia. Its Security Engineer ran the Q3 access review on the four tier-1 systems: the AWS production organisation, the payouts admin console, the identity provider and the production database.

Scope and results. 212 accounts reviewed across the four systems. Kept: 161. Reduced: 27. Removed: 24. Reviewers were the system owners, not the managers; the head of payments reviewed the payouts console and was excluded from approving her own access, which the CTO reviewed.

Findings that mattered. Nine people who had moved from operations to product still held payout-approval rights in the console; none had used them in more than 120 days, per the console’s audit log. All nine removed. Two contractors whose contracts ended in June still had active identity-provider accounts, because their end dates were never entered in the HR system; removed the same day, and a fix opened to make contractor end dates mandatory. One shared login, ops-admin, on the database, used by four people for monthly reconciliation; replaced with named, time-bound roles valid for four hours.

Secrets policy changes. The review found 14 long-lived AWS access keys. Eleven moved to IAM roles within the quarter; three, used by a vendor’s reconciliation tool, moved into Secrets Manager with 90-day rotation and a named owner. CI now authenticates to AWS through OIDC federation. Payout administrators moved to hardware security keys; everyone else to passkeys. Break-glass: two accounts, hardware keys in two separate safes, use pages the security on-call; tested on 12 September, when one key’s PIN had been forgotten and was reset under two-person control.

Removals verified on 30 September by re-running the export. The rubber-stamp check: one reviewer approved all 61 rows in four minutes; the next review pairs that system with a second reviewer.

Now you

You have joined Turnstone, a fictional B2B messaging API with 85 people, as its first Security Engineer. Customers send SMS and WhatsApp messages through Turnstone’s API. Your first SOC 2 Type II audit window opens in ten weeks. You export what you can: 85 people, but 103 active accounts in Google Workspace, 41 people with the AWS AdministratorAccess policy, 22 long-lived AWS access keys (the oldest from 2021), and a GitHub organisation with 9 outside collaborators nobody can name. The carrier-routing console, which can redirect every customer’s traffic, has local logins only, because the vendor charges for SSO. Two engineers paste API keys into Slack to share them with support. The complication: the CTO is one of the 41 administrators and says she needs it for on-call, and the VP of Customer Success says removing support’s console access will break the escalations SLA. Produce the access review for the tier-1 systems and the first version of Turnstone’s secrets and access policy.

Self-check

DECIDE

You are the first security engineer at Turnstone, then 24 people. You find that the AWS root account, the production database superuser and the carrier-routing console all use one shared password, stored in a password-manager folder that 11 people can open; two of them have since left. The root account has an authenticator-app MFA on one founder's phone. A large customer's security questionnaire asks whether admin credentials are shared. What do you do first?

READING
  1. DOC
    NIST SP 800-63-4, Digital Identity Guidelines NIST, 2025

    The current US standard for identity proofing, authentication and federation, final in July 2025 and superseding 800-63-3. Start here to see how the four volumes fit together and what the assurance levels mean.

  2. DOC
    NIST SP 800-63B-4, Authentication and Authenticator Management NIST, 2025

    The volume you will cite most: the definition of phishing resistance, what each assurance level requires, syncable authenticators, and the end of composition rules and forced password changes.

  3. PAPER
    BeyondCorp: A New Approach to Enterprise Security Rory Ward and Betsy Beyer, 2014

    The paper that moved trust from the network to the user and the device. Read it for the architecture, then notice how much of today's zero-trust marketing it already contains. Read: ;login: vol. 39 no. 6; read the whole paper, it is six pages.

  4. DOC
    Vault: Lease, Renew, and Revoke HashiCorp

    How dynamic secrets carry a lifetime, how renewal works, and how prefix revocation kills a class of credentials during an incident. Read with the database secrets engine page beside it.

  5. DOC
    Vault database secrets engine HashiCorp

    The concrete case for dynamic secrets: a credential per consumer, created on request and revoked on expiry. Useful even if you never run Vault, as the target your secrets policy is aiming at.

  6. POST
    The mechanics of a sophisticated phishing scam and how we stopped it Cloudflare, 2022

    A first-hand account of a phishing campaign that got valid passwords and still failed because of FIDO2 keys. The best short argument for phishing-resistant MFA you can send an executive.

  7. DOC
    Security best practices in IAM AWS

    A cloud provider's own list: federation for humans, roles for workloads, MFA, last-accessed data for reviews, guardrails across accounts. A practical checklist for the cloud half of an access review.

  8. DOC
    RFC 7644: System for Cross-domain Identity Management, Protocol Hunt et al., IETF, 2015

    The SCIM protocol behind automated joiner and leaver provisioning. Skim it so you know what a vendor means when they say they support SCIM, and what to test before you trust it.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Cloud and infrastructure security →