The DLP policy match for a user-based directory server group requires a DLP agent to get Directory Groups for logged-in users from Active Directory. This DLP policy match is done using something called a "distinguished name" (DN) attribute of the Directory Group. Microsoft doesn't automatically sync this DN attribute for directory groups with Azure AD (Azure Active Directory). However, they offer two methods to do this synchronization. This document provides a step-by-step guide on how to set up this synchronization with Azure AD.
The two possible way to map Groups distinguished name to Azure AD attributes (Predefined/Custom directory extension) are:
Below sub-section details out steps required in respective method/approach.
Steps:
As we know, AAD extension attributes are not available in azure AD connect. So, we will create a custom extension attribute on the AAD and will map it to a Group DN.
Steps:
GET https://graph.microsoft.com/v1.0/applications?$filter=identifierUris/any(uri:urieq 'api://<tenantId>/CloudSyncCustomExtensionsApp')
Ex. https://graph.microsoft.com/v1.0/applications?$filter=identifierUris/any(uri:uri eq 'api://<api key>/CloudSyncCustomExtensionsApp')
3. If not exist, then create the app:
POST https://graph.microsoft.com/v1.0/applications
{
"displayName": "CloudSyncCustomExtensionsApp",
"identifierUris": ["api://<tenantId>/CloudSyncCustomExtensionsApp"]
}
Example -
POST https://graph.microsoft.com/v1.0/applications
{
"displayName": "CloudSyncCustomExtensionsApp",
"identifierUris": ["api://<api key>/CloudSyncCustomExtensionsApp"]
}
4. It will result into the app getting displayed on the Azure portal:
5. Now, check if Service Principal exists for CloudSyncCustomExtensionsApp application:
GET https://graph.microsoft.com/v1.0/servicePrincipals?$filter=(appId eq '<appId>')
Example -
GET https://graph.microsoft.com/v1.0/servicePrincipals?$filter=(appId eq '<app ID>')
6. If Service Principal doesn't exist then create it for CloudSyncCustomExtensionsApp application as follows:
POST. https://graph.microsoft.com/v1.0/servicePrincipals
Content-type: application/json
{
"appId":
"<appId>"
}
Example-
POST. https://graph.microsoft.com/v1.0/servicePrincipals
Content-type: application/json
{
"appId":
"<app id>"
}
7. Now get the ID of the app you're working on. In my case it is "CloudSyncCustomExtensionsApp" as follows:
GET https://graph.microsoft.com/v1.0/application
Example output:
"id": "<app id>",
"displayName": "CloudSyncCustomExtensionsApp",
(Note: Replace the ID property below with the ID retrieved in the previous step. You'll need to use the "ID" attribute and not the "appId")
8. Now, create a new directory extension definition, represented by an extensionProperty object as follows
POST. https://graph.microsoft.com/v1.0/applications/<id>/extensionProperties
{
"name": "<userDefinedName>",
"dataType": "String",
"targetObjects": [
"Group"
]
}
Example-
POST https://graph.microsoft.com/v1.0/applications/<api key>/extensionProperties
{
"name": "CustomeExtensionAttributeDN",
"dataType": "String",
"targetObjects": [
"Group"
]
}
Response :
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications('<api key>')/extensionProperties/$entity",
"id": "<app id>",
"deletedDateTime": null,
"appDisplayName": "CloudSyncCustomExtensionsApp",
"dataType": "String",
"isSyncedFromOnPremises": false,
"name": "extension_<app id>_CustomeExtensionAttributeDN",
"targetObjects": [
"Group"
]
}
9. Now on the Azure portal, navigate to the "Azure Ad Connect Cloud Sync → Attribute Mapping" and create the mapping for extended attributed created above:
10. Once the Azure AD Connect Cloud Sync cycle will run then this newly created custom attribute will be mapped to Group distinguished name.
(Once above changes are done, to verify, you can follow step no:16 in previous subsection)