Information
Record changes to network environment files or system calls. The files being monitored are:
- /etc/netplan/ - central location for YAML networking configurations files
Monitoring system events that change network environments, such as tracking changes in the /etc/netplan/ directory ensures swift detection of unauthorized adjustments to network configurations. All audit records should be appropriately tagged for relevance
Solution
Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment.
Example:
# printf "
-w /etc/netplan -p wa -k system-locale
" >> /etc/audit/rules.d/50-system_locale.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
Note: - IF - The directory /etc/netplan does not exist, this is considered a passing state. Creating a file system rule will result in an error if /etc/netplan does not exist.