mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 05:01:28 +00:00
AppArmor: Deny w to /proc/* files
Introduce a write denial for files at the root of /proc. This prohibits root users from performing a chmod of those files. The rules for denials in proc are also cleaned up, making the rules better match their targets. Locally tested on: - Ubuntu precise (12.04) with AppArmor 2.7 - Ubuntu trusty (14.04) with AppArmor 2.8.95 Signed-off-by: Eric Windisch <eric@windisch.us>
This commit is contained in:
@@ -2811,6 +2811,18 @@ func (s *DockerSuite) TestAppArmorTraceSelf(c *check.C) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestAppArmorDeniesChmodProc(c *check.C) {
|
||||
testRequires(c, SameHostDaemon, NativeExecDriver, Apparmor)
|
||||
_, exitCode, _ := dockerCmdWithError("run", "busybox", "chmod", "744", "/proc/cpuinfo")
|
||||
if exitCode == 0 {
|
||||
// If our test failed, attempt to repair the host system...
|
||||
_, exitCode, _ := dockerCmdWithError("run", "busybox", "chmod", "444", "/proc/cpuinfo")
|
||||
if exitCode == 0 {
|
||||
c.Fatal("AppArmor was unsuccessful in prohibiting chmod of /proc/* files.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestRunCapAddSYSTIME(c *check.C) {
|
||||
testRequires(c, NativeExecDriver)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user