azureblog.co.uk
← cd ~/roles
// roles/entra

Cloud App Security AdministratorMicrosoft Entra built-in role

Manage all aspects of the Defender for Cloud Apps product.

Role ID892c5842-a9a6-463a-8041-72aa08ca3cf6
PrivilegedNo
Permissions2

What it can do

PermissionWhat it allows
microsoft.directory/cloudAppSecurity/allProperties/allTasksCreate and delete all resources, and read and update standard properties in Microsoft Defender for Cloud Apps
microsoft.office365.webPortal/allEntities/standard/readRead basic properties on all resources in the Microsoft 365 admin center

Assign it

The role ID is the same in every tenant, so these work as they are. Make it eligible through PIM:

powershell13 lines
Connect-MgGraph -Scopes "RoleEligibilitySchedule.ReadWrite.Directory"
$user = Get-MgUser -UserId "jane.doe@contoso.com"
New-MgRoleManagementDirectoryRoleEligibilityScheduleRequest -BodyParameter @{
    Action           = "AdminAssign"
    Justification    = "Needs Cloud App Security Administrator for <reason>"
    RoleDefinitionId = "892c5842-a9a6-463a-8041-72aa08ca3cf6"
    DirectoryScopeId = "/"
    PrincipalId      = $user.Id
    ScheduleInfo     = @{
        StartDateTime = (Get-Date).ToUniversalTime().ToString("o")
        Expiration    = @{ Type = "afterDuration"; Duration = "P180D" }
    }
}

Who already has it?

powershell3 lines
Connect-MgGraph -Scopes "RoleManagement.Read.Directory"
Get-MgRoleManagementDirectoryRoleAssignment -Filter "roleDefinitionId eq '892c5842-a9a6-463a-8041-72aa08ca3cf6'" -ExpandProperty Principal |
    ForEach-Object { $_.Principal.AdditionalProperties.displayName }

Related roles

Find the smallest role for a task →