Chapter 14. Configuring certificate mapping if AD user entry contains no certificate or mapping data
You can enable certificate mapping in IdM if the IdM deployment is in a trust with Active Directory (AD), the user is stored in AD, and the user entry in AD contains neither the whole certificate nor certificate mapping data.
14.1. Prerequisites Copy linkLink copied to clipboard!
- The user does not have an account in IdM.
-
The user has an account in AD which contains neither the whole certificate nor the
altSecurityIdentitiesattribute, the AD equivalent of the IdMcertmapdataattribute. The IdM administrator has done one of the following:
-
Added the whole AD user certificate to the AD user’s
user ID overridein IdM. - Created a certificate mapping rule that maps to an alternative field in the certificate, such as Subject Alternative Name or the SID of the user.
-
Added the whole AD user certificate to the AD user’s
14.2. Adding a certificate mapping rule in the IdM web UI if AD user entry contains no certificate or mapping data Copy linkLink copied to clipboard!
The IdM Web UI allows administrators to define rules that match presented certificates against ID overrides. By specifying a mapping rule like (userCertificate;binary={cert!bin}), the system compares the binary certificate data to the override entry created in IdM.
Procedure
- Log into the IdM web UI as an administrator.
-
Navigate to
AuthenticationCertificate Identity Mapping RulesCertificate Identity Mapping Rules. Click
Add.Adding a new certificate mapping rule in the IdM web UI image::new-certmaprule-add.png[Screenshot of the IdM Web UI displaying the "Certificate Identity Mapping Rules" sub-page from the Authentication tab. The "Add" button to the right is highlighted]
- Enter the rule name.
Enter the mapping rule. To have the whole certificate that is presented to IdM for authentication compared to the certificate stored in the user ID override entry of the AD user entry in IdM:
(userCertificate;binary={cert!bin})(userCertificate;binary={cert!bin})Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteAs the certificate also contains the user principal name as the SAN, or with the latest updates, the SID of the user in the SID extension of the certificate, you can also use these fields to map the certificate to the user. For example, if using the SID of the user, replace this mapping rule with
LDAPU1:(objectsid={sid}). For more information on certificate mapping, see thesss-certmapman page on your system.Enter the matching rule. For example, to only allow certificates issued by the
AD-ROOT-CAof theAD.EXAMPLE.COMdomain to authenticate:<ISSUER>CN=AD-ROOT-CA,DC=ad,DC=example,DC=com
<ISSUER>CN=AD-ROOT-CA,DC=ad,DC=example,DC=comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the domain name. For example, to search for users in the
ad.example.comdomain:Certificate mapping rule for a user with no certificate or mapping data stored in AD image::certmaprule-add-details-ad-cert.png[Screenshot of the "Add Certificate Identity Mapping Rule" pop-up window with the following fields filled in: Rule name (which is required) - Mapping rule - Matching rule. The "Priority" field is blank and there is also an Add button next to the "Domain name" label.]
-
Click
Add. The System Security Services Daemon (SSSD) periodically re-reads the certificate mapping rules. To force the newly-created rule to be loaded immediately, restart SSSD in the CLI:
systemctl restart sssd
# systemctl restart sssdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
14.3. Adding a certificate mapping rule in the IdM CLI if AD user entry contains no certificate or mapping data Copy linkLink copied to clipboard!
Administrators define mapping rules by using the IdM CLI to link certificates to AD users. The ipa certmaprule-add command creates a policy that matches the certificate’s binary data or specific attributes against the ID override entry stored in the Default Trust View.
Procedure
Obtain the administrator’s credentials:
kinit admin
# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the mapping rule and the matching rule the mapping rule is based on. To have the whole certificate that is presented for authentication compared to the certificate stored in the user ID override entry of the AD user entry in IdM, only allowing certificates issued by the
AD-ROOT-CAof theAD.EXAMPLE.COMdomain to authenticate:ipa certmaprule-add simpleADrule --matchrule '<ISSUER>CN=AD-ROOT-CA,DC=ad,DC=example,DC=com' --maprule '(userCertificate;binary={cert!bin})' --domain ad.example.com# ipa certmaprule-add simpleADrule --matchrule '<ISSUER>CN=AD-ROOT-CA,DC=ad,DC=example,DC=com' --maprule '(userCertificate;binary={cert!bin})' --domain ad.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteAs the certificate also contains the user principal name as the SAN, or with the latest updates, the SID of the user in the SID extension of the certificate, you can also use these fields to map the certificate to the user. For example, if using the SID of the user, replace this mapping rule with
LDAPU1:(objectsid={sid}). For more information on certificate mapping, see thesss-certmapman page on your system.The System Security Services Daemon (SSSD) periodically re-reads the certificate mapping rules. To force the newly-created rule to be loaded immediately, restart SSSD:
systemctl restart sssd
# systemctl restart sssdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
14.4. Adding a certificate to an AD user’s ID override in the IdM web UI Copy linkLink copied to clipboard!
ID overrides allow administrators to attach specific certificates to AD user identities within IdM. This IdM Web UI procedure stores the certificate data in the Default Trust View, enabling the system to validate authentication requests against the mapping rules.
Procedure
-
Navigate to
IdentityID ViewsDefault Trust View. Click
Add.Adding a new user ID override in the IdM web UI image::new-useridoverride-add.png[Screenshot of the IdM Web UI displaying the "ID Views" page from the Identity tab. The Add button on the right is highlighted.]
-
In the
User to overridefield, enterad_user@ad.example.com. Copy and paste the certificate of
ad_userinto theCertificatefield.Configuring the User ID override for an AD user image::useridoverride-add-details.png[Screenshot displaying the "Add User ID override" pop-up window with the following fields: User to override (which is required) - User login - GECOS - UID - GID - Certificate (which has been filled in with the plaintext version of a certificate).]
-
Click
Add.
Verification
Use the
sss_cacheutility to invalidate the record ofad_user@ad.example.comin the SSSD cache and force a reload of thead_user@ad.example.cominformation:sss_cache -u ad_user@ad.example.com
# sss_cache -u ad_user@ad.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
ipa certmap-matchcommand with the name of the file containing the certificate of the AD user:ipa certmap-match ad_user_cert.pem
# ipa certmap-match ad_user_cert.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output confirms that you have certificate mapping data added to
ad_user@ad.example.comand that a corresponding mapping rule defined in Adding a certificate mapping rule if the AD user entry contains no certificate or mapping data exists. This means that you can use any certificate that matches the defined certificate mapping data to authenticate asad_user@ad.example.com.
14.5. Adding a certificate to an AD user’s ID override in the IdM CLI Copy linkLink copied to clipboard!
The ipa idoverrideuser-add-cert command links a Base64-encoded certificate directly to an AD user’s ID override. This CLI method establishes the necessary data association for the certificate mapping rule to successfully authenticate the user.
Procedure
Obtain the administrator’s credentials:
kinit admin
# kinit adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Store the certificate blob in a new variable called
CERT:CERT=$(openssl x509 -in /path/to/certificate -outform der|base64 -w0)
# CERT=$(openssl x509 -in /path/to/certificate -outform der|base64 -w0)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the certificate of
ad_user@ad.example.comto the user account using theipa idoverrideuser-add-certcommand:ipa idoverrideuser-add-cert ad_user@ad.example.com --certificate $CERT
# ipa idoverrideuser-add-cert ad_user@ad.example.com --certificate $CERTCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Use the
sss_cacheutility to invalidate the record ofad_user@ad.example.comin the SSSD cache and force a reload of thead_user@ad.example.cominformation:sss_cache -u ad_user@ad.example.com
# sss_cache -u ad_user@ad.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
ipa certmap-matchcommand with the name of the file containing the certificate of the AD user:ipa certmap-match ad_user_cert.pem
# ipa certmap-match ad_user_cert.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output confirms that you have certificate mapping data added to
ad_user@ad.example.comand that a corresponding mapping rule defined in Adding a certificate mapping rule if the AD user entry contains no certificate or mapping data exists. This means that you can use any certificate that matches the defined certificate mapping data to authenticate asad_user@ad.example.com.