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.fso.rhel11:def:499
# The SMTP service must be an up-to-date version.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# sendmail is not installed
# rpminfo_object (rpminfo_test)
test_1() {
! ( rpm -q --quiet 'sendmail' &>/dev/null )
}
# Checking the state of sendmail
# rpminfo_object (rpminfo_test)
test_2() {
( (rpm -q --qf '%|EPOCH?{%{EPOCH}}:{0}|:%{VERSION}-%{RELEASE}' 'sendmail') | grep -qxF '0:8.13.8-8.el5' ) || ( (rpm -q --qf '%|EPOCH?{%{EPOCH}}:{0}|:%{VERSION}-%{RELEASE}' 'sendmail') | grep -qxF '0:8.13.8-10.el5' )
}
# postfix is not installed
# rpminfo_object (rpminfo_test)
test_3() {
! ( rpm -q --quiet 'postfix' &>/dev/null )
}
# checking the state of postfix
# rpminfo_object (rpminfo_test)
test_4() {
(rpm -q --qf '%|EPOCH?{%{EPOCH}}:{0}|:%{VERSION}-%{RELEASE}' 'postfix') | grep -qxF '2:2.3.3-6.el5'
}
if ! ( ! ( test_1 || test_2 ) && ! ( test_3 || test_4 ) ); 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.fso.rhel11:def:499
if ! command -v rpm &> /dev/null; then
echo "PASS"
exit 0
fi
sendmail_version=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" sendmail 2>/dev/null)
postfix_version=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}" postfix 2>/dev/null)
if [ -z "$sendmail_version" ] || [[ "$sendmail_version" != 8.13.8-* ]] && [[ "$sendmail_version" != 8.13.9-* ]]; then
if [ -z "$postfix_version" ] || [[ "$postfix_version" != 2.3.3-* ]]; then
echo "FAIL"
exit 1
fi
fi
echo "PASS"
exit 0