Skip to content

Configure NSS DB To Use opensc

An XCCDF Rule

Description

The opensc module should be configured for use over the Coolkey PKCS#11 module in the NSS database. To configure the NSS database to use the opensc module, run the following command:

$ sudo pkcs11-switch opensc

warning alert: Warning

NSS modules information are stored in NSS database which is in binary format. Currently it is not possible to check NSS database using OVAL. This is the reason there is no OVAL check for this rule.

Rationale

Smart card login provides two-factor authentication stronger than that provided by a username and password combination. Smart cards leverage PKI (public key infrastructure) in order to provide and verify credentials.

ID
xccdf_org.ssgproject.content_rule_configure_opensc_nss_db
Severity
Medium
References
Updated



Remediation - Ansible

- name: Configure NSS DB To Use opensc - Check Existence of pkcs11-switch
  ansible.builtin.stat:
    path: /usr/bin/pkcs11-switch
  register: pkcs11switch
  when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
  tags:

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then

PKCSSW=$(/usr/bin/pkcs11-switch)

if [ ${PKCSSW} != "opensc" ] ; then