jack-ullery / AppAnvil

Graphical user interface for the AppArmor security module (in-progress)
GNU General Public License v3.0
14 stars 12 forks source link

Audit mode #44

Closed jack-ullery closed 1 year ago

jack-ullery commented 1 year ago

Description

This PR allows the user to switch an AppArmor profile to Audit mode. According to AppArmor developers, this confinement mode should only be used sparingly, most likely because it can pollute the system logs with unimportant data. We might want to communicate this to the users somehow.

The AppArmor wiki explains the functionality for this confinement mode: "In this mode security policy is enforced and all access (successes and failures) are logged to the system log"

Change 1 - Fix error preventing changing a profiles status

I found a few regressions that were not caught by the unit tests, which prevented the user from correctly changing a profiles status. This PR should fix those bugs

Change 2 - Add ability to change profile to Audit mode

This was pretty simple, and involved making a call to aa-enforce

Change 3 - Correctly parse 'Audit' logs

Previously, AppArmor logs with type 'Audit' were not correctly parsed by the application. These changes should fix that.