Skip to content

Access Packages 101: How the System Works

Before diving into the step-by-step runbook, this page explains the moving parts that make up the privileged access system: what an access package actually is, how it connects to Privileged Access Groups (PAGs) and PIM, and how one project, azure-privileged-access, holds all of it without any pipeline holding Tier 0 access.

Status: one project, no Tier 0 on any pipeline (2026-12-04)

Everything lives in azure-privileged-access (ADR-0012). Its Terraform creates nothing and keeps no state: it lists what should exist. Tier 0 items are changed by a PIM-elevated person from commands CI posts; Tier 1/2 access packages are applied by a Tier 1 pipeline. azure-privileged-access-packages is retired and archived, and its Tier 0 pipeline identity is deleted.


1. The Problem This System Solves

In many cloud tenants, privileged access is managed in one of two flawed ways:

  1. ClickOps in the portal: Admins assign roles or PIM eligibility to people by hand. Over time, nobody remembers who holds what or why.
  2. Hardcoding human UPNs in Terraform: Listing pim_eligible_users = ["alice@example.com"] in git turns every routine access request or expiry into a pull request—causing review fatigue, rubber-stamping, and slow emergency response.

This platform separates structure and policy (managed in Terraform) from runtime human access (managed in Entra ID):

  • Terraform defines the what and the rules: Which roles are bundled together into a persona, who is allowed to request it, who must approve it, how long eligibility lasts, and how long a single activation lasts. No individual human UPN appears anywhere in Terraform.
  • Entra ID Governance handles the who at runtime: Engineers request access packages in MyAccess (myaccess.microsoft.com) and activate them on demand in PIM for Groups.

2. The Building Blocks

Every privileged persona (such as Platform Owner or Cloud Estate Security Auditor) is assembled from six connected pieces in Microsoft Entra ID and Azure:

flowchart LR
    subgraph GRANTS["azure-privileged-access: Tier 0 lists (a person runs the posted commands)"]
        REQ["Requestor Group<br/>(sg-t0-requestors)"]
        APP["Approver Group<br/>(sg-t0-approvers)"]
        PAG["Persona Group (PAG)<br/>e.g. pag-owner-mg-platform"]
        ROLES["Permissions<br/>• Entra Directory Roles<br/>• Azure RBAC Grants"]
        PAG --> ROLES
    end

    subgraph PACKAGES["Catalogs and packages (Tier 0: posted commands; Tier 1/2: Tier 1 pipeline)"]
        CAT["Access Package Catalog<br/>(Tier 0 Privileged Access)"]
        PKG["Access Package<br/>e.g. (tier 0) Owner & Security Admin"]
        POL["Assignment Policy<br/>• Duration (90d)<br/>• Quarterly Review"]
        PIM["PIM Activation Policy<br/>• Max 4h<br/>• MFA + Justification"]
    end

    CAT --> PKG
    PKG --> POL
    REQ -.->|"Who can request"| POL
    APP -.->|"Who approves & reviews"| POL
    PKG ==>|"Grants Eligible Member"| PAG
    PIM ==>|"Governs activation"| PAG
Component Example What it does
1. Persona Group / PAG pag-owner-mg-platform An Entra ID security group that holds all the permissions for a specific job function (both Entra ID directory roles and Azure RBAC role assignments). Humans are never assigned roles directly; the group holds the roles.
2. Access Package Catalog Tier 0 Privileged Access A folder/container in Entra ID Entitlement Management that holds the persona groups (as "catalog resources") and the access packages that grant access to them.
3. Access Package (tier 0) Owner & Security Admin at Platform Management Group The "menu item" engineers see in myaccess.microsoft.com. When granted, it binds the user to the Persona Group as an Eligible Member (never an active standing member).
4. Assignment Policy & Review 90 days + quarterly review Attached to the Access Package. Defines who can request the package, whether an approver must sign off, how many days the assignment lasts before expiring, and the recurring quarterly access review.
5. PIM Activation Policy Max 4 hours, MFA required A PIM for Groups policy attached to the Persona Group. Controls what happens when an Eligible Member clicks "Activate" to temporarily become an Active Member.
6. Governance Groups & Owners sg-t0-requestors
sg-t0-approvers
Break-glass owners
Role-assignable groups that control who can request or approve packages, plus the two break-glass accounts set as the sole permanent owners of every Tier 0 group.

3. Two-Stage Just-In-Time (JIT) Flow: How a Human Gets Access

Because an Access Package grants PIM Eligibility rather than active group membership, getting active permissions is a two-stage process:

sequenceDiagram
    autonumber
    actor Engineer
    participant MyAccess as MyAccess Portal<br/>(Entitlement Management)
    participant PIM as Entra PIM for Groups
    participant PAG as Persona Group (PAG)<br/>(Directory Roles + Azure RBAC)

    Note over Engineer,PAG: Stage 1 — Eligibility (Up to 90 Days)
    Engineer->>MyAccess: Request Access Package
    MyAccess->>PIM: Add Engineer as "Eligible Member" of PAG
    Note right of PIM: Zero active permissions at rest

    Note over Engineer,PAG: Stage 2 — JIT Activation (1 to 4 Hours)
    Engineer->>PIM: Activate group (MFA + Justification)
    PIM->>PAG: Temporarily add Engineer as "Active Member"
    PAG-->>Engineer: Entra Roles & Azure RBAC active for 4 hours
    PIM->>PAG: Auto-remove Active Member when timer expires
  1. Stage 1 — Request Eligibility (Entitlement Management): An engineer in sg-t0-requestors goes to myaccess.microsoft.com and requests the access package. Once granted, Entra makes them an Eligible Member of the underlying pag-* group for up to 90 days (subject to a quarterly access review). While merely eligible, the engineer has zero active permissions.
  2. Stage 2 — Activate for a Task (PIM for Groups): When the engineer actually needs to perform privileged work, they go to Entra PIM → Groups and activate the pag-* group (completing MFA and entering a justification). Entra makes them an Active Member of the group for the configured window (typically 1–4 hours). As soon as the timer expires, Entra removes them from active membership and the permissions vanish.

4. One Project, Two Ways of Applying

All of this lives in one project, azure-privileged-access (renamed from azure-privileged-access-grants on 2026-12-04). Its Terraform creates nothing and keeps no state: every file lists what should exist, and data sources read what does. CI jobs compare the two. What happens next depends on the item's tier:

flowchart LR
    CODE["azure-privileged-access<br/>lists in code"] --> PLAN["CI plan<br/>(read-only identity)"]
    PLAN --> T0JOBS["Tier 0 jobs<br/>groups, grants, PIM settings,<br/>catalog setup, Tier 0 packages"]
    PLAN --> T12["access-packages-tier-1-2"]
    T0JOBS -->|"posts commands"| NOTE["MR note:<br/>Tier 0 change: admin required"]
    NOTE -->|"PIM-elevated person runs"| ENTRA["Microsoft Entra ID<br/>and Azure"]
    T12 -->|"main, manual play<br/>Tier 1 identity"| ENTRA
Items Tier Applied by
Persona groups, requestor and approver groups 0 A person with pag-t0-privileged-access-grants active, from the Privileged groups note
Each persona's Entra directory roles and Azure RBAC grants 0 A person, from the Role grants and Directory role grants notes
Each persona group's PIM activation settings 0 A person, from the PIM settings note
Tier 0 access packages; catalog setup (which groups are in a catalog, who manages it) 0 A person, from the Tier 0 access packages and Catalog setup notes
Tier 1/2 access packages, in the Tier 1/2 Privileged Access catalog 1 CI on main (manual play) as sp-pla-tf-privileged-access-grants-rw

Why it is split this way:

  1. Whatever manages access to a Tier 0 role is Tier 0 itself. Microsoft: "Any system that can manage or broker access to privileged roles is part of the control plane and must be protected at that level."3 The groups, their roles, their PIM settings and the packages that hand them out all do that, so no pipeline changes them. A person does, under PIM, from commands CI writes for them.
  2. The Tier 1/2 packages can be applied by a pipeline that stays Tier 1. In app-only scenarios "the calling app can be assigned one of the preceding supported roles instead of the EntitlementManagement.ReadWrite.All application permission",4 and "Access package managers can't add resources to a catalog."2 So the pipeline identity holds only Access package manager on the Tier 1/2 Privileged Access catalog. It can only hand out the groups a person put there, and a Tier 0 group never goes there: a check in catalogs.tf fails the plan.
  3. The Azure CLI couldn't do the person's part; Microsoft Graph PowerShell can. The Azure CLI can't request the entitlement-management and PIM for Groups Graph scopes (AADSTS65002). Connect-MgGraph lets you "specify the permissions (scopes) needed for your session",5 so the posted commands use Microsoft Graph PowerShell. This was proven in the tenant on 2026-12-02 (ADR-0012 evidence).
Repository What it holds
azure-privileged-access Every persona, its grants and PIM settings, the catalogs and every access package, as lists. CI posts the Tier 0 commands and applies the Tier 1/2 packages.
solution-manage-pag-persona v3 One persona: looks its group up and lists what it should be and what it is granted. Creates nothing.
solution-privileged-access-allowlist The allow-list of Entra directory roles and Tier 0 RBAC scopes a persona may be given.
ci-templates lib/terraform-pag/ The jobs: privileged-groups, pim-settings, catalog-setup, access-packages-tier-0, access-packages-tier-1-2, plus role-grants and directory-role-grants.
azure-privileged-access-packages Retired (archived 2026-12-04). Its last apply forgot everything from state without changing Entra.

5. Role-Assignable Groups and Catalogs

Every persona group is role-assignable (isAssignableToRole = true): only "the Global Administrator, Privileged Role Administrator, or the group Owner can manage the group".1 Adding such a group to a catalog needs both a catalog role and the right to manage the group: "that identity must have both the ability to perform actions on that resource, and be a catalog owner role in entitlement management for the catalog."2

The retired design gave the packages pipeline temporary ownership of each new group (catalog_onboarding = true) so that it could add the group to the catalog. An owner can add members directly, bypassing PIM, so that was a Tier 0 path on a pipeline. It is gone: solution-manage-pag-persona v3 removed the flag, and the identity was deleted.

Now a person adds groups to catalogs, from the Catalog setup note, with pag-t0-privileged-access-grants active (Privileged Role Administrator and Identity Governance Administrator). Group owners are only ever the two break-glass accounts.


6. Built-In Security Guardrails

Together, these components enforce a strict set of guardrails across the system:

  • No pipeline holds Tier 0. The only write identity, sp-pla-tf-privileged-access-grants-rw, holds Access package manager on the Tier 1/2 catalog and Group.Read.All, nothing else, and signs in from main only.
  • No Terraform state to protect. The project has no backend, so no Tier 0 state is ever written.
  • Zero humans in code for eligibility. Requestor and approver groups (sg-t0/t1/t2-requestors, sg-t0/t1/t2-approvers) are listed with their members; people get eligibility only by requesting a package in MyAccess.
  • Break-glass group owners only. Every privileged group's owners are the two break-glass accounts. The privileged-groups job posts a removal for any other owner, because an owner can add members without PIM.
  • Eligible Member, never Member. Every package links its group as PIM Eligible Member, so an approved request grants eligibility and every use is a time-boxed activation.
  • Automatic expiry and quarterly reviews. Assignments expire after 90 days, and a quarterly review removes any assignment not re-approved within 14 days.
  • Drift is visible. Every job compares the code with Entra and Azure on every pipeline; a job that posts nothing means they match.

7. Attribute-Based Auto-Assignment & Group-Gated Requests

Instead of manually maintaining a list of who gets access—or who is allowed to request access—you can drive Access Packages from user profile attributes (such as jobTitle = "Platform Engineer" or department = "Cloud Platform", synced from on-prem AD DS).

There are two ways to use profile data and groups with Access Packages, plus a few important Entra ID rules about nested groups and PIM eligibility:

flowchart LR
    ATTR["User Profile Attribute<br/>jobTitle == 'Platform Engineer'"]

    subgraph Direct["Pattern A: Auto-Assign the Package"]
        AUTO_POL["Automatic Assignment Policy<br/>(No MyAccess request needed)"]
        STANDING["Direct Group Membership<br/>(Standing Active Member)"]
        AUTO_POL --> STANDING
    end

    subgraph Gatekeeper["Pattern B: Unlock Ability to Request Package B"]
        GRP_A["Group A (Requestor Group)<br/>Dynamic Group or Auto-Assigned by Package A"]
        PKG_B["Access Package B<br/>(Shows up in MyAccess to request)"]
        PIM_B["Eligible Member of PAG<br/>→ 4h PIM Activation"]
        GRP_A -->|"Allows requesting"| PKG_B --> PIM_B
    end

    ATTR ==>|"Option 1: Skip request"| AUTO_POL
    ATTR ==>|"Option 2: Gatekeeper"| GRP_A

Pattern A: Auto-Assigning a Package from Profile Attributes (No Request Needed)

In Entra Entitlement Management, an Access Package can have an Automatic Assignment Policy instead of a request-based policy. You define a dynamic rule against the user's profile attributes, for example:

(user.jobTitle -eq "Platform Engineer") and (user.accountEnabled -eq true)
  • What happens: As soon as a user's profile in Entra ID has jobTitle = "Platform Engineer", Entra automatically grants them the Access Package without them ever opening MyAccess. The moment their job title changes in HR / AD DS, Entra automatically removes the package assignment.
  • The Catch (Active Member vs. PIM Eligible Member): Entra ID's Automatic Assignment Policies currently only support adding users as an active standing Member of a group—they cannot bind users as a PIM Eligible Member, and they do not support approval stages or 90-day time-boxed expirations.
  • Best for: Baseline birthright access (VPN groups, DevOps tools, standard Tier 2 reader access) or populating a Requestor Group (see Pattern B below).
  • Not used for: Direct Tier 0 PAG membership, because Tier 0 requires a deliberate request + PIM JIT activation (Eligible Member).

Pattern B: "If You're in Group A, You Can Request Access Package B" (Gatekeeper Pattern)

For privileged roles where you still want the user to request Access Package B in MyAccess (so they get 90-day Eligible Member status + 4-hour PIM activation), you use their profile attributes to automatically place them into Group A (the Requestor Group), which unlocks the ability to request Access Package B.

Why Nested Groups Don't Work Here

It is tempting to create a dynamic group grp-platform-engineers (Group A) and nest it inside sg-t0-requestors (Group B). Entra ID blocks this in two places:

  1. Role-assignable groups forbid nesting: In this platform, sg-t0-requestors has assignable_to_role = true so that only a Privileged Role Administrator can change who is in it. Microsoft Entra ID does not allow nesting a group inside a role-assignable group, and does not allow dynamic membership rules on role-assignable groups.
  2. Entitlement Management checks direct membership: Even on normal groups, Access Package requestor policies evaluate direct members of the configured requestor group, not transitive nested groups.

Two Clean Ways to Do It Instead (Without Nesting)

Approach How it works Security trade-off
1. Dynamic Requestor Group
(Best for Tier 1 / Tier 2 packages)
Create Group A (sg-platform-engineer-requestors) as a Dynamic Security Group with the rule user.jobTitle -eq "Platform Engineer". Point Access Package B's requestor_group_object_id directly at Group A. Anyone with jobTitle = "Platform Engineer" is automatically placed into Group A and can immediately see and request Access Package B in MyAccess. Dynamic groups cannot be role-assignable (assignable_to_role = false). An identity with Groups Administrator or Group.ReadWrite.All could alter the dynamic rule, so this is best for Tier 1/2 packages rather than Tier 0.
2. Chained Access Packages
(Package A auto-assigns Group A → unlocks requesting Package B)
Create Access Package A ("Baseline: Platform Engineer") with an Automatic Assignment Policy (user.jobTitle -eq "Platform Engineer"). Package A's resource is Group A (the requestor group). When a user's profile matches, Package A automatically makes them a direct member of Group A. Because they are now in Group A, Access Package B appears in their MyAccess portal ready to request. Keeps everything inside Entitlement Management with full audit trails of why the user was added to the requestor group, and works even when Group A is a role-assignable group (once onboarded to the catalog).

Next Steps