The path to where the AppArmor security profiles are stored
-f --file /path/to/logfile
The path to the location of the logfile that contains AppArmor security events.
-m --logmark ``mark''
aa-logprof will ignore all events in the system log before the specified mark is seen. If the mark contains spaces, it must be surrounded with quotes to work correctly.
Running aa-logprof will scan the log file and if there are new AppArmor events that are not covered by the existing profile set, the user will be prompted with suggested modifications to augment the profile.
When aa-logprof exits profile changes are saved to disk. If AppArmor is running, the updated profiles are reloaded and if any processes that generated AppArmor events are still running in the null-complain-profile, those processes are set to run under their proper profiles.
The user is then presented with info about the access including profile, path, old mode if there was a previous entry in the profile for this path, new mode, the suggestion list, and given these options:
(A)llow, (D)eny, (N)ew, (G)lob last piece, (Q)uit
If the AppArmor profile was in complain mode when the event was generated, the default for this option is (A)llow, otherwise, it's (D)eny.
The suggestion list is presented as a numbered list with includes at the top, the literal path in the middle, and the suggested globs at the bottom. If any globs are being suggested, the shortest glob is the selected option, otherwise, the literal path is selected. Picking includes from the list must be done manually.
Hitting a numbered key will change the selected option to the corresponding numbered entry in the list.
If the user selects (N)ew, they'll be prompted to enter their own globbed entry to match the path. If the user-entered glob does not match the path for this event, they'll be informed and have the option to fix it.
If the user selects (G)lob last piece then, taking the currently selected option, aa-logprof will remove the last path element and replace it with /*.
If the last path element already was /*, aa-logprof will go up a directory level and replace it with /**.
This new globbed entry is then added to the suggestion list and marked as the selected option.
So /usr/share/themes/foo/bar/baz.gif can be turned into /usr/share/themes/** by hitting ``g'' three times.
If the user selects (A)llow, aa-logprof will take the current selection and add it to the profile, deleting other entries in the profile that are matched by the new entry.
Adding r access to /usr/share/themes/** would delete an entry for r access to /usr/share/themes/foo/*.gif if it exists in the profile.
If (Q)uit is selected at this point, aa-logprof will ignore all new pending capability and path accesses.
After all of the path accesses have been handled, logrof will write all updated profiles to the disk and reload them if AppArmor is running.
If there is a corresponding entry for the target in the qualifiers section of /etc/apparmor/logprof.conf, the presented list will contain only the allowed modes.
The default option for this question is selected using this logic---
# if px mode is allowed and profile exists for the target # px is default. # else if ix mode is allowed # ix is default # else # deny is default
aa-logprof will never suggest ``ux'' as the default.