From 11c792541f51ebb867378c560b87bbb069eb7d7d Mon Sep 17 00:00:00 2001 From: Clay Kauzlaric Date: Wed, 13 Sep 2023 12:57:30 -0400 Subject: [PATCH] run as non root by default --- pkg/apis/serving/v1/revision_defaults.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/apis/serving/v1/revision_defaults.go b/pkg/apis/serving/v1/revision_defaults.go index 8acbf3446fd1..47949f7e9e38 100644 --- a/pkg/apis/serving/v1/revision_defaults.go +++ b/pkg/apis/serving/v1/revision_defaults.go @@ -208,6 +208,8 @@ func (rs *RevisionSpec) defaultSecurityContext(psc *corev1.PodSecurityContext, c } } + updatedSC.RunAsNonRoot = ptr.Bool(true) + if *updatedSC != (corev1.SecurityContext{}) { container.SecurityContext = updatedSC }