Chapter 56. Using resource-based constrained delegation in IdM You can use resource-based constrained delegation (RBCD) to allow access to a service. Using RBCD allows a granular control of delegation on a resource level. Access can be set by the owner of the service to which credentials are delegated. This is useful, for example, in an integration between Identity Management (IdM) and Active Directory (AD). Microsoft AD requires RBCD when both target and proxy services belong to different forests, as of 2019. Additional resources Using constrained delegation in IdM 56.1. Resource-based constrained delegation in IdM RBCD allows for greater control over access delegation. This chapter covers the main differences between RBCD and general constrained delegation. RBCD versus general constrained delegation Resource-based constrained delegation (RBCD) differs from general constrained delegation in multiple aspects: Granularity: In RBCD, delegation is specified at the resource level. Access granting responsibility: in RBCD, access is controlled by the service owner rather than by the Kerberos administrator. In general constrained delegation, the Service for User to Proxy ( S4U2proxy ) extension obtains a service ticket for another service on behalf of a user. The second service is typically a proxy performing work on behalf of the first service, under the authorization context of the user. Using constrained delegation eliminates the need for the user to delegate their full ticket-granting ticket (TGT). How IdM uses constrained delegation Identity Management (IdM) traditionally uses the Kerberos S4U2proxy feature to allow the web server framework to obtain an LDAP service ticket on a user's behalf. When IdM integrates with Active Directory (AD), the IdM framework also uses constrained delegation to operate on behalf of a user towards various services, including SMB and DCE RPC end-points on both the IdM and AD sides. How IdM can use RBCD When an application in an IdM domain operates on behalf of users against a different service, it requires a delegation permission. In general constrained delegation, this requires the domain administrator to explicitly create a rule to allow a first service to delegate user credentials to the service. Using RBCD, the delegation permission can be created by the owner of the service to which the credentials are delegated. For IdM-AD integration, when both services are part of the same IdM domain, the RBCD permission can be granted on the IdM side. Important Currently, only services in the IdM domain can be configured with RBCD rules. If the target service is part of an AD domain, the permission can only be granted on the AD side. As AD domain controllers cannot resolve IdM service information to create the rule, this is not currently supported. 56.2. Using RBCD to delegate access to a service To use RBCD to delegate access to a service, add a rule on the host where the service is running. This example procedure describes how to delegate user credentials to a file server nfs/client.example.test for a web application with a Kerberos service HTTP/client.example.test . You can do this on the client.example.test host, because a host always manages services running on itself. Prerequisites You have access to the /etc/krb5.keytab file of the client.example.test host. A nfs/client.example.test service keytab exists. A keytab /path/to/web-service.keytab for HTTP/client.example.test exists. Procedure On the client.example.test host, obtain a Kerberos ticket: Define the RBCD ACL: Verification To verify that the delegation is set up correctly, you can simulate a testuser user logging in through the HTTP service and performing a protocol transition to the NFS service. View the NFS service to verify that the delegation rule is present: Obtain a Kerberos ticket for the HTTP service principal: Verify that the ticket granting ticket is present: Perform a protocol transition on behalf of testuser : Verify that tickets obtained during protocol transition on behalf of testuser are present:

Commands:
kinit -k
ipa service-add-delegation nfs/client.example.test HTTP/client.example.test ------------------------------------------------------- Added new resource delegation to the service principal "nfs/client.example.test@EXAMPLE.TEST" ------------------------------------------------------- Principal name: nfs/client.example.test@EXAMPLE.TEST Delegation principal: HTTP/client.example.test@EXAMPLE.TEST
ipa service-show nfs/client.example.test Principal name: nfs/client.example.test@EXAMPLE.TEST Principal alias: nfs/client.example.test@EXAMPLE.TEST Delegation principal: HTTP/client.example.test@EXAMPLE.TEST Keytab: True Managed by: client.example.test
kinit -kt http.keytab HTTP/client.example.test
klist -f Ticket cache: KCM:0:99799 Default principal: HTTP/client.example.test@EXAMPLE.TEST Valid starting Expires Service principal 10/13/2023 14:39:23 10/14/2023 14:05:07 krbtgt/EXAMPLE.TEST@EXAMPLE.TEST Flags: FIA
kvno -U testuser -P nfs/client.example.test nfs/client.example.test@EXAMPLE.TEST: kvno = 1
klist -f Ticket cache: KCM:0:99799 Default principal: HTTP/client.example.test@EXAMPLE.TEST Valid starting Expires Service principal 10/13/2023 14:39:38 10/14/2023 14:05:07 HTTP/client.example.test@EXAMPLE.TEST for client testuser@EXAMPLE.TEST, Flags: FAT 10/13/2023 14:39:23 10/14/2023 14:05:07 krbtgt/EXAMPLE.TEST@EXAMPLE.TEST Flags: FIA 10/13/2023 14:39:38 10/14/2023 14:05:07 nfs/client.example.test@EXAMPLE.TEST for client testuser@EXAMPLE.TEST, Flags: FAT