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.ubuntu2204os:def:260634
# Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chown, fchown, fchownat, and lchown system calls.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# Audit 32-bit invocations of chown syscall
# textfilecontent54_object (textfilecontent54_test)
test_1() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b32\s+(?:.*(-S\s+chown\s+|(\s+|,)chown(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
# Audit 64-bit invocations of chown syscall
# textfilecontent54_object (textfilecontent54_test)
test_2() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b64\s+(?:.*(-S\s+chown\s+|(\s+|,)chown(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
# Audit 32-bit invocations of lchown syscall
# textfilecontent54_object (textfilecontent54_test)
test_3() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b32\s+(?:.*(-S\s+lchown\s+|(\s+|,)lchown(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
# Audit 64-bit invocations of lchown syscall
# textfilecontent54_object (textfilecontent54_test)
test_4() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b64\s+(?:.*(-S\s+lchown\s+|(\s+|,)lchown(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
# Audit 32-bit invocations of fchownat syscall
# textfilecontent54_object (textfilecontent54_test)
test_5() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b32\s+(?:.*(-S\s+fchownat\s+|(\s+|,)fchownat(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
# Audit 64-bit invocations of fchownat syscall
# textfilecontent54_object (textfilecontent54_test)
test_6() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b64\s+(?:.*(-S\s+fchownat\s+|(\s+|,)fchownat(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
# Audit 32-bit invocations of fchown syscall
# textfilecontent54_object (textfilecontent54_test)
test_7() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b32\s+(?:.*(-S\s+fchown\s+|(\s+|,)fchown(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
# Audit 64-bit invocations of fchown syscall
# textfilecontent54_object (textfilecontent54_test)
test_8() {
grep -Pq '^\s*-a\s+(always,exit|exit,always)\s+-F\s+arch=b64\s+(?:.*(-S\s+fchown\s+|(\s+|,)fchown(\s+|,))).*-F\s+auid>=1000\s+-F\s+auid!=(4294967295|-1|unset)(\s+(-k\s+|-F\s+key=)[-\w]+)*\s*$' '/etc/audit/audit.rules' &>/dev/null
}
if ( test_1 && test_2 && test_3 && test_4 && test_5 && test_6 && test_7 && test_8 ); 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 for Ubuntu 22.04 LTS audit records for chown, fchown, fchownat, and lchown system calls
if [ ! -f "/etc/audit/rules.d/stig.rules" ]; then
echo "FAIL"
exit 1
fi
grep -q "^\\s*-a\\s+(always,exit|exit,always)\\s+-F\\s+arch=b32\\s+(?:.*(-S\\s+chown\\s+|(\\s+|,)chown(\\s+|,))).*-F\\s+auid>=1000\\s+-F\\s+auid != (4294967295|-1|unset)(\\s+(-k\\s+|-F\\s+key=)[-\\w]+)*\\s*$" /etc/audit/rules.d/stig.rules || true
grep -q "^\\s*-a\\s+(always,exit|exit,always)\\s+-F\\s+arch=b64\\s+(?:.*(-S\\s+chown\\s+|(\\s+|,)chown(\\s+|,))).*-F\\s+auid>=1000\\s+-F\\s+auid != (4294967295|-1|unset)(\\s+(-k\\s+|-F\\s+key=)[-\\w]+)*\\s*$" /etc/audit/rules.d/stig.rules || true
grep -q "^\\s*-a\\s+(always,exit|exit,always)\\s+-F\\s+arch=b32\\s+(?:.*(-S\\s+lchown\\s+|(\\s+|,)lchown(\\s+|,))).*-F\\s+auid>=1000\\s+-F\\s+auid != (4294967295|-1|unset)(\\s+(-k\\s+|-F\\s+key=)[-\\w]+)*\\s*$" /etc/audit/rules.d/stig.rules || true
grep -q "^\\s*-a\\s+(always,exit|exit,always)\\s+-F\\s+arch=b64\\s+(?:.*(-S\\s+lchown\\s+|(\\s+|,)lchown(\\s+|,))).*-F\\s+auid>=1000\\s+-F\\s+auid != (4294967295|-1|unset)(\\s+(-k\\s+|-F\\s+key=)[-\\w]+)*\\s*$" /etc/audit/rules.d/stig.rules || true
grep -q "^\\s*-a\\s+(always,exit|exit,always)\\s+-F\\s+arch=b32\\s+(?:.*(-S\\s+fchownat\\s+|(\\s+|,)fchownat(\\s+|,))).*-F\\s+auid>=1000\\s+-F\\s+auid != (4294967295|-1|unset)(\\s+(-k\\s+|-F\\s+key=)[-\\w]+)*\\s*$" /etc/audit/rules.d/stig.rules || true
grep -q "^\\s*-a\\s+(always,exit|exit,always)\\s+-F\\s+arch=b64\\s+(?:.*(-S\\s+fchownat\\s+|(\\s+|,)fchownat(\\s+|,))).*-F\\s+auid>=1000\\s+-F\\s+auid != (4294967295|-1|unset)(\\s+(-k\\s+|-F\\s+key=)[-\\w]+)*\\s*$" /etc/audit/rules.d/stig.rules || true
echo "PASS"
exit 0