Skip to content

Commit 79c3950

Browse files
Merge pull request #15298 from pweil-/allow-chroot
Automatic merge from submit-queue (batch tested with PRs 15834, 16321, 16353, 15298, 15433) allow sys_chroot cap on SCCs Removes the requirement to drop chroot. @smarterclayton
2 parents e4defee + 2d59f8e commit 79c3950

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

pkg/build/controller/strategy/sti.go

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ var DefaultDropCaps = []string{
3333
"MKNOD",
3434
"SETGID",
3535
"SETUID",
36-
"SYS_CHROOT",
3736
}
3837

3938
// CreateBuildPod creates a pod that will execute the STI build

pkg/build/controller/strategy/sti_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func testSTICreateBuildPod(t *testing.T, rootAllowed bool) {
130130
if v.Name == buildapi.AllowedUIDs && v.Value == "1-" {
131131
foundAllowedUIDs = true
132132
}
133-
if v.Name == buildapi.DropCapabilities && v.Value == "KILL,MKNOD,SETGID,SETUID,SYS_CHROOT" {
133+
if v.Name == buildapi.DropCapabilities && v.Value == "KILL,MKNOD,SETGID,SETUID" {
134134
foundDropCaps = true
135135
}
136136
}

pkg/cmd/server/bootstrappolicy/securitycontextconstraints.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func GetBootstrapSecurityContextConstraints(sccNameToAdditionalGroups map[string
205205
Type: securityapi.SupplementalGroupsStrategyRunAsAny,
206206
},
207207
// drops unsafe caps
208-
RequiredDropCapabilities: []kapi.Capability{"KILL", "MKNOD", "SYS_CHROOT", "SETUID", "SETGID"},
208+
RequiredDropCapabilities: []kapi.Capability{"KILL", "MKNOD", "SETUID", "SETGID"},
209209
},
210210
// SecurityContextConstraintsAnyUID allows no host access and allocates SELinux.
211211
{
@@ -234,7 +234,7 @@ func GetBootstrapSecurityContextConstraints(sccNameToAdditionalGroups map[string
234234
// prefer the anyuid SCC over ones that force a uid
235235
Priority: &securityContextConstraintsAnyUIDPriority,
236236
// drops unsafe caps
237-
RequiredDropCapabilities: []kapi.Capability{"MKNOD", "SYS_CHROOT"},
237+
RequiredDropCapabilities: []kapi.Capability{"MKNOD"},
238238
},
239239
// SecurityContextConstraintsHostNetwork allows host network and host ports
240240
{
@@ -266,7 +266,7 @@ func GetBootstrapSecurityContextConstraints(sccNameToAdditionalGroups map[string
266266
Type: securityapi.SupplementalGroupsStrategyMustRunAs,
267267
},
268268
// drops unsafe caps
269-
RequiredDropCapabilities: []kapi.Capability{"KILL", "MKNOD", "SYS_CHROOT", "SETUID", "SETGID"},
269+
RequiredDropCapabilities: []kapi.Capability{"KILL", "MKNOD", "SETUID", "SETGID"},
270270
},
271271
}
272272

0 commit comments

Comments
 (0)