Linux distributions
TMA-ROCKY10-6.3.3.35
Ensure the audit configuration is loaded regardless of errors
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.
Méthode de vérification
Méthode d'audit: Commande 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- Sortie attendue
compliant
Méthode de correction
Méthode de correction: Recommandation ou correctif d'infrastructure
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
Propriétés
- Systèmes d'exploitation
- rocky-10
- Étiquettes
- cis-convertedlinux
- Référence
- CIS Rocky Linux 10 Benchmark v1.0.0 - 6.3.3.35
Vérifier cet hôte
Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.
tmaegis scan --target linux --level 2