Hi,
The issue you are facing may be due to the new audit rules not being loaded properly, causing the system to still use old rules. To resolve this, please follow the steps below for a clean rules reload:
On your Linux, run the below command and confirm it is set to no immutable lock:
auditctl -s | grep -E 'enabled|locked'
It should show enabled = 1.
If you see locked = 1 (immutable), find and comment out "-e 2", then reboot:
sudo grep -Rni --color=always '^-e[[:space:]]*2' /etc/audit/audit.rules /etc/audit/rules.d || true
Edit the file that contains -e 2 -> comment it, then:
sudo reboot
After that search for any conflicting old kmod rules:
sudo grep -Rni --color=always -E 'kmod|-S all .*path=' /etc/audit/rules.d /etc/audit/audit.rules || true
If found, edit any hits and DELETE lines like:
-a always,exit -S all -F path=/usr/bin/kmod
This is your old rule which was not matching with the SCA rules.
Then force write a clean rules file:
sudo tee /etc/audit/rules.d/50-kernel_modules.rules >/dev/null <<'EOF'
# Kernel module syscalls (x86_64 ABI)
-a always,exit -F arch=b64 -S init_module -S finit_module -S delete_module -S create_module -S query_module -F auid>=1000 -F auid!=-1 -k kernel_modules
# 32-bit ABI (optional)
-a always,exit -F arch=b32 -S init_module -S finit_module -S delete_module -S create_module -S query_module -F auid>=1000 -F auid!=-1 -k kernel_modules
# Executions via kmod wrapper (REQUIRED by SCA)
-a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=-1 -k kernel_modules
EOF
Then ensure augenrules is actually used:
grep -E '^\s*USE_AUGENRULES' /etc/default/auditd || true
If not "USE_AUGENRULES="yes", set it to yes and restart auditd:
sudo systemctl restart auditd
Now clear live rules and rebuild /etc/audit/audit.rules from rules.d:
sudo auditctl -D
sudo augenrules --load
Verify it compiled correctly:
sed -n '1,200p' /etc/audit/audit.rules
Then restart the Wazuh agent to re-run the SCA scan again and wait for some time to update it on the Wazuh dashboard:
systemctl restart wazuh-agent
If the issue persists, please share the full output of the below commands with us:
COLUMNS=1000 auditctl -l
sed -n '1,200p' /etc/audit/audit.rules
sudo grep -Rni --color=always 'kmod' /etc/audit/rules.d /etc/audit/audit.rules
I have verified these steps again on my end and it is working fine as before.