Chapter 5. Configuring smart card authentication with the web console for centrally managed users
Configure smart card authentication for centrally managed users in the RHEL web console. This security measure helps to provide physical access control for administrative and regular users.
You can configure smart card authentication in the RHEL web console for users who are centrally managed by:
- Identity Management
- Active Directory which is connected in the cross-forest trust with Identity Management
5.1. Prerequisites Copy linkLink copied to clipboard!
- The system for which you want to use the smart card authentication must be a member of an Active Directory or Identity Management domain.
- The certificate used for the smart card authentication must be associated with a particular user in Identity Management or Active Directory.
5.2. Smart-card authentication for centrally managed users Copy linkLink copied to clipboard!
Use smart-card authentication to provide strong authentication for centrally managed users. This method links the user account to a physical credential, enhancing security for systems within the Identity Management domain.
A smart card is a physical device, which can provide personal authentication by using certificates stored on the card. Personal authentication means that you can use smart cards in the same way as user passwords.
You can store user credentials on the smart card in the form of a private key and a certificate. Special software and hardware is used to access them. You insert the smart card into a reader or a USB socket and supply the PIN code for the smart card instead of providing your password.
Identity Management (IdM) supports smart-card authentication with user certificates issued by the Active Directory Certificate Service (ADCS) certificate authority.
5.3. Enabling smart-card authentication for the web console Copy linkLink copied to clipboard!
To allow centrally managed users to securely log in by using their smart card credentials and the IdM domain policy, enable smart card authentication for the RHEL web console.
To use smart-card authentication in the web console, enable this authentication method in the cockpit.conf file. Additionally, you can disable password authentication in the same file.
Prerequisites
You have installed the RHEL 10 web console.
For instructions, see Installing and enabling the web console.
Procedure
- Log in to the RHEL 10 web console.
- Click Terminal.
In the
/etc/cockpit/cockpit.conf, set theClientCertAuthenticationtoyes:[WebService] ClientCertAuthentication = yesOptional: Disable password-based authentication in
cockpit.confwith:[Basic] action = noneThis configuration disables password authentication and you must always use the smart card.
Restart the web console to ensure that the
cockpit.serviceaccepts the change:# systemctl restart cockpit
Verification
- Open the web console login page. The web console prompts you to insert your smart card or use a smart card for authentication.
5.4. Logging in to the web console with smart cards Copy linkLink copied to clipboard!
You can log in to the RHEL web console with your smart card credentials. This uses the configured smart card policy for secure access by centrally managed users.
Prerequisites
- A valid certificate stored in your smart card that is associated to a user account created in an Active Directory or Identity Management domain.
- PIN to unlock the smart card.
- The smart card has been put into the reader.
You have installed the RHEL 10 web console.
For instructions, see Installing and enabling the web console.
Procedure
Log in to the RHEL 10 web console.
The browser asks you to add the PIN protecting the certificate stored on the smart card.
- In the Password Required dialog box, enter PIN and click OK.
- In the User Identification Request dialog box, select the certificate stored in the smart card.
Select Remember this decision.
The system does not open this window next time.
NoteThis step does not apply to Google Chrome users.
- Click OK.
Verification
- The web console displays the Overview page, confirming that the smart card authentication was successful.
5.5. Enabling passwordless sudo authentication for smart-card users Copy linkLink copied to clipboard!
You can enable passwordless sudo authentication for smart-card users to allow them to perform administrative tasks without entering a password, improving operational efficiency and security.
Alternatively, if you use RHEL Identity Management, you can declare the initial web console certificate as trusted for authentication with sudo, SSH, or other services. The web console automatically creates an S4U2Proxy Kerberos ticket in the user session for this purpose.
In the following example, the web console session runs on host.example.com and is trusted to access its own host with sudo. Additionally, the example steps add a second trusted host - remote.example.com.
Prerequisites
- Identity Management is installed.
- Active Directory is connected in the cross-forest trust with Identity Management.
- Your smart card is configured to log in to the web console. See Configuring smart-card authentication with the web console for centrally managed users for more information.
Procedure
Configure constraint delegation rules to list which hosts the ticket can access.
Create the following example delegation:
Enter the following commands to add a list of target machines a particular rule can access:
# ipa servicedelegationtarget-add cockpit-target# ipa servicedelegationtarget-add-member cockpit-target \ --principals=host/host.example.com@EXAMPLE.COM \ --principals=host/remote.example.com@EXAMPLE.COMTo enable the web console sessions (HTTP/principal) to access that host list, use the following commands:
# ipa servicedelegationrule-add cockpit-delegation# ipa servicedelegationrule-add-member cockpit-delegation \ --principals=HTTP/host.example.com@EXAMPLE.COM# ipa servicedelegationrule-add-target cockpit-delegation \ --servicedelegationtargets=cockpit-target
Enable GSS authentication in the corresponding services:
For
sudo, enable thepam_sss_gssmodule in the/etc/sssd/sssd.conffile:As
root, add an entry for your domain to the/etc/sssd/sssd.confconfiguration file.[domain/example.com] pam_gssapi_services = sudo, sudo-iEnable the module in the
/etc/pam.d/sudofile on the first line.auth sufficient pam_sss_gss.so
For SSH, update the
GSSAPIAuthenticationoption in the/etc/ssh/sshd_configfile toyes.WarningThe delegated S4U ticket is not forwarded to remote SSH hosts when connecting to them from the web console. Authenticating to
sudoon a remote host with your ticket will not work.
Verification
- Log in to the web console using a smart card.
- Click the Limited access button.
- Authenticate using your smart card.
- Alternatively: Try to connect to a different host with SSH.
5.6. Limiting user sessions and memory to prevent a DoS attack Copy linkLink copied to clipboard!
To mitigate the risk of denial-of-service (DoS) attacks on the cockpit-ws web server, limit user sessions and memory consumption of the web console service by changing its systemd configuration.
Certificate authentication isolates instances of the cockpit-ws web server to prevent user impersonation. However, it introduces a surface for a DoS attack. A remote attacker could create multiple certificates and send multiple HTTPS requests to cockpit-ws, each using a different one.
To prevent such DoS attacks, the collective resources of these web server instances are limited. By default, limits are set to 200 threads, with 75% as a soft limit and 90% as a hard limit on memory usage.
Prerequisites
You have installed the RHEL 10 web console.
For instructions, see Installing and enabling the web console.
Procedure
On the command line, open the
system-cockpithttps.sliceconfiguration file:# systemctl edit system-cockpithttps.sliceLimit the
TasksMaxto 100 andCPUQuotato 30%:[Slice] # change existing value TasksMax=100 # add new restriction CPUQuota=30%To apply the changes, restart the system:
# systemctl daemon-reload# systemctl stop cockpit
Verification
Verify that the new resource limits are applied:
# systemctl show system-cockpithttps.slice --property=TasksMax,CPUQuota