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.redhat.rhel6:def:276
# The audit system must be configured to audit all discretionary access control permission modifications using chown.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# dac modification chown x32 non-system users
# textfilecontent54_object (textfilecontent54_test)
test_1() {
grep -Pq '^[\s]*-a[\s](?:always,exit|exit,always)+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(?:-S[\s]+|,)chown(?:[\s]+|,))(?:.*-F\s+auid>=500[\s]+)(?:.*-F\s+auid!=(?:-1|4294967295)[\s]+).*-k[\s]+[\S]+[\s]*$' '/etc/audit/audit.rules' &>/dev/null
}
# dac modification chown x32 root
# textfilecontent54_object (textfilecontent54_test)
test_2() {
grep -Pq '^[\s]*-a[\s](?:always,exit|exit,always)+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(?:-S[\s]+|,)chown(?:[\s]+|,))(?:.*-F\s+auid=0[\s]+).*-k[\s]+[\S]+[\s]*$' '/etc/audit/audit.rules' &>/dev/null
}
# Generic test for x86_64 architecture
# uname_object (uname_test)
test_3() {
(uname -p) | grep -qxF 'x86_64'
}
# dac modification chown x64 non-system users
# textfilecontent54_object (textfilecontent54_test)
test_4() {
grep -Pq '^[\s]*-a[\s](?:always,exit|exit,always)+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(?:-S[\s]+|,)chown(?:[\s]+|,))(?:.*-F\s+auid>=500[\s]+)(?:.*-F\s+auid!=(?:-1|4294967295)[\s]+).*-k[\s]+[\S]+[\s]*$' '/etc/audit/audit.rules' &>/dev/null
}
# dac modification chown x64 root
# textfilecontent54_object (textfilecontent54_test)
test_5() {
grep -Pq '^[\s]*-a[\s](?:always,exit|exit,always)+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(?:-S[\s]+|,)chown(?:[\s]+|,))(?:.*-F\s+auid=0[\s]+).*-k[\s]+[\S]+[\s]*$' '/etc/audit/audit.rules' &>/dev/null
}
if ( test_1 && test_2 && ( test_3 || ( test_4 && test_5 ) ) ); 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:mil.disa.fso.redhat.rhel6:def:276 compliance check
set -e
if [ ! -f "/etc/audit/audit.rules" ]; then echo "PASS"; exit 0; fi
if grep -q "^[\s]*-a[\s](?:always,exit|exit,always)+[\s]*-F[\s]+arch=b32[\s]+-S[\s]+chown[\s]+-F\s+auid>=500[\s]+-F\s+auid != (?:-1|4294967295)[\s]+.*-k[\s]+[\S]+[\s]*$" "/etc/audit/audit.rules"; then :; else echo "FAIL"; exit 1; fi
if grep -q "^[\s]*-a[\s](?:always,exit|exit,always)+[\s]*-F[\s]+arch=b32[\s]+-S[\s]+chown[\s]+-F\s+auid=0[\s]+.*-k[\s]+[\S]+[\s]*$" "/etc/audit/audit.rules"; then :; else echo "FAIL"; exit 1; fi
if [ $(uname -m) = "x86_64" ]; then if grep -q "^[\s]*-a[\s](?:always,exit|exit,always)+[\s]*-F[\s]+arch=b64[\s]+-S[\s]+chown[\s]+-F\s+auid>=500[\s]+-F\s+auid != (?:-1|4294967295)[\s]+.*-k[\s]+[\S]+[\s]*$" "/etc/audit/audit.rules"; then :; else echo "FAIL"; exit 1; fi; if grep -q "^[\s]*-a[\s](?:always,exit|exit,always)+[\s]*-F[\s]+arch=b64[\s]+-S[\s]+chown[\s]+-F\s+auid=0[\s]+.*-k[\s]+[\S]+[\s]*$" "/etc/audit/audit.rules"; then :; else echo "FAIL"; exit 1; fi; else echo "PASS"; exit 0; fi