Description
The audit package provides tools and utilities to monitor and analyze system security audits. The audit-libs package contains the dynamic libraries needed by the audit tools and other applications to incorporate auditing capabilities. This test case ensures that the audit utilities and audit-libs work correctly for system auditing.
Setup
- Ensure you have a Fedora system.
- Install the
auditandaudit-libspackages:sudo dnf install audit audit-libs
How to test
- Open a terminal.
- Ensure the audit daemon is running without any errors:
sudo systemctl status auditd - List all rules,
sudo auditctl -l - Create new rule to monitor a specific file(e.g. /etc/passwd) for changes:
sudo auditctl -a always,exit -F path=/etc/passwd -F perm=wa -k passwd_changes. - List your rules,
sudo auditctl -l - Make a change to the monitored file, e.g.,
sudo echo "# test comment" >> /etc/passwd - Query the audit logs for any related events:
sudo ausearch -k passwd_changes - Review the results for the relevant event indicating the change.
Expected Results
- The audit daemon (
auditd) should start without any errors. - The status command should indicate that
auditdis actively running. - After setting an audit rule on
/etc/passwd, any modification to the file should trigger an audit event. - The
ausearchutility should display a log entry related to the change made to the monitored file, indicating details like the action performed, user, timestamp, and more.
Optional
For enhanced testing depth:
1. Try creating more complex audit rules involving multiple files, system calls, or specific users.
2. Use the autrace utility to trace a specific process for all the system calls it makes.
3. Test the audit utilities on different filesystem types.
4. Ensure that audit-libs functions correctly by running applications or tools that depend on it and verifying their audit-related capabilities.
