Skip to content
Tutorials Center
My learning

Topics

Lesson 14 of 38 ยท Identity and Access

Privileged Access and IAM Auditing

Control the most powerful cloud identities: just-in-time access, break-glass accounts, access reviews, joiner-mover-leaver processes and an automated stale-access audit.

Some identities can do much more damage than others: administrators, the account owner, pipeline roles that deploy to production, and anyone who can manage keys or logging. Protecting these privileged identities and regularly checking who has what is the difference between an incident that stays small and one that takes the whole account. This lesson covers privileged access management and the audit routine that keeps access honest.

What counts as privileged

  • The account owner (root) and organization administrators.
  • Anyone who can create or change IAM policies, roles or keys, because they can grant themselves anything.
  • People or automation who can change networking, logging or encryption settings.
  • Roles used by CI/CD pipelines to deploy infrastructure.
  • Emergency access accounts.
  • Service identities with broad data access.

Core controls

Privileged access controls

Just in time Elevate only when needed
Strong MFA Phishing-resistant keys
Approval A second person agrees
Session logging Everything recorded

Standing admin rights are the thing to eliminate.

1 / 2
  1. No standing admin for daily work. People use a normal role and request elevation for a task. Elevation expires automatically after a short time (just-in-time, JIT).
  2. Approval and reason. Elevation requests record who, why and for how long, and sensitive ones need a second approver.
  3. Phishing-resistant MFA on every privileged login.
  4. Separate admin identities from everyday email and browsing identities, so a phished mailbox does not hand over the cloud.
  5. Break-glass accounts. Two or three emergency accounts, with long random credentials stored offline (sealed, split between custodians), excluded from normal conditional access so you can still get in if the identity provider is down. Every use triggers an alert and a review. Test them every few months.
  6. Dedicated logging account. Audit logs go to a separate account that administrators of other accounts cannot modify.
  7. Session recording or detailed command logging for the highest-risk actions.
sequenceDiagram
    participant D as Engineer
    participant P as Access portal
    participant A as Approver
    participant C as Cloud account
    D->>P: Request admin role, reason, 1 hour
    P->>A: Ask for approval
    A->>P: Approve
    P->>C: Grant role until expiry
    D->>C: Do the task (logged)
    C-->>D: Access expires automatically

Just-in-time elevation: the right exists only for the time it is needed, and the trail records why.

Joiner, mover, leaver

Access must follow the person's job:

  • Joiner: new people get a role-based starting set, not a copy of a colleague's access.
  • Mover: when someone changes teams, remove old access before or as you add new. People who collect access over the years end up with far too much.
  • Leaver: disabling the central identity must remove all cloud access the same day. Check for local users, keys and shared secrets the person knew.

Access reviews

At least quarterly (monthly for privileged access), ask resource and team owners to confirm: "does each person on this list still need this access?" Reviews are most effective when they show last used dates, so owners can spot access that was never used.

Typical findings:

  • Users who have left or changed teams.
  • Roles or keys unused for 90 days or more.
  • Access keys older than the rotation limit.
  • Accounts without MFA.
  • Service identities with permissions broader than what they exercise.

Runnable example: stale access audit

The program audits a made-up user list against four rules and prints findings by severity. Real tools pull this data from the identity provider and the cloud API; the rules are the same.

Python Audit users for stale or risky access

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Run the audit on a schedule and send critical findings to the owner automatically. An audit that is only run once a year finds problems that have existed for months.

Monitoring privileged activity

Alert on high-risk events rather than reading every log:

  • Use of the root or break-glass account.
  • Creation of users, keys or roles, and any change to IAM policies.
  • Disabling or changing logging, encryption keys or security tools.
  • Privilege elevation outside business hours or from new locations.
  • Login without MFA, or failed MFA bursts.

A small rule evaluator illustrates the idea.

Python Alert on privileged events

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is just-in-time access?

    JIT removes standing privileges so there is less to steal at any moment.
  2. 2. What is the purpose of a break-glass account?

    It is a tightly controlled last resort, used rarely and monitored closely.
  3. 3. Why should audit logs go to a separate account?

    Protected logs preserve evidence and support non-repudiation.
  4. 4. Which finding should be fixed first in an access audit?

    Former staff with active access is an immediate, avoidable risk.

Summary

  • Privileged identities (owners, IAM administrators, pipelines, key and logging managers) need the strongest controls.
  • Use just-in-time elevation, approvals, phishing-resistant MFA, separate admin identities, break-glass accounts and protected logs.
  • Run joiner-mover-leaver processes and regular access reviews, preferably driven by last-used data.
  • Automate audits and alert on the handful of high-risk events.

Next: Cloud Network Segmentation and Security Groups