User Data Management via SCIM 2.0 and the Application Repository Service
DirX Access consumes user-related data from two types of repositories: the User Data Store and the Application Repository (originally named the Policies and Configuration Data Store). Connection to at least Application Repository must be configured to successfully run any DirX Access instance.
In this text we use username which value is defined by the Name Resolution document.
User Data Store
The User Data Store is an optional read-only source of user data for DirX Access. It must be populated and managed using other methods than DirX Access interfaces. From the DirX Product Suite perspective, this store is generally called the Corporate Directory.
Application Repository
The Application Repository is a data store to which only DirX Access can write. Any changes made by other entities might lead to an indeterministic behavior of the whole system. The Application Repository was originally intended only for policy and configuration data. However, with the rise of importance of user-specific data for DirX Access, the use of this repository has been extended.
Stored Data Types
The Application Repository was originally designed to store the data that configures DirX Access and the policies it uses for its authorization engine. These data types have the following characteristics:
-
They are read many times
-
They are written very rarely (although DirX Access provides the management capabilities to do so)
-
They are (typically) applicable across all system users
The authentication and authorization tasks performed by DirX Access have required a resource of user-specific data, such as credentials, group assignments, etc. While these have typically been supplied by the User Data Store, there have been deployments in which the User Data Store wasn’t able to provide them while it was not possible to manage the User Data Store from DirX Access. Therefore, the Application Repository can also be used as an alternative storage for user-specific data otherwise provided by the User Data Store. These types of data include parameters like number of consecutive login failures, last login date, OTP shared secret, group assignment, etc. They have the following characteristics:
-
They are read many times
-
They are occasionally written
-
They are user-specific
-
They can be alternatively stored and managed in the User-data Store
With new features such as risk-based authentication, FIDO authentication, etc., the Application Repository can also be used for other data types that are:
-
Read many times
-
Written almost the same number of times as read
-
User-specific
-
Demand more space
The following type of data emerged when DirX Access incorporated the support of federated authorization (via the UMA 2.0 standard). These data are:
-
Read and written many times
-
User-specific
-
Protected resource-specific
Data Handling
The previous section describes the different data types and their characteristics. DirX Access is internally aware of these types and takes performance into account when managing the data. Therefore, we strongly recommend not to write into the Application Repository via any other means besides DirX Access. Such actions might lead to unpredictable behavior of DirX Access.
The performance aspect induces the fact that not all of the data in their persisted form are human-readable.
Furthermore, any content of the Application Repository that is user-specific might contain private data that must be secured according to appropriate public laws and policies (e.g., GDPR). Whether the repository actually contains any private data or not is a matter of system configuration and shall be thoroughly examined.
Migration
DirX Access ensures an automated migration between product versions for all data stored in the Application Repository. This migration takes place during the first start of the upgraded version of the product.
The typically large number of stored user- and/or resource-specific data, however, may prevent a successful update during first-time startup. DirX Access is aware of the current migration state and tries to migrate any remaining old data into the new format on consecutive system startup(s). You can obtain the current state of the migration from the DXA server log file, for messages:
-
Started migration from version A to B.
-
Successful migration from version A to B.
-
Unsuccessful migration from version A to B.
-
Checking migration to version A.
-
Nothing is needed to be done for version A.
Migrating the user records might lead to resetting the “last login date” parameter of each user to a default value.
Application Repository Service
The user-specific data from Application Repository are managed by DirX Access’ OSGi Service AppRepoService. Next to the data persisting, this service provides data caching, data validation, auditing and authorization.
Data Types
The following figure shows data types managed by AppRepoService and their content. Each user (AppRepoEntity) can contain multiple records of other data types, which extends the capabilities of DirX Access, namely when it comes to the descendants of AppRepoAuthnMethod type. In the past, all the parameters contained in these types could be configured only once per single user record, which caused the system to be unable to preserve integrity when multiple authentication methods of the same type were configured. The parameters marked with (N_A) are not part of any audit record.
| Identifier | Details |
|---|---|
AppRepoEntity |
A record representing a single system user (or broadly, system client). It references all other user-specific data types relevant to the given user. It also includes the roles assigned to the user in the Application repository. |
AppRepoOtpCallback |
Parameters necessary to enable the OTP callback authentication for a given user. Each record is corresponding to an authentication method with an identifier equal to the apprepo:authn_method:id parameter. |
AppRepoRfc4226 |
Parameters necessary to enable the RFC#4226 authentication method for a given user. Each record is corresponding to an authentication method with an identifier equal to the apprepo:authn_method:id parameter. |
AppRepoRfc6238 |
Parameters necessary to enable the RFC#6238 authentication method for a given user. Each record is corresponding to an authentication method with an identifier equal to the apprepo:authn_method:id parameter. |
AppRepoPassword |
Parameters necessary to enable the Password authentication methods for a given user. Each record corresponds to an authentication method with identifier equal to the apprepo:authn_method:id parameter. |
AppRepoFidoCredential |
Data corresponding to a single FIDO (WebAuthn) credentials in a JSON structure. |
AppRepoDomainName |
The alternative name (possibly from different domain) for the superordinate entity. Authenticating with this alternative name leads to provisioning of the created SSO session with the data of the superordinate entity. |
AppRepoRbaCollector |
Data collected for the RBA Data Collector with the identifier apprepo:rba_collector:id. For more information about RBA Data Collectors and the data they collect, please, see the Risk-based Authentication section of the Advanced Topics chapter. |
AppRepoGroup |
A record representing a single group saved in the application repository. It consists of members, subGroups and roles of the group. |
The respective parameters have the following semantics:
| Identifier | Details |
|---|---|
apprepo:resource:id |
Identifier of the AppRepoData resource. Currently: single_id:[username] (for AppRepoEntity) double_id:[username]/[subnodeId] (for AppRepoAuthnMethod, AppRepoRbaCollector) opt_double_id:[username]/[subnodeId] or opt_double_id:[subnodeId] (for AppRepoFidoCredential, AppRepoDomainName) |
apprepo:type |
The AppRepoData extension type name (Class#getSimpleName()) |
apprepo:entity:username |
The user (entity in AppRepoService terminology) unique name (typically in a format of login name in corporate directory). |
apprepo:last_login_date |
Self-explanatory. |
apprepo:entity:roles |
The list of roles of the user assigned to him in the application repository. |
apprepo:authn_method:id |
The Identifier of the authentication method to which these data are relevant. |
apprepo:authn_method:nb_login_failures |
The number of login failures performed by the user for this authentication since last successful authentication. |
apprepo:otp_callback:communication_address |
The communication address used by given authentication method and given user. |
apprepo:otp_callback:last_valid |
The last valid OTP secret. |
apprepo:otp_callback:time_sent |
The time at which the last OTP secret has been sent to the user. |
apprepo:domain_name:id |
An identifier under which the entity is known in a different domain. |
apprepo:domain_name:format |
The format of the domain name. |
apprepo:fido_credential:id |
The identifier of the FIDO credential. |
apprepo:fido_credential:data |
The JSON structure containing all FIDO-credential-related data (public key, username, counter, …) |
apprepo:rba_collector:id |
The identifier of an RBA collector. |
apprepo:rba_collector:data_strs |
The data collected into the User Model - representation of user’s past behavior. Often not human readable and private. |
apprepo:rfc4226:shared_secret and apprepo:rfc6238:shared_secret |
The secret shared between the OTP authentication client and DXA server. Secret at the level of password. |
apprepo:rfc4226:counter |
The number of times a given OTP authentication method has been used. It is part of the computation of each authentication process. The number is in base16 format. |
apprepo:rfc6238:time_drift |
The time value (relative) used to determine whether or not the same authentication data has been used twice. |
apprepo:password:password |
The user’s password used for authentication. |
apprepo:group:id |
The identifier of the group stored in the application repository. |
apprepo:group:roles |
The list of roles of the group in application repository assigned to it. |
apprepo:group:members |
The list of members of the group in the application repository. |
apprepo:group:sub_groups |
The list of subgroups the group has in the application repository. |
apprepo:group:parent_groups |
The list of the parent groups of the given group, resolved from the records in the application repository (not directly saved or shown on SCIM). |
Caching
Due to the characteristics of the data managed by the AppRepoService, their caching is very limited. Most of the data are requested just once per SSO session and at this time they must be fresh. As they can be managed via multiple DirX Access Server instances in the same cluster, caching them is impractical.
Currently, the only data type that is cached is the AppRepoDomainName. The bound of the domain name to the entity’s unique name is (typically) permanent, therefore once it is cached, we can count on it not being changed.
To enable the AppRepoService caching, switch on the ‘Application Repository cache enabled’ configuration parameter of the Cluster configuration object. The caching takes place in a space-limited cache with least-recently-used eviction algorithm. The memory space is shared with the UserService cache and its size is configured by the ‘User cache initial size (bytes)’ and ‘User cache maximal size (bytes)’ of the Server configuration object. The record expiration time is configured by the ‘Application Repository expiration time (in seconds)’ configuration attribute of the Cluster configuration object.
The records of the groups saved in the application repository are cached by DXA server for performance reasons. Due to this, changes performed at groups are guaranteed to be applicable only after expiration of the period configured by “Application Repository cache expiration time” in the Cluster configuration. This cache in configure in a way that each record will always expire after the expiration time, and the time is not refreshed with each access. This is because the group record loaded in server also includes relations between the groups.
Auditing
Auditing in AppRepoService reflects the approach used originally in UserService. There are three kinds of audit events produced by AppRepoService:
-
Record-change-related: Any operation leading to a change of record in the underlying repository. These operations are at the INFO level.
-
Authorization-related: Each operation (not only change, but also reading) is subject to an authorization process. Each operation type has its own audit code. They are issued at the ERROR level.
-
System error: Auditing a true system error which may lead to a system inconsistency, issued at the ERROR level.
The Figure 2 shows the issued events together with the use cases in which they can occur.
For storing of the AppRepoService audit events, the AuditEvent class is used with the eventAttributes field filled with data from the data type class diagram that are not marked with (N_A).
The AppRepoEntity eventAttributes also contains the eventAttributes of all correlated AppRepoData. These are keyed according to the following scheme:
apprepo:entity:[apprepo_resource_id]:[audited_data_original_key]
where [apprepo_resource_id] is equal to the value of apprepo:resource:id of corresponding AppRepoData, and [audited_data_original_key] is the key used by the AppRepoData when standalone.
Authorization
The current version of the AppRepoService can be protected on two levels:
-
REST Web Service protected by the PEP deployed at the Services container,
-
Internal authorization – respective parameters of the requested resources are evaluated against policies. This follows the general internal DirX Access Authorization principles.
SCIM 2.0 in DirX Access
Since version 8.10.0, DirX Access supports the SCIM 2.0 standard. The SCIM 2.0 standard has been developed to simplify the management of user identities in (not-only) the cloud environment. DirX Access as a product is primarily oriented towards identity federation and access management and there is no plan to use the SCIM 2.0 standard for the full-blown management of the user identities. This standard is supported because DirX Access must be able to provide management of the user-specific data that are bound to its main features (already mentioned identity federation and access management).
Some of these data directly originate from the interaction between DirX Access and its users, e.g., FIDO credentials, RBA data, etc. Hence, it would be impractical to rely on any third product to deal with the management of these data, even more so as these data are stored in the Application Repository which is managed by DirX Access only.
Use Cases
These are the most common use cases for which the SCIM 2.0 interface of DirX Access might be used:
-
Groups and Roles management of users stored in Application repository.
-
FIDO credentials management. A user can register its FIDO (including WebAuthn) credentials via the FIDO protocol’s registration flow. The FIDO UAF standard also enables deregistration of such data, but only for the holder of the registered authenticator. To enable the operations of deregistration and listing all registered credentials to the administrators (support), the FIDO credentials data type has been exposed via the DXA SCIM 2.0 interface.
-
GDPR compliance. The interface can be used to manage the user-specific data to comply with GDPR legislation.
-
OTP credentials provisioning and management. OTP credentials and connected data can be provisioned via SCIM 2.0, which simplifies the registration of new shared secrets, changing the communication addresses, etc.
-
Password credentials authentication and management. Password credentials can be used via SCIM 2.0 to authenticate a preregistered entity. Changing the password is also possible.
-
Resetting the number of consecutive login failures. When the configuration uses the number of consecutive login failures in the authentication process, if the user reaches the threshold number, its account is locked. With the subsequent unlock of the account, this number needs to be reset, which can be done via this interface.
-
Setting the domain names of an entity. The domain names can be used to link the user with a specified AppRepoEntity in the application repository during the authentication process (if storing domain names in AppRepo is enabled on the Cluster). The SCIM endpoint can be used to set the domain names of the entity.
Architecture
As with all the other Web Services in DirX Access (both RESTful and SOAP), the SCIM 2.0 endpoint is deployed at the DirX Access Services Container. It uses the third-party open-source libraries UnboundID SCIM 2 SDK for Java that implement the SCIM 2.0 business logic. The whole ScimService is supported by the Jersey REST framework.
DirX Access uses the SCIM 2.0 schema extension mechanism and introduces its own data types. These data types correspond to the data types at the lower-level of AppRepoService. Namely:
| Identifier | Contains |
|---|---|
Entity |
|
FidoCredential |
|
OtpCallback |
|
Rfc4226 |
|
Rfc6238 |
|
Password |
|
DomainName |
|
Standard endpoints |
|
Group |
|
User |
|
More information about the DXA SCIM 2.0 endpoint can be found in the DirX Access Integration Guide.
Versioning
DirX Access supports the SCIM standard version 2.0. As the endpoint supports custom SCIM resource extensions, we provide its further versioning, according to the semantic versioning standard.
Used version can be directly seen from the endpoint’s address, which is in the format: https://[server_address]/scim/1_0_0/
Authorization
The SCIM 2.0 endpoint can be found at the DirX Access Services Container, hence, it is protected by the DirX Access PEP. By default, the PEP provides all access rights to the administrators’ roles and prevents access to any other user.
|
Be aware that SCIM URL syntax might be in collision with Resource exclusion on designated PEP protecting the SCIM endpoint. More information about Resource exclusion can be found also here: Plain Web PEP. |
Groups and Users stored in Application Repository
Starting with version 9.1, DirX Access allows storing groups and users along with their roles in the DXA application-repository (as opposed to User Repository not managed by DXA).
This feature necessary in deployments without dedicated user repository.
The management of groups and their members can be performed through the SCIM 2.0 API.
To support this functionality, DirX Access provides extended SCIM endpoints for Groups and Users.
By default, the /Groups endpoint and administration of users through the /Users endpoint is disabled and must be enabled in “SCIM application” configuration.
Through the SCIM API it is possible to :
-
manage groups (and their hierarchy),
-
manage users (and their assignments to groups),
-
assign roles to users,
-
and assign roles to groups.
A detailed guide with examples on how to interact with these endpoints is available at: Users and Groups SCIM 2.0 endpoints .
Generally, the names of the groups and roles stored in the application-repository should be unique within the scope of given application-repository (as the groups are identified by their name
CN).
How the groups are imprinted into the request injections or JWT can be changed using the "`Group format`" configuration.
|
According to the LDAP specification (RFC2256) a group should have at least one member when creating it (you can just use a placeholder non-existent member also). |
The records of the groups saved in the application repository are cached by DXA server for performance reasons. Due to this, changes performed at groups are guaranteed to be applicable only after expiration of the period configured by “Application Repository cache expiration time” in the Cluster configuration.
To enable the server to store groups in application repository and to process the membership from those groups for users, some configuration must be done.
First in the SCIM application configuration (Configuration → REST services → SCIM) you should check the option Enable SCIM endpoints (application-repository groups and roles) that enables the new
/Groups SCIM endpoint and also the option to create and modify users in application-repository through the SCIM API.
When disabled, the server will not permit management of groups and users trough SCIM API.
Administrators should themselves define needed politics to protect these endpoints when enabling them.
This is done in Configuration → Servers → Cluster → Application repository service. The options described bellow all affect the inner behavior connected to the Groups and Roles of the users stored in the Application Repository.
-
Enable application-repository groups: If this option is enabled, the group memberships of the user will be retrieved from the Application Repository. These groups will be displayed on the SCIM
/Groupsendpoint and can be managed through it. The memberships will also be reflected in the user details on the SCIM/Usersendpoint. If resolution of groups recursively is enabled, the groups that the direct groups are sub groups of will also be imprinted (and also be shown on the SCIM/Usersendpoint). -
Use ‘member of’ attribute (application-repository groups): This option defines how group membership is determined for users in LDAP. When enabled, the
dirxMemberOf(for DirX directory) ormemberOf(for Active Directory) attribute of the user will be utilized instead of searching for the group membership through thememberattribute of the group. This method typically results in faster membership resolution. Note that using thedirxMemberOfattribute will also resolve nested group memberships if there are any, as the groups returned are managed by DirX directory in this case. Some specific configuration is needed in the DirX directory. This includes setting the initial index for the “member” attribute in the DirX directory under Schema -> Database and configuring Prescriptive ACI to allow reading thedirxMemberOfattribute under Configuration -> Root -> app repository Administrative point -> Access Control Subentries. -
Resolve group membership recursively (application-repository groups): Membership will be resolved even for groups that are a parent group to the group user is a direct member of. For DirX Directory the
dirxImportGroupobject class is used and the sub groups are saved in thedirxImportFromattribute. To determine the membership either thedirxMemberOfattribute is used or recursive search if the member-of attribute is disabled. According to the DXD documentation, the initial index should be set for the member attribute for full support of nested groups. For Active Directory sub groups are saved in thememberattribute and are recursively searched for if enabled. On the SCIM/Groupsendpoint only the direct sub groups are shown. -
Enable application-repository roles: If this feature is enabled, role assignments can be stored in the Application Repository and subsequently retrieved for users. These roles are assigned to users using the
Rolesattribute through the SCIM API. -
Resolve group roles (application-repository groups): When enabled, the roles of users can also be determined from roles assigned to groups of which the user is a member. Since SCIM 2.0 doesn’t define roles for groups by default, the DXA group extension
urn:net:atos:dirx:access:scim:schemas:extension:2.0:GroupRolescan be utilized to assign roles to groups. The extension definition can be found at:{scim_rest_web_application_location}/Schemas/urn:net:atos:dirx:access:scim:schemas:extension:2.0:GroupRoles. Please note that the resolution of roles from the application-repository must be enabled to enable the group role resolution. If recursive resolution of groups is enabled, roles from those groups will also be inherited. -
Group format (application-repository groups): Specifies the format that will be used when imprinting the group membership in the groups saved in the application-repository. If empty, only the name of the groups will be returned. The format can contain placeholders for the group name (CN) (#1) and a domain (#2). The placeholders are replaced with the actual values when the group is added to a request injection. This is used in following features:
-
request-injection,
-
SAML attribute injection,
-
OAuth attribute injection,
-
XACML attribute injection.
-
-
Group domain (application-repository groups): Specifies the domain that will be used in the “Group name format” in place of the #2 placeholder. This only applies to the groups in application repository.
When the option to use Groups and Roles from the Application Repository is enabled, these groups and roles will be utilized during any group or role resolution within the server. For instance, if a Request Injection is configured to imprint group assignments using the User Service as a source, the group membership will now also be retrieved from the Groups in the Application Repository.
Roles can be employed similarly, or they can be used to assign roles to users for use in Role-Based Access Control (RBAC) authorization.
Matching groups in OAuth token with groups in the application-repository.
DirX Access allows for matching groups from the OAuth token with those in the application repository. To enable this feature, navigate to “Configuration → Authentication → Methods → OAuth”. When “Match OAuth groups with appRepo groups” is activated, the groups within the OAuth token will be associated with corresponding groups in the application repository, if they have the same group domain and format as specified in the “Subject Template” for the application-repository groups.
Based on the “Subject Template” configuration, which governs the enablement of roles for groups, the roles associated with these groups will be appended to the user’s role assignments. If recursive resolution of group membership is enabled, roles from parent groups will also be included.
When recursive resolution of group membership is active in the “Subject Template”, memberships in recursively resolved parent groups will be added to the user’s server subject’s group assignments.
Groups and Roles domains
DirX Access enables sourcing of groups for authenticated sessions from three different directions:
-
User repository,
-
Application repository,
-
OAuth tokens.
It is up to the administrator to declare domain relationships between these sources, and by this enable for example recursive resolution starting in one source leading to another source (if they share a domain).
For example if OAuth tokens created by trusted third party identity provider include groups, the administrator can decide if the third-party groups are related to the groups in the application-repository, and use corresponding OAuth authentication method and Subject Template to declare the same domain and format. Contrary, if the third-party IdP is in no relation to the domain managed by DirX Access, this can be reflected by different configured domains.
User roles assigned within the user or application repository serve as foundational elements in Role-Based Access Control (RBAC) policies. While these roles may not inherently possess a specific domain, administrators have the capability to configure a domain for roles received from a trusted Identity Provider (IdP), thereby distinguishing between various roles effectively. Should there be a preference not to directly align roles in the OAuth token with those defined in policies, administrators can opt to configure the domain and format for these roles. This configuration process can be accomplished through the "`Configuration → Authentication → Methods → OAuth`" interface, where both role format and domain can be precisely specified (note that the domain is shared for both groups and roles).
Exporting large user records from application repository
For cases where all user and group records are to be exported and the number of records in the range of thousands and more, some additional settings in LDAP must be performed as the number of possible search results can be limited by LDAP. This is described in LDAP .
Managing Domain names via SCIM 2.0
Domain names are one of the sub-entries of entity in DirX Access. The domain name can be used to link the user with a specified AppRepoEntity in the application repository during the authentication process. This functionality is available when domain name storage in AppRepo is enabled in the Cluster Authentication configuration
The domain name has a format property that specifies its expected structure. The format must match the actual domain name, or authentication may fail. The formatting is described in Name Resolution document.
When domain name storage is enabled, DirX Access automatically creates a domain name identical to the unique name in the application repository after a successful authentication. This is done to ensure that the user can be authenticated with the domain name in the future and that the format used to build the unique name is stored. Therefore, when creating a domain name for a new entity, you should also create a domain name matching the unique name of the entity.
Domain names should be unique across the system. This ensures that a domain name can be searched for without the entity ID, simplifying lookups and authentication.