Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Set
allowPrivilegeEscalation
seccompProfile
runAsNonRoot
capabilities
in line with kubernetes pod security standards.This gets rid of most of the warnings whenever we deploy the helm chart. (#27)
allowPrivilegeEscalation
is documented (poorly) athttps://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#securitycontext-v1-core
and clarified in this article https://medium.com/pareture/how-allowprivilegeescalation-works-in-kubernetes-ce696494f87b
TL;DR this will set NoNewPrivileges to 1 on the containers, which defends against privilege escalation.
Using
RuntimeDefault
for the seccompProfile means the container runtime's default profile will be used for seccomp, which should restrict the container to a reasonable set of syscalls.For the most part we were already using
runAsUser
so we are not relying on running as root. The only one I needed to change waselasticsearchSetupJob
- this now matches the values here https://github.com/acryldata/datahub-helm/blob/2b1d1ab0ca869926829068cc4caff14d90f8f807/charts/datahub/values.yaml#L142-L143For capabilities, the policy requires that we drop everything and add only what we need. See https://man7.org/linux/man-pages/man7/capabilities.7.html
I've removed everything except for the ability to bind to ports below 1024 (CAP_NET_BIND_SERVICE)
The remaining warnings are not security related. They are caused by us using
secretKeyRef
which created maps in our YAML.