Chapter 57. 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).
Since 2019, Microsoft AD enforces the use of RBCD when both target and proxy services belong to different forests.
57.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 next 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.
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.
57.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 theclient.example.test
host. -
A
nfs/client.example.test
service keytab exists. -
A keytab
/path/to/web-service.keytab
forHTTP/client.example.test
exists.
Procedure
On the
client.example.test
host, obtain a Kerberos ticket:Copy to Clipboard Copied! Toggle word wrap Toggle overflow kinit -k
# kinit -k
Define the RBCD ACL:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ipa service-add-delegation nfs/client.example.test HTTP/client.example.test
# 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
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:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ipa service-show nfs/client.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
Obtain a Kerberos ticket for the HTTP service principal:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow kinit -kt http.keytab HTTP/client.example.test
# kinit -kt http.keytab HTTP/client.example.test
Verify that the ticket granting ticket is present:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow klist -f
# 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
Perform a protocol transition on behalf of
testuser
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow kvno -U testuser -P nfs/client.example.test
# kvno -U testuser -P nfs/client.example.test nfs/client.example.test@EXAMPLE.TEST: kvno = 1
Verify that tickets obtained during protocol transition on behalf of
testuser
are present:Copy to Clipboard Copied! Toggle word wrap Toggle overflow klist -f
# 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
Additional resources