Commit Graph

9 Commits

Author SHA1 Message Date
e7e4e93352 apparmor: make pkg/aaparser work on read-only root
This is necessary because normally `apparmor_parser -r` will try to
create a temporary directory on the host (which is not allowed if the
host has a rootfs). However, the -K option bypasses saving things to the
cache (which avoids this issue).

  % apparmor_parser -r /tmp/docker-profile
  mkstemp: Read-only file system
  % apparmor_parser -Kr /tmp/docker-profile
  %

In addition, add extra information to the ensureDefaultAppArmorProfile
errors so that problems like this are easier to debug.

Fixes: 2f7596aaef3a ("apparmor: do not save profile to /etc/apparmor.d")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: dd340c52cb37d29d8bae687fdc60e039341b4295
Component: engine
2017-05-18 00:05:13 +10:00
f9eb0e420f pkg: return directly without ifs where possible
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 418e6123834def872edef06972c16d97b4cbc542
Component: engine
2016-12-13 22:10:11 +02:00
d0d8fac761 Get rid of err altogether by just returning the assignment
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
Upstream-commit: da5d3cccc43a9ee51c8b37c751cfbc2a4e16e9ee
Component: engine
2016-12-13 14:25:57 +08:00
911f8f8001 fix apparmor load profile
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
Upstream-commit: 2ab8f2e389b4ae90d0cec6555ea5708ceca1cc3c
Component: engine
2016-11-29 15:48:38 +08:00
c15d8c9103 Fix apparmor profile installation
Fixes #26823

Fixes an issue where apparmor was not loaded into the kernel, because
apparmor_parser was being called incorrectly.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 1a702111c61076e14f0e7ae688d0102128233daf
Component: engine
2016-09-29 18:47:20 -05:00
d90edcd897 apparmor: do not save profile to /etc/apparmor.d
Writing the profile to /etc/apparmor.d, while also manually loading it
into the kernel results in quite a bit of confusion. In addition, it
means that people using apparmor but have /etc mounted read-only cannot
use apparmor at all on a Docker host.

Fix this by writing the profile to a temporary directory and deleting it
after it's been inserted.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 2f7596aaef3a9f8ec1f2d0937462d9263bee8b6b
Component: engine
2016-09-13 16:25:16 +10:00
08e0c58b53 apparmor: fix version checks to work properly
Using {{if major}}{{if minor}} doesn't work as expected when the major
version changes. In addition, this didn't support patch levels (which is
necessary in some cases when distributions ship apparmor weirdly).

Signed-off-by: Aleksa Sarai <asarai@suse.com>
Upstream-commit: 4bf7a84c969b9309b0534a61af55b8bb824acc0a
Component: engine
2016-02-15 20:36:07 +11:00
a0c04482f7 refactor aaparser pkg, add unit tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 446f498ebac56d4ed396b6c20252d152926dc30e
Component: engine
2016-01-13 08:43:12 -08:00
d3dbad3a43 check version for docker-default aa profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: f8db9a09e0ec9b1925839ffff4f1cc5fe3ace630
Component: engine
2015-11-30 10:18:12 -08:00