2021-04-02 11:43:03 +02:00
|
|
|
#compdef aa-log
|
|
|
|
#autoload
|
|
|
|
|
2022-09-13 19:15:47 +02:00
|
|
|
_aa-log() {
|
2021-04-02 11:43:03 +02:00
|
|
|
local IFS=$'\n'
|
2022-02-10 22:30:51 +01:00
|
|
|
_arguments : \
|
2023-04-19 20:02:42 +02:00
|
|
|
{-f,--file}'[set a logfile or a suffix to the default log file]:FILE:__aa_files' \
|
|
|
|
{-s,--systemd}'[parse systemd logs from journalctl]' \
|
2023-10-10 21:44:50 +02:00
|
|
|
{-r,--rules}'[convert the log into AppArmor rules]' \
|
|
|
|
{-R,--raw}'[print the raw log without any formatting]' \
|
2023-04-19 20:02:42 +02:00
|
|
|
{-h,--help}'[display help information]'
|
2022-02-10 22:30:51 +01:00
|
|
|
|
2021-04-02 11:43:03 +02:00
|
|
|
_values -C 'profile names' ${$(__aa_profiles):-""}
|
|
|
|
}
|
|
|
|
|
2022-09-13 19:15:47 +02:00
|
|
|
__aa_files() {
|
|
|
|
find /var/log/audit/ -type f -printf '%P\n' | cut -d '.' -f 3
|
|
|
|
_files
|
|
|
|
}
|
|
|
|
|
2021-04-02 11:43:03 +02:00
|
|
|
__aa_profiles() {
|
2022-09-13 19:15:47 +02:00
|
|
|
find -L /etc/apparmor.d -maxdepth 1 -type f -printf '%P\n' | sort
|
2021-04-02 11:43:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
_aa-log
|