Skip to content

Commit 05979d1

Browse files
authored
adjust security context for serverless workloads (#2457)
1 parent 6c428a8 commit 05979d1

6 files changed

Lines changed: 2 additions & 6 deletions

File tree

components/buildless-serverless/internal/controller/resources/deployment.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ func containerSecurityContext(f *serverlessv1alpha2.Function) *corev1.SecurityCo
487487
"ALL",
488488
},
489489
},
490-
ProcMount: ptr.To(corev1.DefaultProcMount),
491490
ReadOnlyRootFilesystem: ptr.To(true),
492491
AllowPrivilegeEscalation: ptr.To(false),
493492
RunAsNonRoot: ptr.To(true),

components/buildless-serverless/internal/controller/resources/deployment_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,6 @@ func Test_containerSecurityContext(t *testing.T) {
18811881
"ALL",
18821882
},
18831883
},
1884-
ProcMount: ptr.To(corev1.DefaultProcMount),
18851884
ReadOnlyRootFilesystem: ptr.To(true),
18861885
AllowPrivilegeEscalation: ptr.To(false),
18871886
RunAsNonRoot: ptr.To(true),
@@ -1901,7 +1900,6 @@ func Test_containerSecurityContext(t *testing.T) {
19011900
"ALL",
19021901
},
19031902
},
1904-
ProcMount: ptr.To(corev1.DefaultProcMount),
19051903
ReadOnlyRootFilesystem: ptr.To(true),
19061904
AllowPrivilegeEscalation: ptr.To(false),
19071905
RunAsNonRoot: ptr.To(true),
@@ -1930,7 +1928,6 @@ func Test_containerSecurityContext(t *testing.T) {
19301928
"SYS_TIME",
19311929
},
19321930
},
1933-
ProcMount: ptr.To(corev1.DefaultProcMount),
19341931
ReadOnlyRootFilesystem: ptr.To(false),
19351932
AllowPrivilegeEscalation: ptr.To(true),
19361933
RunAsNonRoot: ptr.To(true),

components/buildless-serverless/internal/endpoint/runtime/resources_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ spec:
162162
drop:
163163
- ALL
164164
privileged: false
165-
procMount: Default
166165
readOnlyRootFilesystem: true
167166
runAsNonRoot: true
168167
startupProbe:

config/buildless-serverless/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ spec:
7474
memory: 64Mi
7575
securityContext:
7676
allowPrivilegeEscalation: false
77+
runAsNonRoot: true
7778
capabilities:
7879
drop:
7980
- ALL

config/operator/base/deployment/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ spec:
7878
value: europe-docker.pkg.dev/kyma-project/prod/function-buildless-init:main
7979
securityContext:
8080
allowPrivilegeEscalation: false
81+
runAsNonRoot: true
8182
capabilities:
8283
drop:
8384
- "ALL"

docs/user/resources/06-10-function-cr.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ spec:
7272
drop:
7373
- ALL
7474
privileged: false
75-
procMount: Default
7675
readOnlyRootFilesystem: true
7776
runAsNonRoot: true
7877
functionResourceProfile: XS

0 commit comments

Comments
 (0)