Commit Graph

4 Commits

Author SHA1 Message Date
Hervé Beraud
c70de0eabb apparmor: catch config file opening error
Improve config file error opening management
and improve main code block.

Execute this python script during CI to avoid
regressions

Signed-off-by: Hervé Beraud <hberaud@redhat.com>
2019-02-12 23:09:04 +01:00
Fox Wilson
e2f91e3434 Use /usr/bin/env python3 instead of /usr/bin/python3 project-wide
This fixes invocations of certain commands when python3 is installed in
a nonstandard path (/usr/local/bin, for example).

Signed-off-by: Fox Wilson <2016fwilson@tjhsst.edu>
2015-11-10 15:53:33 -05:00
Serge Hallyn
94a77f3fd8 apparmor: deny writes to most of /proc/sys (v2)
Allow writes to kernel.shm*, net.*, kernel/domainname and
kernel/hostname,

Also fix a bug in the lxc-generate-aa-rules.py script in a
path which wasn't being exercised before, which returned a
path element rather than its child.

Changelog (v2): remove trailing / from block path

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-02 09:54:54 -05:00
Serge Hallyn
198b363fff apparmor: auto-generate the blacklist rules
This uses the generate-apparmor-rules.py script I sent out some time
ago to auto-generate apparmor rules based on a higher level set of
block/allow rules.

Add apparmor policy testcase to make sure that some of the paths we
expect to be denied (and allowed) write access to are in fact in
effect in the final policy.

With this policy, libvirt in a container is able to start its
default network, which previously it could not.

v2: address feedback from stgraber
	  put lxc-generate-aa-rules.py into EXTRA_DIST
	  add lxc-test-apparmor, container-base and container-rules to .gitignore
	  take lxc-test-apparmor out of EXTRA_DIST
	  make lxc-generate-aa-rules.py pep8-compliant
	  don't automatically generate apparmor rules
	  This is only bc we can't be guaranteed that python3 will be
	  available.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-01 13:49:43 -04:00