Linux distributions
TMA-SLES16-6.2.3.33
Ensure the audit configuration is loaded regardless of errors
LowLevel 2Automatedlinux
Description
Set -c flag so that auditctl will continue loading rules in spite of an error. The exit code will not be success if any rule fails to load.
How it is checked
Audit method: Shell command
shell
alt0() { command -v grep >/dev/null 2>&1 || { echo "step1: grep not installed"; return 1; }; command -v tail >/dev/null 2>&1 || { echo "step1: tail not installed"; return 1; }; o=$(bash -c 'grep -Ph -- '"'"'^\h*-c\b'"'"' /etc/audit/rules.d/*.rules | tail -1' 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- -c || { echo step1: missing -c; return 1; }; }; if alt0; then echo compliant; fi- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
Edit or create the file /etc/audit/rules.d/01-initialize.rules and add the line - c at the end of the file: Example: # printf '%s\n' "" "-c" >> /etc/audit/rules.d/01-initialize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi
Properties
- Operating systems
- sles-16
- Tags
- cis-convertedlinux
- Reference
- CIS SUSE Linux Enterprise 16 Benchmark v1.0.0 - 6.2.3.33
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
shell
tmaegis scan --target linux --level 2