Questo contenuto non è disponibile nella lingua selezionata.
Chapter 11. Configuring certificate mapping for users stored in IdM
You can enable certificate mapping in IdM if the user for whom certificate authentication is being configured is stored in IdM. You must complete the following tasks:
- Set up a certificate mapping rule so that IdM users with certificates that match the conditions specified in the mapping rule and in their certificate mapping data entries can authenticate to IdM.
- Enter certificate mapping data to an IdM user entry so that the user can authenticate using multiple certificates provided that they all contain the values specified in the certificate mapping data entry.
11.1. Prerequisites Copia collegamentoCollegamento copiato negli appunti!
- The user has an account in IdM.
- The administrator has either the whole certificate or the certificate mapping data to add to the user entry.
11.2. Adding a certificate mapping rule in the IdM web UI for users stored in IdM Copia collegamentoCollegamento copiato negli appunti!
The IdM Web UI provides a graphical interface for defining mapping policies. Administrators configure rules to filter certificates based on the Issuer and define how the system extracts identity information to match against stored user records.
Procedure
- Log in to 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-tab from the Authentication tab. The "Add" button at the right of the page is highlighted.]
- Enter the rule name.
Enter the mapping rule. For example, to make IdM search for the
IssuerandSubjectentries in any certificate presented to them, and base its decision to authenticate or not on the information found in these two entries of the presented certificate:(ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500})Enter the matching rule. For example, to only allow certificates issued by the
Smart Card CAof theEXAMPLE.ORGorganization to authenticate users to IdM:<ISSUER>CN=Smart Card CA,O=EXAMPLE.ORGEntering the details for a certificate mapping rule in the IdM web UI image::certmaprule-add-details1.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
Addat the bottom of the dialog box to add the rule and close the box. 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 sssdNow you have a certificate mapping rule set up that compares the type of data specified in the mapping rule that it finds on a smart card certificate with the certificate mapping data in your IdM user entries. Once it finds a match, it authenticates the matching user.
11.3. Adding a certificate mapping rule in the IdM CLI for users stored in IdM Copia collegamentoCollegamento copiato negli appunti!
The ipa certmaprule-add command defines mapping policies directly from the terminal. Administrators use this utility to script the creation of rules that filter certificates by issuer and extract specific attributes for user identification.
Procedure
Obtain the administrator’s credentials:
# kinit adminEnter the mapping rule and the matching rule the mapping rule is based on. For example, to make IdM search for the
IssuerandSubjectentries in any certificate presented, and base its decision to authenticate or not on the information found in these two entries of the presented certificate, recognizing only certificates issued by theSmart Card CAof theEXAMPLE.ORGorganization:# ipa certmaprule-add rule_name --matchrule '<ISSUER>CN=Smart Card CA,O=EXAMPLE.ORG' --maprule '(ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500})'------------------------------------------------------- Added Certificate Identity Mapping Rule "rule_name" ------------------------------------------------------- Rule name: rule_name Mapping rule: (ipacertmapdata=X509:<I>{issuer_dn!nss_x500}<S>{subject_dn!nss_x500}) Matching rule: <ISSUER>CN=Smart Card CA,O=EXAMPLE.ORG Enabled: TRUEThe 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 sssdNow you have a certificate mapping rule set up that compares the type of data specified in the mapping rule that it finds on a smart card certificate with the certificate mapping data in your IdM user entries. Once it finds a match, it authenticates the matching user.
11.4. Adding certificate mapping data to a user entry in the IdM web UI for users stored in IdM Copia collegamentoCollegamento copiato negli appunti!
Administrators link authentication credentials to user accounts by using the IdM Web UI. This interface supports uploading full certificate files or manually entering the specific Issuer and Subject strings required to validate the user’s identity.
Procedure
- Log into the IdM web UI as an administrator.
-
Navigate to
UsersActive usersidm_user. -
Find the
Certificate mapping dataoption and clickAdd. Choose one of the following options:
If you have the certificate of
idm_user:On the command line, display the certificate using the
catutility or a text editor:[root@server ~]# cat idm_user_certificate.pem-----BEGIN CERTIFICATE----- MIIFFTCCA/2gAwIBAgIBEjANBgkqhkiG9w0BAQsFADA6MRgwFgYDVQQKDA9JRE0u RVhBTVBMRS5DT00xHjAcBgNVBAMMFUNlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0x ODA5MDIxODE1MzlaFw0yMDA5MDIxODE1MzlaMCwxGDAWBgNVBAoMD0lETS5FWEFN [...output truncated...]- Copy the certificate.
In the IdM web UI, click
Addnext toCertificateand paste the certificate into the window that opens up.Adding a user’s certificate mapping data: certificate image::user-add-cert.png[Screenshot of a page displaying settings for the user "demouser" with an Identity Settings column on the left with entries such as Job Title - First name - Last name - Full name - Display name. The "Account Settings" column is on the right with entries such as User login - Password - UID - GID. The "Add" button for the "Certificates" entry is highlighted.]
-
If you do not have the certificate of
idm_userat your disposal but know theIssuerand theSubjectof the certificate, check the radio button ofIssuer and subjectand enter the values in the two respective boxes.
Adding a user’s certificate mapping data: issuer and subject image::user-add-certdata.png[Screenshot of the "Add Certificate Mapping Data" pop-up window with two radial button options: "Certificate mapping data" and "Issuer and subject." "Issuer and subject" is selected and its two fields (Issuer and Subject) have been filled out.]
-
If you do not have the certificate of
-
Click
Add.
Verification
If you have access to the whole certificate in the .pem format, verify that the user and certificate are linked:
Use the
sss_cacheutility to invalidate the record ofidm_userin the SSSD cache and force a reload of theidm_userinformation:# sss_cache -u idm_userRun the
ipa certmap-matchcommand with the name of the file containing the certificate of the IdM user:# ipa certmap-match idm_user_cert.pem-------------- 1 user matched -------------- Domain: IDM.EXAMPLE.COM User logins: idm_user ---------------------------- Number of entries returned 1 ----------------------------The output confirms that now you have certificate mapping data added to
idm_userand that a corresponding mapping rule exists. This means that you can use any certificate that matches the defined certificate mapping data to authenticate asidm_user.
11.5. Adding certificate mapping data to a user entry in the IdM CLI for users stored in IdM Copia collegamentoCollegamento copiato negli appunti!
The ipa user-add-certmapdata command links certificate attributes to user entries. Administrators use this tool to upload encoded certificates or define specific Subject and Issuer strings, establishing the trust relationship required for authentication.
Procedure
Obtain the administrator’s credentials:
# kinit adminChoose one of the following options:
If you have the certificate of
idm_user, add the certificate to the user account using theipa user-add-certcommand:# CERT=$(openssl x509 -in idm_user_cert.pem -outform der|base64 -w0)# ipa user-add-certmapdata idm_user --certificate $CERTIf you do not have the certificate of
idm_userbut know theIssuerand theSubjectof the user’s certificate:# ipa user-add-certmapdata idm_user --subject "O=EXAMPLE.ORG,CN=test" --issuer "CN=Smart Card CA,O=EXAMPLE.ORG"-------------------------------------------- Added certificate mappings to user "idm_user" -------------------------------------------- User login: idm_user Certificate mapping data: X509:<I>O=EXAMPLE.ORG,CN=Smart Card CA<S>CN=test,O=EXAMPLE.ORG
Verification
If you have access to the whole certificate in the .pem format, verify that the user and certificate are linked:
Use the
sss_cacheutility to invalidate the record ofidm_userin the SSSD cache and force a reload of theidm_userinformation:# sss_cache -u idm_userRun the
ipa certmap-matchcommand with the name of the file containing the certificate of the IdM user:# ipa certmap-match idm_user_cert.pem-------------- 1 user matched -------------- Domain: IDM.EXAMPLE.COM User logins: idm_user ---------------------------- Number of entries returned 1 ----------------------------The output confirms that now you have certificate mapping data added to
idm_userand that a corresponding mapping rule exists. This means that you can use any certificate that matches the defined certificate mapping data to authenticate asidm_user.