Skip to content

Commit 8e2cf8c

Browse files
authored
Add CustomSecurityAttributes column to ServicePrincipal table (#1055)
1 parent 6bc97be commit 8e2cf8c

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/powershell/assets/export-tenant.config.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Note: Avoid using the same names as used for the "General Parameters" section of
8787
@{
8888
Name = 'ServicePrincipal'
8989
Uri = 'beta/servicePrincipals'
90-
QueryString = '$expand=appRoleAssignments&$top=999'
90+
QueryString = '$expand=appRoleAssignments&$top=999&$select=id,deletedDateTime,accountEnabled,alternativeNames,createdByAppId,createdDateTime,deviceManagementAppType,appDescription,appDisplayName,appId,applicationTemplateId,appOwnerOrganizationId,appRoleAssignmentRequired,assignmentRequiredForPrincipalTypes,description,disabledByMicrosoftStatus,displayName,errorUrl,homepage,isAuthorizationServiceEnabled,isDisabled,isManagementRestricted,loginUrl,logoutUrl,notes,notificationEmailAddresses,preferredSingleSignOnMode,preferredTokenSigningKeyEndDateTime,preferredTokenSigningKeyThumbprint,publisherName,replyUrls,samlMetadataUrl,samlSLOBindingType,servicePrincipalNames,servicePrincipalType,signInAudience,tags,tokenEncryptionKeyId,certification,samlSingleSignOnSettings,addIns,api,appRoles,info,keyCredentials,publishedPermissionScopes,passwordCredentials,resourceSpecificApplicationPermissions,verifiedPublisher,customSecurityAttributes'
9191
RelatedPropertyNames = @('oauth2PermissionGrants')
9292
Type = 'Default' # PrivilegedGroup
9393

src/powershell/doc/readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ optionally to Azure. When connecting using Microsoft Graph PowerShell, the follo
5454

5555
The consent prompt is only displayed if the Graph PowerShell app does not already have these permissions.
5656

57+
> **Note:** To read Custom Security Attributes on service principals, the account running the assessment must also be assigned the **Attribute Assignment Reader** (or **Attribute Assignment Administrator**) Entra ID role. Without this role, Custom Security Attribute values will be returned as null.
58+
5759
- AuditLog.Read.All
5860
- CrossTenantInformation.ReadBasic.All
61+
- CustomSecAttributeAssignment.Read.All
5962
- DeviceManagementApps.Read.All
6063
- DeviceManagementConfiguration.Read.All
6164
- DeviceManagementManagedDevices.Read.All

src/powershell/private/db/content/Get-TableSchemaConfig.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ function Get-TableSchemaConfig {
2323
)
2424

2525
$configs = @{
26+
'ServicePrincipal' = @{
27+
'use_union_by_name' = $true
28+
'sample_size' = 50
29+
'reason' = 'customSecurityAttributes is an open complex type with varying nested keys across service principals'
30+
}
2631
'ServicePrincipalSignIn' = @{
2732
'use_union_by_name' = $true
2833
'sample_size' = 50 # Sample more files to avoid schema inference issues

src/powershell/public/Get-ZtGraphScope.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Function Get-ZtGraphScope {
3434
$scopes = @( #IMPORTANT: Read note above before adding any new scopes.
3535
'AuditLog.Read.All'
3636
'CrossTenantInformation.ReadBasic.All'
37+
'CustomSecAttributeAssignment.Read.All'
3738
'DeviceManagementApps.Read.All'
3839
'DeviceManagementConfiguration.Read.All'
3940
'DeviceManagementManagedDevices.Read.All'

0 commit comments

Comments
 (0)