Skip to content

Commit f72a656

Browse files
committed
bindata: Use restricted-v3 scc for deployments
This effectively enforces user namespaces.
1 parent 4140632 commit f72a656

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

bindata/assets/deployments/console-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ spec:
2121
component: ui
2222
annotations:
2323
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
24-
openshift.io/required-scc: restricted-v2
24+
openshift.io/required-scc: restricted-v3
2525
spec:
2626
nodeSelector:
2727
node-role.kubernetes.io/master: ""
2828
restartPolicy: Always
2929
serviceAccountName: console
3030
schedulerName: default-scheduler
31+
hostUsers: false
3132
securityContext:
3233
runAsNonRoot: true
3334
seccompProfile:

bindata/assets/deployments/downloads-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ spec:
2222
component: downloads
2323
annotations:
2424
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
25-
openshift.io/required-scc: restricted-v2
25+
openshift.io/required-scc: restricted-v3
2626
spec:
2727
nodeSelector:
2828
kubernetes.io/os: linux
2929
node-role.kubernetes.io/master: ""
3030
terminationGracePeriodSeconds: 0
31+
hostUsers: false
3132
securityContext:
3233
runAsNonRoot: true
3334
seccompProfile:

pkg/console/subresource/deployment/deployment_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func TestDefaultDeployment(t *testing.T) {
137137
infrastructureConfigResourceVersionAnnotation: "",
138138
consoleImageAnnotation: "",
139139
workloadManagementAnnotation: workloadManagementAnnotationValue,
140-
requiredSCCAnnotation: "restricted-v2",
140+
requiredSCCAnnotation: "restricted-v3",
141141
}
142142

143143
consoleDeploymentAffinity := &corev1.Affinity{
@@ -244,6 +244,7 @@ func TestDefaultDeployment(t *testing.T) {
244244
RestartPolicy: corev1.RestartPolicyAlways,
245245
SchedulerName: corev1.DefaultSchedulerName,
246246
TerminationGracePeriodSeconds: &gracePeriod,
247+
HostUsers: ptr.To(false),
247248
SecurityContext: &corev1.PodSecurityContext{
248249
RunAsNonRoot: utilpointer.Bool(true),
249250
SeccompProfile: &corev1.SeccompProfile{
@@ -322,6 +323,7 @@ func TestDefaultDeployment(t *testing.T) {
322323
RestartPolicy: corev1.RestartPolicyAlways,
323324
SchedulerName: corev1.DefaultSchedulerName,
324325
TerminationGracePeriodSeconds: &gracePeriod,
326+
HostUsers: ptr.To(false),
325327
SecurityContext: &corev1.PodSecurityContext{
326328
RunAsNonRoot: utilpointer.Bool(true),
327329
SeccompProfile: &corev1.SeccompProfile{
@@ -400,6 +402,7 @@ func TestDefaultDeployment(t *testing.T) {
400402
RestartPolicy: corev1.RestartPolicyAlways,
401403
SchedulerName: corev1.DefaultSchedulerName,
402404
TerminationGracePeriodSeconds: &gracePeriod,
405+
HostUsers: ptr.To(false),
403406
SecurityContext: &corev1.PodSecurityContext{
404407
RunAsNonRoot: utilpointer.Bool(true),
405408
SeccompProfile: &corev1.SeccompProfile{
@@ -471,6 +474,7 @@ func TestDefaultDeployment(t *testing.T) {
471474
RestartPolicy: corev1.RestartPolicyAlways,
472475
SchedulerName: corev1.DefaultSchedulerName,
473476
TerminationGracePeriodSeconds: &gracePeriod,
477+
HostUsers: ptr.To(false),
474478
SecurityContext: &corev1.PodSecurityContext{
475479
RunAsNonRoot: utilpointer.Bool(true),
476480
SeccompProfile: &corev1.SeccompProfile{
@@ -1627,6 +1631,7 @@ func TestDefaultDownloadsDeployment(t *testing.T) {
16271631
TolerationSeconds: &tolerationSeconds,
16281632
},
16291633
},
1634+
HostUsers: ptr.To(false),
16301635
SecurityContext: &corev1.PodSecurityContext{
16311636
RunAsNonRoot: utilpointer.Bool(true),
16321637
SeccompProfile: &corev1.SeccompProfile{
@@ -1742,7 +1747,7 @@ func TestDefaultDownloadsDeployment(t *testing.T) {
17421747
Labels: labels,
17431748
Annotations: map[string]string{
17441749
workloadManagementAnnotation: workloadManagementAnnotationValue,
1745-
requiredSCCAnnotation: "restricted-v2",
1750+
requiredSCCAnnotation: "restricted-v3",
17461751
},
17471752
},
17481753
Spec: downloadsDeploymentPodSpecSingleReplica,
@@ -1785,7 +1790,7 @@ func TestDefaultDownloadsDeployment(t *testing.T) {
17851790
Labels: labels,
17861791
Annotations: map[string]string{
17871792
workloadManagementAnnotation: workloadManagementAnnotationValue,
1788-
requiredSCCAnnotation: "restricted-v2",
1793+
requiredSCCAnnotation: "restricted-v3",
17891794
},
17901795
},
17911796
Spec: *downloadsDeploymentPodSpecHighAvail,

0 commit comments

Comments
 (0)