-
Notifications
You must be signed in to change notification settings - Fork 175
Enable Elasticsearch running as non-root without any extra capabilities or privileges #703
Enable Elasticsearch running as non-root without any extra capabilities or privileges #703
Conversation
Hi @timricese, thanks for the PR, we have a few questions hope you can address:
Thanks. |
1: absolutely, ill change that shortly regarding 2:, would a console log of install via helm and then showing the pods are actually running and healthy be enough? Or do you have any unit tests for the helm package that i might not be aware of? |
By setting a securityContext for the pod, disabling initContainers and not giving SYS_CHROOT cap (both of which might not even be required anyway) it is possible to run as non-root. The "fixmount" initContainer is not required if a fsGroup is set via securityContext. The "SYS_CHROOT" cap does not appear to be required any more. Example parameters for this setup are given in values-nonroot.yaml Signed-off-by: Tim Rice <[email protected]>
Signed-off-by: Tim Rice <[email protected]>
…h.securityContextCustom' Signed-off-by: Tim Rice <[email protected]>
Thanks @timricese for the test results and logs. |
…search container can now be run as non-root. This commit uses Malcolm's normal "drop privileges" pattern so that by the time the docker entrypoint for the ODFE container is called we are already a non-root user.
Hi, [xxxx]$ kubectl logs -f test-opendistro-es-client-6bbb7dd9fd-przsc elasticsearch SuccessExecute this script now on all your nodes and then start all nodestee: securityadmin_demo.sh: Permission denied Helm install command: Can you please help me understand what could be missing here. The same test seemed to have passed as part of this change. Thanks. |
Is there any update on this issue? |
Issue #, if available:
#555 partially
Description of changes:
Implemented helm varaibles for setting a securityContext for Elasticsearch pods, disabling fixmount initContainers and not giving SYS_CHROOT cap (both of which might not even be required anyway), in order to make it possible to run as non-root.
The "fixmount" initContainer is not required if a fsGroup is set via
securityContext.
The "SYS_CHROOT" cap does not appear to be required any more.
Example parameters for this setup are given in values-nonroot.yaml
Default values will not change the previous behavior of the helm chart.
Test Results:
Tested on production grade cluster, both via gitops/flux/helm-operator and helm-cli install
Note: If this PR is related to Helm, please also update the README for related documentation changes. Thanks.
https://github.com/opendistro-for-elasticsearch/opendistro-build/blob/master/helm/README.md
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on signing off your commits, please check here.