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.ubuntu2404os:def:270738
# Ubuntu 24.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
# DISA STIG / SCAP compliance check: oval:mil.disa.stig.ubuntu2404os:def:270738
if [ ! -f "/etc/pam_pkcs11/pam_pkcs11.conf" ]; then echo "PASS"; exit 0; fi
if grep -E "^[\"']*crl_auto[\"']*$|^[\"']*crl_auto[\"',\\s]|[\"',\\s]crl_auto[\"',\\s]|[\"',\\s]crl_auto[\"']*$" /etc/pam_pkcs11/pam_pkcs11.conf > /dev/null 2>&1 ] || \
grep -E "^[\"']*crl_offline[\"']*$|^[\"']*crl_offline[\"',\\s]|[\"',\\s]crl_offline[\"',\\s]|[\"',\\s]crl_offline[\"']*$" /etc/pam_pkcs11/pam_pkcs11.conf > /dev/null 2>&1 ]; then echo "PASS"; exit 0; else echo "FAIL"; exit 1; fi