-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docker] Do not run container as root #5314
Conversation
Fixes opensearch-project#5311 Signed-off-by: Jan Høydahl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @janhoy for this contribution! I have one comment about the specific user.
Signed-off-by: Jan Høydahl <[email protected]>
Signed-off-by: Jan Høydahl <[email protected]>
Signed-off-by: Jan Høydahl <[email protected]>
Signed-off-by: Jan Høydahl <[email protected]>
So I think this is ready. Tested it in a k8s cluster using helm chart and this container security context: securityContext:
capabilities:
drop:
- ALL
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000 Prepper container ran as it should, under the new user. I'll follow up with a PR to the helm chart repo to add this security context (commented-out). Only once a new docker image version is released can we make such config default. EDIT: Well, such a commented section already exists, so guess there is no need for change until we can uncomment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Thank you @janhoy !
Thanks for approving. Are the test failures related to the changes by any chance? |
@janhoy , No, these are flaky tests. We can merge this. |
Description
In Dockerfile, run under the
nobody
user instead of root. Also chown some directories.Issues Resolved
Resolves #5311
Check List
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 following Developer Certificate of Origin and signing off your commits, please check here.