mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
80d99236c1
The automatic installation of AppArmor policies prevents the management of custom, site-specific apparmor policies for the default container profile. Furthermore, this change will allow a future policy for the engine itself to be written without demanding the engine be able to arbitrarily create and manage AppArmor policies. - Add deb package suggests for apparmor. - Ubuntu postinst use aa-status & fix policy path - Add the policies to the debian packages. - Add apparmor tests for writing proc files Additional restrictions against modifying files in proc are enforced by AppArmor. Ensure that AppArmor is preventing access to these files, not simply Docker's configuration of proc. - Remove /proc/k?mem from AA policy The path to mem and kmem are in /dev, not /proc and cannot be restricted successfully through AppArmor. The device cgroup will need to be sufficient here. - Load contrib/apparmor during integration tests Note that this is somewhat dirty because we cannot restore the host to its original configuration. However, it should be noted that prior to this patch series, the Docker daemon itself was loading apparmor policy from within the tests, so this is no dirtier or uglier than the status-quo. Signed-off-by: Eric Windisch <eric@windisch.us>
39 lines
1.3 KiB
Makefile
Executable file
39 lines
1.3 KiB
Makefile
Executable file
#!/usr/bin/make -f
|
|
|
|
VERSION = $(shell cat VERSION)
|
|
|
|
override_dh_gencontrol:
|
|
# if we're on Ubuntu, we need to Recommends: apparmor
|
|
echo 'apparmor:Recommends=$(shell dpkg-vendor --is Ubuntu && echo apparmor)' >> debian/docker-engine.substvars
|
|
dh_gencontrol
|
|
|
|
override_dh_auto_build:
|
|
./hack/make.sh dynbinary
|
|
# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
|
|
|
|
override_dh_auto_test:
|
|
./bundles/$(VERSION)/dynbinary/docker -v
|
|
|
|
override_dh_strip:
|
|
# the SHA1 of dockerinit is important: don't strip it
|
|
# also, Go has lots of problems with stripping, so just don't
|
|
|
|
override_dh_auto_install:
|
|
mkdir -p debian/docker-engine/usr/bin
|
|
cp -aT "$$(readlink -f bundles/$(VERSION)/dynbinary/docker)" debian/docker-engine/usr/bin/docker
|
|
mkdir -p debian/docker-engine/usr/lib/docker
|
|
cp -aT "$$(readlink -f bundles/$(VERSION)/dynbinary/dockerinit)" debian/docker-engine/usr/lib/docker/dockerinit
|
|
|
|
override_dh_installinit:
|
|
# use "docker" as our service name, not "docker-engine"
|
|
dh_installinit --name=docker
|
|
|
|
override_dh_installudev:
|
|
# match our existing priority
|
|
dh_installudev --priority=z80
|
|
|
|
override_dh_install:
|
|
dh_apparmor --profile-name=docker -pdocker-engine
|
|
|
|
%:
|
|
dh $@ --with=bash-completion $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo --with=systemd)
|