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
audit
andaudit-libs
packages:sudo dnf install audit audit-libs
.
How to test
- Open a terminal.
- Start the audit daemon using the command:
sudo service auditd start
. - Ensure the daemon is running:
sudo service auditd status
. - Create a rule to monitor a specific file for changes, e.g.,
/etc/passwd
:sudo auditctl -w /etc/passwd -p wa -k passwd_changes
. - 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
auditd
is actively running. - After setting an audit rule on
/etc/passwd
, any modification to the file should trigger an audit event. - The
ausearch
utility 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.