aa-enforce and aa-complain strip all flags instead of manipulating 'complain'

Bug #950921 reported by Jamie Strandboge
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
AppArmor
Fix Released
Medium
Unassigned
apparmor (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

If a profile contains flags other than 'complain', they are stripped out when using aa-enforce and aa-complain. Eg:

If profile has:
/usr/lib/chromium-browser/chromium-browser flags=(complain,attach_disconnected) {...}

After 'sudo aa-enforce /etc/apparmor.d/usr.bin.chromium-browser' it now has:
/usr/lib/chromium-browser/chromium-browser {...}

If profile has:
/usr/lib/chromium-browser/chromium-browser flags=(attach_disconnected) {...}

After 'sudo aa-complain /etc/apparmor.d/usr.bin.chromium-browser' it now has:
/usr/lib/chromium-browser/chromium-browser flags=(complain) {...}

Tags: aa-tools
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This is still an issue on 13.04.

Changed in apparmor (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel Richard G. (skunk) wrote :

The aa-* scripts would probably do better to replace "complain" with "enforce" and vice versa, rather than edit the "flags=(...)" bit as a whole.

(Better yet, according to http://wiki.apparmor.net/index.php/AppArmor_Core_Policy_Reference , "the mode flags specify the mode the profile is in and are mutually exclusive. They have been deprecated in favor of external controls in order to better separate policy and state.")

Steve Beattie (sbeattie)
Changed in apparmor:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Steve Beattie (sbeattie) wrote :

This has been fixed upstream with the replacement of the perl tools with the python tools, and was included in Ubuntu trusty with the 2.8.95~2430-0ubuntu1 apparmor upload.

Changed in apparmor:
milestone: none → 2.9.0
status: Confirmed → Fix Committed
Changed in apparmor (Ubuntu):
status: Confirmed → Fix Released
tags: added: aa-tools
Revision history for this message
Steve Beattie (sbeattie) wrote :

Apparmor 2.9.0 has been released; closing.

Changed in apparmor:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.