|
@@ -846,12 +846,12 @@ func (s *DockerCLIRunSuite) TestRunTmpfsMountsWithOptions(c *testing.T) {
|
|
assert.Assert(c, strings.Contains(out, option))
|
|
assert.Assert(c, strings.Contains(out, option))
|
|
}
|
|
}
|
|
|
|
|
|
- // We use debian:bullseye-slim as there is no findmnt in busybox. Also the output will be in the format of
|
|
|
|
|
|
+ // We use debian:bookworm-slim as there is no findmnt in busybox. Also the output will be in the format of
|
|
// TARGET PROPAGATION
|
|
// TARGET PROPAGATION
|
|
// /tmp shared
|
|
// /tmp shared
|
|
// so we only capture `shared` here.
|
|
// so we only capture `shared` here.
|
|
expectedOptions = []string{"shared"}
|
|
expectedOptions = []string{"shared"}
|
|
- out = cli.DockerCmd(c, "run", "--tmpfs", "/tmp:shared", "debian:bullseye-slim", "findmnt", "-o", "TARGET,PROPAGATION", "/tmp").Combined()
|
|
|
|
|
|
+ out = cli.DockerCmd(c, "run", "--tmpfs", "/tmp:shared", "debian:bookworm-slim", "findmnt", "-o", "TARGET,PROPAGATION", "/tmp").Combined()
|
|
for _, option := range expectedOptions {
|
|
for _, option := range expectedOptions {
|
|
assert.Assert(c, strings.Contains(out, option))
|
|
assert.Assert(c, strings.Contains(out, option))
|
|
}
|
|
}
|
|
@@ -887,7 +887,7 @@ func (s *DockerCLIRunSuite) TestRunSysctls(c *testing.T) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-// TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp=/tmp/profile.json debian:bullseye-slim unshare' exits with operation not permitted.
|
|
|
|
|
|
+// TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp=/tmp/profile.json debian:bookworm-slim unshare' exits with operation not permitted.
|
|
func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshare(c *testing.T) {
|
|
func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshare(c *testing.T) {
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, Apparmor)
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, Apparmor)
|
|
const jsonData = `{
|
|
const jsonData = `{
|
|
@@ -910,7 +910,7 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshare(c *testing.T) {
|
|
}
|
|
}
|
|
icmd.RunCommand(dockerBinary, "run", "--security-opt", "apparmor=unconfined",
|
|
icmd.RunCommand(dockerBinary, "run", "--security-opt", "apparmor=unconfined",
|
|
"--security-opt", "seccomp="+tmpFile.Name(),
|
|
"--security-opt", "seccomp="+tmpFile.Name(),
|
|
- "debian:bullseye-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc").Assert(c, icmd.Expected{
|
|
|
|
|
|
+ "debian:bookworm-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc").Assert(c, icmd.Expected{
|
|
ExitCode: 1,
|
|
ExitCode: 1,
|
|
Err: "Operation not permitted",
|
|
Err: "Operation not permitted",
|
|
})
|
|
})
|
|
@@ -950,7 +950,7 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyChmod(c *testing.T) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-// TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:bullseye-slim unshare --map-root-user --user sh -c whoami' with a specific profile to
|
|
|
|
|
|
+// TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:bookworm-slim unshare --map-root-user --user sh -c whoami' with a specific profile to
|
|
// deny unshare of a userns exits with operation not permitted.
|
|
// deny unshare of a userns exits with operation not permitted.
|
|
func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshareUserns(c *testing.T) {
|
|
func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshareUserns(c *testing.T) {
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, Apparmor)
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, Apparmor)
|
|
@@ -982,7 +982,7 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshareUserns(c *testing.T)
|
|
}
|
|
}
|
|
icmd.RunCommand(dockerBinary, "run",
|
|
icmd.RunCommand(dockerBinary, "run",
|
|
"--security-opt", "apparmor=unconfined", "--security-opt", "seccomp="+tmpFile.Name(),
|
|
"--security-opt", "apparmor=unconfined", "--security-opt", "seccomp="+tmpFile.Name(),
|
|
- "debian:bullseye-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami").Assert(c, icmd.Expected{
|
|
|
|
|
|
+ "debian:bookworm-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami").Assert(c, icmd.Expected{
|
|
ExitCode: 1,
|
|
ExitCode: 1,
|
|
Err: "Operation not permitted",
|
|
Err: "Operation not permitted",
|
|
})
|
|
})
|
|
@@ -1034,12 +1034,12 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileAllow32Bit(c *testing.T) {
|
|
icmd.RunCommand(dockerBinary, "run", "syscall-test", "exit32-test").Assert(c, icmd.Success)
|
|
icmd.RunCommand(dockerBinary, "run", "syscall-test", "exit32-test").Assert(c, icmd.Success)
|
|
}
|
|
}
|
|
|
|
|
|
-// TestRunSeccompAllowSetrlimit checks that 'docker run debian:bullseye-slim ulimit -v 1048510' succeeds.
|
|
|
|
|
|
+// TestRunSeccompAllowSetrlimit checks that 'docker run debian:bookworm-slim ulimit -v 1048510' succeeds.
|
|
func (s *DockerCLIRunSuite) TestRunSeccompAllowSetrlimit(c *testing.T) {
|
|
func (s *DockerCLIRunSuite) TestRunSeccompAllowSetrlimit(c *testing.T) {
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
|
|
|
|
|
|
// ulimit uses setrlimit, so we want to make sure we don't break it
|
|
// ulimit uses setrlimit, so we want to make sure we don't break it
|
|
- icmd.RunCommand(dockerBinary, "run", "debian:bullseye-slim", "bash", "-c", "ulimit -v 1048510").Assert(c, icmd.Success)
|
|
|
|
|
|
+ icmd.RunCommand(dockerBinary, "run", "debian:bookworm-slim", "bash", "-c", "ulimit -v 1048510").Assert(c, icmd.Success)
|
|
}
|
|
}
|
|
|
|
|
|
func (s *DockerCLIRunSuite) TestRunSeccompDefaultProfileAcct(c *testing.T) {
|
|
func (s *DockerCLIRunSuite) TestRunSeccompDefaultProfileAcct(c *testing.T) {
|
|
@@ -1335,7 +1335,7 @@ func (s *DockerCLIRunSuite) TestRunApparmorProcDirectory(c *testing.T) {
|
|
func (s *DockerCLIRunSuite) TestRunSeccompWithDefaultProfile(c *testing.T) {
|
|
func (s *DockerCLIRunSuite) TestRunSeccompWithDefaultProfile(c *testing.T) {
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
|
|
testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
|
|
|
|
|
|
- out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:bullseye-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami")
|
|
|
|
|
|
+ out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:bookworm-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami")
|
|
assert.ErrorContains(c, err, "", out)
|
|
assert.ErrorContains(c, err, "", out)
|
|
assert.Equal(c, strings.TrimSpace(out), "unshare: unshare failed: Operation not permitted")
|
|
assert.Equal(c, strings.TrimSpace(out), "unshare: unshare failed: Operation not permitted")
|
|
}
|
|
}
|