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:231
# The kernel core dump data directory must be group-owned by root, bin, sys, or system.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
#
# MANUAL REVIEW REQUIRED -- the module(s) below could not be reconstructed
# into working code from curated SCC reference data, and are excluded from
# the automated result:
# - file_object (file_test) -- Kernel crash directory - configured path - is group owned by root,bin,sys: no extractor for field "group_id"
# - file_object (file_test) -- Kernel crash directory - default path - is group owned by root,bin,sys: no extractor for field "group_id"
# - file_object (file_test) -- Kernel crash directory - uuid - configured path - is group owned by root,bin,sys: no extractor for field "group_id"
# - file_object (file_test) -- Kernel crash directory - uuid - default path - is group owned by root,bin,sys: no extractor for field "group_id"
# - file_object (file_test) -- Kernel crash directory - label - configured path - is group owned by root,bin,sys: no extractor for field "group_id"
# - file_object (file_test) -- Kernel crash directory - label - default path - is group owned by root,bin,sys: no extractor for field "group_id"
# No kernel crash device path is configured
# textfilecontent54_object (textfilecontent54_test)
test_1() {
! ( grep -Pq '^\s*(?:ext2|ext3|ext4|xfs|gfs|gfs2)\s+(/\S+)' '/etc/kdump.conf' &>/dev/null )
}
# Kernel crash directory path is not configured
# textfilecontent54_object (textfilecontent54_test)
test_2() {
grep -Pq '^\s*path\s+(\S+)' '/etc/kdump.conf' &>/dev/null
}
# Kernel crash directory path is configured
# textfilecontent54_object (textfilecontent54_test)
test_4() {
grep -Pq '^\s*path\s+(\S+)' '/etc/kdump.conf' &>/dev/null
}
# No kernel crash device UUID is configured
# textfilecontent54_object (textfilecontent54_test)
test_6() {
! ( grep -Pq '^\s*(?:ext2|ext3|ext4|xfs|gfs|gfs2)\s+UUID=(\S+)' '/etc/kdump.conf' &>/dev/null )
}
# Kernel crash directory path is not configured
# textfilecontent54_object (textfilecontent54_test)
test_7() {
grep -Pq '^\s*path\s+(\S+)' '/etc/kdump.conf' &>/dev/null
}
# Kernel crash directory path is configured
# textfilecontent54_object (textfilecontent54_test)
test_9() {
grep -Pq '^\s*path\s+(\S+)' '/etc/kdump.conf' &>/dev/null
}
# No kernel crash device label is configured
# textfilecontent54_object (textfilecontent54_test)
test_11() {
! ( grep -Pq '^\s*(?:ext2|ext3|ext4|xfs|gfs|gfs2)\s+LABEL=(\S+)' '/etc/kdump.conf' &>/dev/null )
}
# Kernel crash directory path is not configured
# textfilecontent54_object (textfilecontent54_test)
test_12() {
grep -Pq '^\s*path\s+(\S+)' '/etc/kdump.conf' &>/dev/null
}
# Kernel crash directory path is configured
# textfilecontent54_object (textfilecontent54_test)
test_14() {
grep -Pq '^\s*path\s+(\S+)' '/etc/kdump.conf' &>/dev/null
}
if ( ( test_1 || ( test_2 && test_4 ) ) && ( test_6 || ( test_7 && test_9 ) ) && ( test_11 || ( test_12 && test_14 ) ) ); then
echo "PASS (automated portion only -- MANUAL REVIEW still required, see notes above)"
else
echo "FAIL (or see MANUAL REVIEW note above)"
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:231
if [ ! -f "/etc/kdump.conf" ]; then echo "PASS"; exit 0; fi
if [ "$(grep -oP '^\\s*path\\s+(\\S+)' /etc/kdump.conf | head -n 1)" ]; then
KERN_DUMP_DIR="$(grep -oP '^\\s*path\\s+(\\S+)' /etc/kdump.conf | head -n 1 | sed 's/^\\s*path\\s*//')"; fi
if [ -z "$KERN_DUMP_DIR" ]; then echo "PASS"; exit 0; fi
if [ "$(stat -c %G "$KERN_DUMP_DIR")" = root ] || [ "$(stat -c %G "$KERN_DUMP_DIR")" = bin ] || [ "$(stat -c %G "$KERN_DUMP_DIR")" = sys ] || [ "$(stat -c %G "$KERN_DUMP_DIR")" = system ]; then echo "PASS"; exit 0; fi
echo "FAIL"; exit 1;