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 }