Skip to content

Commit 4cfcb02

Browse files
authored
Merge pull request #622 from tspearconquest/security_context_values
Add support for setting seccomp profile and allow privilege escalatio…
2 parents e0b9739 + 1e3f9f5 commit 4cfcb02

File tree

1 file changed

+8
-0
lines changed
  • cmd/azure-keyvault-secrets-webhook

1 file changed

+8
-0
lines changed

cmd/azure-keyvault-secrets-webhook/pod.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,20 @@ func (p podWebHook) getInitContainers() []corev1.Container {
8282
},
8383
},
8484
}
85+
if viper.IsSet("webhook_container_security_context_allow_privilege_escalation") {
86+
container.SecurityContext.AllowPrivilegeEscalation = &[]bool{viper.GetBool("webhook_container_security_context_allow_privilege_escalation")}[0]
87+
}
8588
if viper.IsSet("webhook_container_security_context_user_uid") {
8689
container.SecurityContext.RunAsUser = &[]int64{viper.GetInt64("webhook_container_security_context_user_uid")}[0]
8790
}
8891
if viper.IsSet("webhook_container_security_context_group_gid") {
8992
container.SecurityContext.RunAsGroup = &[]int64{viper.GetInt64("webhook_container_security_context_group_gid")}[0]
9093
}
94+
if viper.IsSet("webhook_container_security_context_seccomp_runtime_default") && viper.GetBool("webhook_container_security_context_seccomp_runtime_default") {
95+
container.SecurityContext.SeccompProfile = &corev1.SeccompProfile{
96+
Type: corev1.SeccompProfileTypeRuntimeDefault,
97+
}
98+
}
9199

92100
return []corev1.Container{container}
93101
}

0 commit comments

Comments
 (0)