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.rhel8os:def:279930
# RHEL 8 IP tunnels must use FIPS 140-3-approved cryptographic algorithms.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# ipsec.conf includes crypto-policy
# textfilecontent54_object (textfilecontent54_test)
test_1() {
(sed -En 's/^\s*include\s+(.*)\s*$/\1/p' '/etc/ipsec.conf') | grep -qxF '/etc/crypto-policies/back-ends/libreswan.config'
}
# ipsec.conf includes /etc/ipsec.d/*.conf
# textfilecontent54_object (textfilecontent54_test)
test_2() {
(sed -En 's/^\s*include\s+(.*)\s*$/\1/p' '/etc/ipsec.conf') | grep -qxF '/etc/ipsec.d/*.conf'
}
# /etc/ipsec.d/*.conf includes crypto-policy
# textfilecontent54_object (textfilecontent54_test)
test_3() {
(grep -rhP --include='*.conf' '^\s*include\s+(.*)\s*$' '/etc/ipsec.d' | sed -En 's/^\s*include\s+(.*)\s*$/\1/p') | grep -qxF '/etc/crypto-policies/back-ends/libreswan.config'
}
if ( test_1 || ( test_2 && test_3 ) ); 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.rhel8os:def:279930
if [ ! -f "/etc/ipsec.conf" ]; then echo "PASS"; exit 0; fi
if grep -q "^\\s*include\\s+/etc/crypto-policies/back-ends/libreswan.config\\s*$" /etc/ipsec.conf; then echo "PASS"; exit 0; fi
if [ ! -d "/etc/ipsec.d" ]; then echo "PASS"; exit 0; fi
for conf in /etc/ipsec.d/*.conf; do
if [ -f "$conf" ]; then
if grep -q "^\\s*include\\s+/etc/crypto-policies/back-ends/libreswan.config\\s*$" "$conf"; then echo "PASS"; exit 0; fi
fi
done
echo "FAIL"; exit 1