Key points
- In the previous post in this series, we covered how Entra's entitlement management and access packages function. We also reviewed how access packages may be configured to assign privileged access, even though direct access of privileged Entra roles is prevented.
- This post demonstrates how an attacker with access to certain access packages or ID Governance management roles can escalate their access to privileged roles.
- In our next post, we'll cover how you can improve the security of these access package configurations.
Introduction
Our last post covered how Entra's ID Governance entitlement management can bundle access to support the user life cycle, as well as background on entitlement management's architecture and management roles.
We then explained how access packages can still include privileged resources, such as:
- Assignment of Entra roles with privileges outside of Entra (such as Exchange Administrator)
- Role-assignable groups with privileged Entra role assignments (such as Global Administrator)
- Sensitive data access in SharePoint and Teams
In this post, we'll take a look at how attackers can target access packages with these sensitive resources through hands-on examples in three categories of access package abuse. Each section covers a different method an attacker may use to impact privileged access packages.
Existing access packages
Let's start by looking at how access packages function. Since access packages assign roles, an attacker can use them to escalate privileges, similarly to direct role assignments.
A user has direct eligibility in an access package if they are listed in that access package's policy or have membership in a group included in that policy.
Users can also have indirect eligibility for a package. This may mean they are able to place themselves in an eligible group, or that they own an agent identity with access package eligibility.
Additionally, an agent identity can be included in an access package's policy if E7 or Agent 365 licensing is in use. This has implications for indirect eligibility that we'll discuss later.
Approval requirements
Putting approvals in place reduces the likelihood of an attacker misusing an access package. But if an administrator assumes that access is required for a user's role and disables approval, an attacker could easily use an access package for privilege escalation without administrative interaction.
Our examples below consider scenarios in which no approvals are required for a user to gain assignment to an access package.
Direct eligibility
An attacker who has compromised a user in an access package's policy can request that access package from the My Access portal. If no approvals are required by the access package's policy, this could allow an attacker to immediately escalate their privileges to gain access to all resources contained in the access package.
This is the exact type of behavior that an access package is designed to enable, but manipulated for malicious purposes, and it can happen when it's not obvious or expected. For example, an administrator may configure an access package based on implicit trust of the users requesting it, without expecting that user would ever be compromised.
Let's walk through a scenario to illustrate this.
Let's say an administrator has created an "Exchange Admins Access" access package to grant the Exchange Administrator role. They've configured a policy on this access package to allow users who need to manage Exchange to request it on their own behalf at any time. Since this is related to standard user role functions, the administrator hasn't configured an approval requirement.
An attacker with access to this user's account can navigate to the tenant's My Access portal at myaccess.microsoft.com/@{TenantDomain}.onmicrosoft.com#/access-packages to review previously requested access packages.
They notice the "Exchange Admins Access" package:
By selecting the access package, the attacker is able to request it for themselves:
After approval, the access package status changes to "Delivering" in the request history panel. In this case, the status changes immediately since the access package policy is auto-approved:
The Exchange Administrator role is assigned to the compromised user during access package delivery:
At this stage, the attacker obtains the Exchange Administrator role through the eligible access package. The lack of approval requirements and user's direct eligibility in the access package policy made it possible to escalate privileges without interaction by an administrator.
Indirect eligibility
Even without access to a user with direct eligibility to an access package, an attacker with the ability to modify group membership or trick dynamic group filters can make themselves eligible for an access package. Agent blueprint owners can also become eligible via their owned agent identities.
Once eligible, an attacker can escalate as seen in the direct eligibility scenario above.
Dynamic groups
Dynamic groups based on basic user properties can be manipulated by an attacker holding any role with the microsoft.directory/users/basic/update permission. This permission is typically limited to privileged Entra ID roles but is not considered privileged on its own when included in a custom role.
For example, let's say a dynamic group with the filter user.department -eq "IT" is eligible for an "IT Administrators" access package. An attacker with the above permission can update their department to IT. This results in the attacker joining the group the next time the dynamic filter updates membership.
Once their account is added to the IT users group, the attacker can request the IT department's access package.
Group owners
Group owners can modify group membership. An attacker with the owner role over a group in an access package policy can add themselves into the group, and then request that access package based on their new group membership.
Entra Agent IDs
If E7 or Agent 365 licensing is in use, agent identities may also be included in an access package's policy.
Any owner of the agent blueprint associated with an agent identity can add a credential to the agent blueprint, then authenticate as the agent identity. More details on agent identity takeovers via credential are available in our previous post on this topic.
Once the attacker is acting as the agent identity, they gain eligibility in the access package's policy as that identity.
Malicious access packages
For our second example, let's consider the impact of ID Governance management roles.
Attackers with the ability to create or manipulate ID Governance settings can use these privileges to add themselves to access packages, weaken existing access packages, or add backdoor organizations into access package policies.
Creating malicious access packages
The following ID Governance roles can add new access packages to a catalog:
- Catalog Owner
- Access Package Manager
An attacker who has compromised a user with one of these roles can create a malicious access package to grant existing catalog resources to their own account.
This time, our example scenario will look at the impact of an attacker gaining membership to a role-assignable group through an access package. This group holds a privileged Entra role assignment.
Let's say an administrator grants a user the Access Package Manager role over the "Company Catalog" catalog to create additional access packages for the company. An attacker who has compromised the user with the Access Package Manager role can create new access packages with the catalog's existing resources.
Later on, the administrator creates a "Global Admin Role Group" and assigns the Global Administrator role to it. They add this group as a resource to the same catalog to be used in an access package for administrators.
This is an inadvisable way to use access packages, but not unthinkable if access to multiple resources needs to be bundled and delivered to high-privileged users at once. In this case, the administrator has decided to include the group for convenient user onboarding.
On discovering this, the attacker can create a new access package using the Access Package Manager role to elevate their privileges:
While creating the access package, they find that the "Global Admin Role Group" can be added as a resource. They configure the access package to grant themselves membership in the privileged "Global Admin Role Group" group:
Finally, they configure a policy to allow their account to request this access package:
They also disable policy requirements for justification and approval:
The attacker then requests their malicious access package from the My Access portal:
Once requested, the access package is delivered, and the attacker gains the Global Administrator role through membership in the "Global Admin Role Group":
Tampering with existing access packages and assignments
The following ID Governance roles can modify policy settings or assignment of access packages:
- Catalog Owner
- Access Package Manager
- Access Package Assignment Manager (assignment only)
Users with these roles can directly assign access packages to their own account. This will bypass the request and approval workflow specified by the access package's policy.
If a user has the Catalog Owner or Access Package Manager role, they can also disable required approvals and life cycle settings in an access package's policy.
Adding malicious organizations
Users with the Connected Organization Administrator role can add external organizations to ID Governance. Once added, these organizations can be included in access package policies to allow new guest users to join the tenant with bundled access through an access package.
An attacker with this role in addition to a role allowing access package policy modification could add a connected organization they have control over to ID Governance. They could then add that organization to an access package policy. In the future, the attacker would then be able to add their own guest users through this access package.
Lifecycle workflow misuse with access packages
Sometimes features can have unintended uses for privilege escalation. To wrap up our investigation of access package privilege escalations, we'll look into a scenario where lifecycle workflows can be misused. This use of lifecycle workflows allows modification of membership in a group eligible for additional privileges through an access package.
First, let's take a look at how lifecycle workflows function.
What are lifecycle workflows?
Lifecycle workflows are an ID Governance feature that automates user management tasks without manual scripting. This includes requesting access packages, enabling a user's multi-factor authentication (MFA) configuration, and executing custom extensions.
Identities with the following permissions can manage lifecycle workflows:
- Entra role: Lifecycle Workflow Administrator
- Custom roles:
microsoft.directory/lifecycleWorkflows/workflows/allProperties/allTasks - Application permissions:
LifecycleWorkflows.ReadWrite.All,LifecycleWorkflows-Workflow.ReadWrite.All
Lifecycle workflows were designed with significant limitations to prevent their misuse by attackers. For example:
- Groups: Users can be added only to non-role-assignable groups. Mail-enabled, distribution, dynamic, and role-assignable groups are not supported.
- Users: Users modified by lifecycle workflows can have no membership in role-assignable groups or role assignments.
- Credentials: A temporary access pass (TAP) can only be set on a user with no recorded logins, no role assignments, and no multi-factor authentication methods set.
However, the following modifications are still possible:
- Groups: Add a user to a non-role-assignable group.
- User properties: Update basic user properties.
When certain configurations are in place, these modifications can be used to escalate privileges.
Modifying non-role-assignable groups
If an access package policy is configured to allow a non-role-assignable group as its eligible users, an attacker can use the Lifecycle Workflow Administrator role to add their own account into the eligible group.
Our final scenario looks at the impact of an attacker gaining membership to a non-role-assignable group. This allows them to request access to the previous example's privileged role group.
This time, the administrator has created an access package assigning the "Global Admin Role Group," but based its policy on the "IT Admin Management Group." Users in this non-role-assignable group can request membership in the "Global Admin Role Group," which is assigned the Global Administrator role.
The attacker has compromised a user with the Lifecycle Workflow Administrator role and creates a new workflow:
They select the "Add user to groups" workflow task:
Searching available groups, they find that the "IT Admin Management Group" is an option for membership and select it to add to the workflow:
Once created, any Lifecycle Workflow Administrator can run the policy on demand:
In this case, the attacker selects their own account for the lifecycle workflow run:
Once the workflow has run, the attacker is a member of "IT Admin Management Group." They are now eligible to request access to the target access package:
Delivery of this access package assigns the attacker the Global Administrator role through group membership:
Modifying user properties
Users with the Lifecycle Workflow Administrator role can also modify basic user properties through the "Update user attributes" task.
An attacker with this role can use this to gain membership in dynamic groups with filters based on basic user properties, similar to the indirect eligibility scenario earlier in this post.
Conclusion
In this post, we looked at real scenarios in which attackers can abuse access packages to gain privileges in Exchange and Entra. Direct and indirect eligibility in access package policies, as well as permissions associated with ID Governance roles, can ultimately allow an attacker to gain privileged roles using entitlement management.
Our next post will provide guidance on improving security for access package configurations like those we targeted today, monitoring your environment for suspicious access package changes, and removing unwanted access package assignments.
We're always eager to hear from you. If you have any questions, thoughts, or suggestions, send us a message at securitylabs@datadoghq.com, or open an issue. You can also subscribe to our newsletter or RSS feed.