Skip to content

Commit

Permalink
Introduce a dedicated unconfined AA policy
Browse files Browse the repository at this point in the history
By using the 'unconfined' policy for privileged
containers, we have inherited the host's apparmor
policies, which really make no sense in the
context of the container's filesystem.

For instance, policies written against
the paths of binaries such as '/usr/sbin/tcpdump'
can be easily circumvented by moving the binary
within the container filesystem.

Fixes GH#5490

Signed-off-by: Eric Windisch <[email protected]>
  • Loading branch information
ewindisch committed Jul 22, 2015
1 parent 3ee15ac commit 87376c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions contrib/apparmor/docker
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ profile docker-default flags=(attach_disconnected,mediate_deleted) {
deny /sys/firmware/efi/efivars/** rwklx,
deny /sys/kernel/security/** rwklx,
}

profile docker-unconfined flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>

network,
capability,
file,
umount,
mount,
pivot_root,
change_profile -> *,
}
2 changes: 1 addition & 1 deletion daemon/execdriver/native/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (d *driver) setPrivileged(container *configs.Config) (err error) {
container.Devices = hostDevices

if apparmor.IsEnabled() {
container.AppArmorProfile = "unconfined"
container.AppArmorProfile = "docker-unconfined"
}

return nil
Expand Down

0 comments on commit 87376c3

Please sign in to comment.