The reconstructed evaluation script behind this rule's OVAL check(s) — every module a compound check combines, with this rule's own concrete values and DISA's SCC tool's real per-module mechanism curated from static teardown of SCC releases.
#!/bin/bash
# Reconstructed from oval:mil.disa.stig.ubuntu2204os:def:260578
# Ubuntu 22.04 LTS for PKI-based authentication, must implement a local cache of revocation data in case of the inability to access revocation information via the network.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# Check pam_pkcs11.conf has all cert_policy set to include the crl_auto or crl_offline option
# textfilecontent54_object (textfilecontent54_test)
test_1() {
( (sed -En 's/^[\s]*cert_policy[ \t]+=[ \t]+([\w\,"'\'' ]+);\s*$/\1/p' '/etc/pam_pkcs11/pam_pkcs11.conf') | grep -Pq '^["'\'']*crl_auto["'\'']*$|^["'\'']*crl_auto["'\'',\s]|["'\'',\s]crl_auto["'\'',\s]|["'\'',\s]crl_auto["'\'']*$' ) || ( (sed -En 's/^[\s]*cert_policy[ \t]+=[ \t]+([\w\,"'\'' ]+);\s*$/\1/p' '/etc/pam_pkcs11/pam_pkcs11.conf') | grep -Pq '^["'\'']*crl_offline["'\'']*$|^["'\'']*crl_offline["'\'',\s]|["'\'',\s]crl_offline["'\'',\s]|["'\'',\s]crl_offline["'\'']*$' )
}
if test_1; then
echo "PASS"
else
echo "FAIL"
fi Assessment Script Powered by AISandbox-executed
A standalone Shell script to assess this control automatically. Review before running it in your environment.
Syntax-checked and actually executed in an isolated sandbox (not the real system this checks) — confirmed to run without errors.
#!/bin/sh
# OVAL definition: oval:mil.disa.stig.ubuntu2204os:def:260578
if [ ! -f "/etc/pam_pkcs11/pam_pkcs11.conf" ]; then
echo "PASS"
exit 0
fi
if [ $(grep -E "^\s*cert_policy\s*=" /etc/pam_pkcs11/pam_pkcs11.conf | awk -F'=' '{print $2}' | grep -E "crl_auto|crl_offline" | wc -l) -gt 0 ]; then
echo "PASS"
exit 0
else
echo "FAIL"
exit 1
fi