Skip to content

Commit

Permalink
fix: explicitly set runAsNonRoot to false (#697) (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhduvall committed Jan 13, 2023
1 parent f41afae commit 03e849e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pkg/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ func (m *podMutator) injectProxyInitContainer(containers []corev1.Container, pro
Add: []corev1.Capability{"NET_ADMIN"},
Drop: []corev1.Capability{"ALL"},
},
Privileged: pointer.BoolPtr(true),
RunAsUser: pointer.Int64Ptr(0),
Privileged: pointer.BoolPtr(true),
RunAsNonRoot: pointer.BoolPtr(false),
RunAsUser: pointer.Int64Ptr(0),
},
Env: []corev1.EnvVar{{
Name: ProxyPortEnvVar,
Expand Down
5 changes: 3 additions & 2 deletions pkg/webhook/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1251,8 +1251,9 @@ func TestInjectProxyInitContainer(t *testing.T) {
Add: []corev1.Capability{"NET_ADMIN"},
Drop: []corev1.Capability{"ALL"},
},
Privileged: pointer.BoolPtr(true),
RunAsUser: pointer.Int64Ptr(0),
Privileged: pointer.BoolPtr(true),
RunAsNonRoot: pointer.BoolPtr(false),
RunAsUser: pointer.Int64Ptr(0),
},
Env: []corev1.EnvVar{{
Name: ProxyPortEnvVar,
Expand Down

0 comments on commit 03e849e

Please sign in to comment.