Do’s and don’ts concerning security for Identity part 5

Continuing with the do’s of Identity and supposing that you are in part of your journey that you have either Hybrid or fully cloud-based identities.

In the last part I covered how you can keep your External users in bay with Dynamic groups and access reviews.

In this part we will see how to protect your High-privileged users and give them permissions they need and for the time you want them to have them.

First you could create your own roles

The is a good collection of predefined roles for Azure AD and Azure resources but sometimes it could be a viable solution to create your own roles from scratch.

What’s the difference?

Fundamentally, Azure AD roles are admins for users and services (M365) and should be separated from Azure Resource roles although they can be added to Azure Resource roles.

Azure AD roles = Identity in Azure AD and admin roles for M365 based services.

Azure Resource roles = Services inside Azure and their defined roles.

Here is a picture from Microsoft, how the roles differ from the other.

Why to create your own roles?

Like said, Microsoft have a comprehensive set of Azure AD based roles.

But what if you need strictly to define your own roles and the exact permissions for it? Let’s based on a regulation in our industry policies.

Currently there is 174 permissions to choose from, I will list them here for reference as I didn’t find anywhere else.

PermissionDescription
microsoft.directory/applicationPolicies/allProperties/readRead all properties (including privileged properties) on application policies.
microsoft.directory/applicationPolicies/allProperties/updateUpdate all properties (including privileged properties) on application policies.
microsoft.directory/applicationPolicies/basic/updateUpdate standard properties of application policies.
microsoft.directory/applicationPolicies/createCreate application policies.
microsoft.directory/applicationPolicies/createAsOwnerCreate application policies, and creator is added as the first owner.
microsoft.directory/applicationPolicies/deleteDelete application policies.
microsoft.directory/applicationPolicies/owners/readRead owners on application policies.
microsoft.directory/applicationPolicies/owners/updateUpdate the owner property of application policies.
microsoft.directory/applicationPolicies/policyAppliedTo/readRead application policies applied to objects list.
microsoft.directory/applicationPolicies/standard/readRead standard properties of application policies.
microsoft.directory/applications.myOrganization/allProperties/readRead all properties (including privileged properties) on single-directory applications.
microsoft.directory/applications.myOrganization/allProperties/updateUpdate all properties (including privileged properties) on single-directory applications.
microsoft.directory/applications.myOrganization/audience/updateUpdate audience on single-directory applications.
microsoft.directory/applications.myOrganization/authentication/updateUpdate authentication on single-directory applications.
microsoft.directory/applications.myOrganization/basic/updateUpdate basic properties on single-directory applications.
microsoft.directory/applications.myOrganization/credentials/updateUpdate credentials on single-directory applications.
microsoft.directory/applications.myOrganization/deleteDelete single-directory applications.
microsoft.directory/applications.myOrganization/owners/readRead owners on single-directory applications.
microsoft.directory/applications.myOrganization/owners/updateUpdate owners on single-directory applications.
microsoft.directory/applications.myOrganization/permissions/updateUpdate exposed permissions and required permissions on single-tenant applications.
microsoft.directory/applications.myOrganization/standard/readRead basic properties on single-directory applications.
microsoft.directory/applications/allProperties/readRead all properties (including privileged properties) on all types of applications.
microsoft.directory/applications/allProperties/updateUpdate all properties (including privileged properties) on all types of applications.
microsoft.directory/applications/applicationProxy/readRead all application proxy properties.
microsoft.directory/applications/applicationProxy/updateUpdate all application proxy properties.
microsoft.directory/applications/applicationProxyAuthentication/updateUpdate authentication on all types of applications.
microsoft.directory/applications/applicationProxySslCertificate/updateUpdate SSL certificate settings for application proxy.
microsoft.directory/applications/applicationProxyUrlSettings/updateUpdate URL settings for application proxy.
microsoft.directory/applications/appRoles/updateUpdate the appRoles property on all types of applications.
microsoft.directory/applications/audience/updateUpdate the audience property for applications.
microsoft.directory/applications/authentication/updateUpdate authentication on all types of applications.
microsoft.directory/applications/basic/updateUpdate basic properties for applications.
microsoft.directory/applications/createCreate all types of applications.
microsoft.directory/applications/createAsOwnerCreate all types of applications, and creator is added as the first owner.
microsoft.directory/applications/credentials/updateUpdate application credentials.
microsoft.directory/applications/deleteDelete all types of applications.
microsoft.directory/applications/owners/readRead owners of applications.
microsoft.directory/applications/owners/updateUpdate owners of applications.
microsoft.directory/applications/permissions/updateUpdate exposed permissions and required permissions on all types of applications.
microsoft.directory/applications/standard/readRead standard properties of applications.
microsoft.directory/applications/synchronization/standard/readRead provisioning settings associated with the application object.
microsoft.directory/applicationTemplates/instantiateInstantiate gallery applications from application templates.
microsoft.directory/auditLogs/allProperties/readRead all properties on audit logs, including privileged properties.
microsoft.directory/bitlockerKeys/key/readRead bitlocker metadata and key on devices.
microsoft.directory/bitlockerKeys/metadata/readRead bitlocker key metadata on devices.
microsoft.directory/connectorGroups/allProperties/readRead all properties of application proxy connector groups.
microsoft.directory/connectorGroups/allProperties/updateUpdate all properties of application proxy connector groups.
microsoft.directory/connectorGroups/createCreate application proxy connector groups.
microsoft.directory/connectorGroups/deleteDelete application proxy connector groups.
microsoft.directory/connectors/allProperties/readRead all properties of application proxy connectors.
microsoft.directory/connectors/createCreate application proxy connectors.
microsoft.directory/deviceManagementPolicies/basic/updateUpdate basic properties on device management application policies.
microsoft.directory/deviceManagementPolicies/standard/readRead standard properties on device management application policies.
microsoft.directory/deviceRegistrationPolicy/basic/updateUpdate basic properties on device registration policies.
microsoft.directory/deviceRegistrationPolicy/standard/readRead standard properties on device registration policies.
microsoft.directory/devices/createdFrom/readRead created from Internet of Things (IoT) device template links.
microsoft.directory/devices/deleteDelete devices from Azure AD.
microsoft.directory/devices/disableDisable devices in Azure AD.
microsoft.directory/devices/enableEnable devices in Azure AD.
microsoft.directory/devices/registeredOwners/readRead registered owners of devices.
microsoft.directory/devices/registeredOwners/updateUpdate registered owners of devices.
microsoft.directory/devices/registeredUsers/readRead registered users of devices.
microsoft.directory/devices/registeredUsers/updateUpdate registered users of devices.
microsoft.directory/devices/standard/readRead basic properties on devices.
microsoft.directory/groups.security.assignedMembership/allProperties/updateUpdate all properties (including privileged properties) on Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security.assignedMembership/basic/updateUpdate basic properties on Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security.assignedMembership/classification/updateUpdate the classification property on Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security.assignedMembership/createCreate Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security.assignedMembership/createAsOwnerCreate Security groups of assigned membership type, excluding role-assignable groups. Creator is added as the first owner.
microsoft.directory/groups.security.assignedMembership/deleteDelete Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security.assignedMembership/members/updateUpdate members of Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security.assignedMembership/owners/updateUpdate owners of Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security.assignedMembership/visibility/updateUpdate the visibility property on Security groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.security/allProperties/updateUpdate all properties (including privileged properties) on Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/basic/updateUpdate basic properties on Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/classification/updateUpdate the classification property on Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/createCreate Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/createAsOwnerCreate Security groups, excluding role-assignable groups. Creator is added as the first owner.
microsoft.directory/groups.security/deleteDelete Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/dynamicMembershipRule/updateUpdate the dynamic membership rule on Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/members/updateUpdate members of Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/owners/updateUpdate owners of Security groups, excluding role-assignable groups.
microsoft.directory/groups.security/visibility/updateUpdate the visibility property on Security groups, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/allProperties/updateUpdate all properties (including privileged properties) on Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/basic/updateUpdate basic properties on Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/classification/updateUpdate the classification property on Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/createCreate Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/createAsOwnerCreate Microsoft 365 groups of assigned membership type, excluding role-assignable groups. Creator is added as the first owner.
microsoft.directory/groups.unified.assignedMembership/deleteDelete Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/members/updateUpdate members of Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/owners/updateUpdate owners of Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified.assignedMembership/visibility/updateUpdate the visibility property on Microsoft 365 groups of assigned membership type, excluding role-assignable groups.
microsoft.directory/groups.unified/allProperties/updateUpdate all properties (including privileged properties) on Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/basic/updateUpdate basic properties on Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/classification/updateUpdate the classification property on Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/createCreate Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/createAsOwnerCreate Microsoft 365 groups, excluding role-assignable groups. Creator is added as the first owner.
microsoft.directory/groups.unified/deleteDelete Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/dynamicMembershipRule/updateUpdate the dynamic membership rule on Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/members/updateUpdate members of Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/owners/updateUpdate owners of Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups.unified/visibility/updateUpdate the visibility property on Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/allProperties/readRead all properties (including privileged properties) on Security groups and Microsoft 365 groups, including role-assignable groups.
microsoft.directory/groups/allProperties/updateUpdate all properties (including privileged properties) on Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/assignLicenseAssign product licenses to groups for group-based licensing.
microsoft.directory/groups/basic/updateUpdate basic properties on Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/classification/updateUpdate the classification property on Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/createCreate Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/createAsOwnerCreate Security groups and Microsoft 365 groups, excluding role-assignable groups. Creator is added as the first owner.
microsoft.directory/groups/deleteDelete Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/dynamicMembershipRule/updateUpdate the dynamic membership rule on Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/groupType/updateUpdate properties that would affect the group type of Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/memberOf/readRead the memberOf property on Security groups and Microsoft 365 groups, including role-assignable groups.
microsoft.directory/groups/members/readRead members of Security groups and Microsoft 365 groups, including role-assignable groups.
microsoft.directory/groups/members/updateUpdate members of Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/owners/readRead owners of Security groups and Microsoft 365 groups, including role-assignable groups.
microsoft.directory/groups/owners/updateUpdate owners of Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/groups/reprocessLicenseAssignmentReprocess license assignments for group-based licensing.
microsoft.directory/groups/standard/readRead standard properties of Security groups and Microsoft 365 groups, including role-assignable groups.
microsoft.directory/groups/visibility/updateUpdate the visibility property of Security groups and Microsoft 365 groups, excluding role-assignable groups.
microsoft.directory/provisioningLogs/allProperties/readRead all properties of provisioning logs.
microsoft.directory/servicePrincipals/allProperties/readRead all properties (including privileged properties) on servicePrincipals.
microsoft.directory/servicePrincipals/allProperties/updateUpdate all properties (including privileged properties) on servicePrincipals.
microsoft.directory/servicePrincipals/appRoleAssignedTo/readRead service principal role assignments.
microsoft.directory/servicePrincipals/appRoleAssignedTo/updateUpdate service principal role assignments.
microsoft.directory/servicePrincipals/appRoleAssignments/readRead role assignments assigned to service principals.
microsoft.directory/servicePrincipals/audience/updateUpdate audience properties on service principals.
microsoft.directory/servicePrincipals/authentication/updateUpdate authentication properties on service principals.
microsoft.directory/servicePrincipals/basic/updateUpdate basic properties on service principals.
microsoft.directory/servicePrincipals/createCreate service principals.
microsoft.directory/servicePrincipals/createAsOwnerCreate service principals, with creator as the first owner.
microsoft.directory/servicePrincipals/credentials/updateUpdate credentials of service principals.
microsoft.directory/servicePrincipals/deleteDelete service principals.
microsoft.directory/servicePrincipals/disableDisable service principals.
microsoft.directory/servicePrincipals/enableEnable service principals.
microsoft.directory/servicePrincipals/getPasswordSingleSignOnCredentialsManage password single sign-on credentials on service principals.
microsoft.directory/servicePrincipals/managePasswordSingleSignOnCredentialsRead password single sign-on credentials on service principals.
microsoft.directory/servicePrincipals/oAuth2PermissionGrants/readRead delegated permission grants on service principals.
microsoft.directory/servicePrincipals/owners/readRead owners of service principals.
microsoft.directory/servicePrincipals/owners/updateUpdate owners of service principals.
microsoft.directory/servicePrincipals/permissions/updateUpdate permissions of service principals.
microsoft.directory/servicePrincipals/policies/readRead policies of service principals.
microsoft.directory/servicePrincipals/policies/updateUpdate policies of service principals.
microsoft.directory/servicePrincipals/standard/readRead basic properties of service principals.
microsoft.directory/servicePrincipals/synchronization/standard/readRead provisioning settings associated with your service principal.
microsoft.directory/servicePrincipals/synchronizationCredentials/manageManage application provisioning secrets and credentials.
microsoft.directory/servicePrincipals/synchronizationJobs/manageStart, restart, and pause application provisioning syncronization jobs.
microsoft.directory/servicePrincipals/synchronizationSchema/manageCreate and manage application provisioning syncronization jobs and schema.
microsoft.directory/servicePrincipals/tag/updateUpdate the tag property for service principals.
microsoft.directory/signInReports/allProperties/readRead all properties on sign-in reports, including privileged properties.
microsoft.directory/users/appRoleAssignments/readRead application role assignments for users.
microsoft.directory/users/assignLicenseManage user licenses.
microsoft.directory/users/assignLicenseManage user licenses.
microsoft.directory/users/basic/updateUpdate basic properties on users.
microsoft.directory/users/contactInfo/updateUpdate the contact info properties of users, such as address, phone, and email.
microsoft.directory/users/deviceForResourceAccount/readRead deviceForResourceAccount of users.
microsoft.directory/users/directReports/readRead the direct reports for users.
microsoft.directory/users/extensionProperties/updateUpdate extension properties of users.
microsoft.directory/users/identities/readRead identities of users.
microsoft.directory/users/identities/updateUpdate the identity properties of users, such as name, user principal name, and object ID.
microsoft.directory/users/jobInfo/updateUpdate the job info properties of users, such as job title, department, and company name.
microsoft.directory/users/licenseDetails/readRead license details of users.
microsoft.directory/users/manager/readRead manager of users.
microsoft.directory/users/manager/updateUpdate manager for users.
microsoft.directory/users/memberOf/readRead the group memberships of users.
microsoft.directory/users/ownedDevices/readRead owned devices of users.
microsoft.directory/users/parentalControls/updateUpdate parental controls of users.
microsoft.directory/users/passwordPolicies/updateUpdate password policies properties of users.
microsoft.directory/users/registeredDevices/readRead registered devices of users.
microsoft.directory/users/reprocessLicenseAssignmentReprocess license assignments for users.
microsoft.directory/users/reprocessLicenseAssignmentReprocess license assignments for users.
microsoft.directory/users/scopedRoleMemberOf/readRead user's membership of an Azure AD role, that is scoped to an administrative unit.
microsoft.directory/users/standard/readRead basic properties on users.
microsoft.directory/users/usageLocation/updateUpdate usage location of users.

How?

Azure AD roles

Easiest way is to GET a new role with Graph and modify the permissions, then POST the role back with

Paste it back to Graph and select POST (Note that

Consent the permission to Write and Read roles.

Note that if you are trying to create a roles with an permissions that isn’t allowed, you will get this.

After the role is successfully created, you will get a template ID that you can use in new custom roles.

Inside the portal you will it this way

Azure resources

But for Azure resource roles the story is totally different. You can still use JSON files to create the roles but you have ability to Clone the existing Built-in roles.

If we choose Key Vault Administrator for cloning, we will see the following.

In the JSON you can download the content and use it for a new role or go next next and finish to create and assign the the role.

Or create it with REST API (Postman + Bearer token) or with AZ CLI

If in doubt how to use CLI or Web request (Invoke-WebRequest or Curl) see this post.

Use PIM

To reduce the risks of excessive, pointless, or erroneous access permissions to crucial resources, Privileged Identity Management (PIM) offers a time-based and approval-based role activation. Resources from Azure Active Directory (Azure AD), Azure, and other Microsoft Online Services like Microsoft 365 or Microsoft Intune are included in this list.

PIM enables you to allow a specific set of actions at a particular scope. Key features include:

  • Provide just-in-time privileged access to resources
  • Assign eligibility for membership or ownership of privileged access groups
  • Assign time-bound access to resources using start and end dates
  • Require approval to activate privileged roles
  • Enforce multifactor authentication to activate any role
  • Use justification to understand why users activate
  • Get notifications when privileged roles are activated
  • Conduct access reviews to ensure users still need roles
  • Download audit history for internal or external audit

To use Privileged Identity Management, you must have one of the following licenses:

  • Azure AD Premium P2

How to enable?

Couple of months ago I wrote a study series for AZ-500 and during that I that I covered also PIM, see the following post for PIM activation.

And Privileged Access Groups

But use the Azure AD portal’s Roles and Administrators experience rather than the Privileged Access Groups experience to make the user or group eligible for activation into the group if you want to assign a privileged access group to a role for administrative access to Exchange, Security & Compliance Center, or SharePoint.

So, that in mind let’s see what it’s all about.

You can create different just-in-time policies for each group and will be able to activate several roles at once.

How to enable?

Yeah, sure

And then activate

And you can see it under PIM control plane.

And we can mix Activate and Eligible assignments

And the permanently active

Make it a M365 group

We chose to create an M365 group in the beginning and it will show inside Microsoft 365 Admin center also.

So, let’s see can we Teamify this group?

The options

We have at least three options here, use Microsoft Graph, PnP-PowerShell modules or create a new Teams as the owner of the group (the Approval all mighty)

From Teams

You can enable the group from Teams directly as the Owner of the group.

Once the group member will login to Teams they will see the new Team

Graph

You can also do it with Graph if you want. And the same requirements apply.

In order to create a team, the group must have a least one owner.

Due to replication delays, if the group was created less than 15 minutes ago, the Create team request could fail with a 404 error code. With a 10-second gap between calls, the suggested practice is to retry the Create team call three times.

With PnP

With PnP you can do it with PowerShell, you just have to install the modules and follow these instructions.

How to install the modules
The modules used

Sentinel collaboration in Teams (Public preview)

Did you know that Sentinel already has this feature, you can have all the incident details inside a Teams and once the case is closed, it will be archived and stored for future references or just to keep backlog of the deeds done during the investigation and remediation.

In order to create teams from Microsoft Sentinel:

  • The user creating the team must have Incident write permissions in Microsoft Sentinel. For example, the Microsoft Sentinel Responder role is an ideal, minimum role for this privilege.
  • The user creating the team must also have permissions to create teams in Microsoft Teams.
  • Any Microsoft Sentinel user, including users with the ReaderResponder, or Contributor roles, can gain access to the created team by requesting access.

Closure

In this part we discovered how we can protect the high-privileged user and roles with PIM and how to activate multiple roles inside a Access group but also how to collaborate with the users having the role.

Automating the process of giving permissions and removing the accordingly is an important part of keeping your environments safe of harms way.

In the next part more Identity do’s and don’ts, Stay tuned!

Hackers don’t break in – they log in.

Author: Harri Jaakkonen

Leave a Reply

Your email address will not be published. Required fields are marked *