-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Change Dockerfile to run app under non-root user #922
Change Dockerfile to run app under non-root user #922
Conversation
08660a3
to
ddb29de
Compare
Hey @FZambia, just wanted to make sure you're aware of this PR. We'd love to get this change merged into the main branch to address the concerns raised by our security team. |
Hello @dmeremyanin , Thanks! Yep, I've seen. Generally the improvement is useful, but did not have time to test it out. In general, I'd like to have sth like this in Dockerfile eventually:
So I may eventually change it to this version. Please tell me whether you have any concerns about this version compared to the one you submitted? |
Thanks for reviewing the PR. Regarding your suggestion, I have a couple of points I'd like to clarify:
I understand the intent behind this line, but I think changing the file ownership in the Dockerfile could present a security risk. Specifically, it opens up the possibility of the files being altered by the process itself, which could lead to unintended consequences. As a best practice, I would generally avoid using See #1.3 in Sysdis's recommendations:
As for the In any case, I'd be happy to adjust my approach to align with your recommendations, if you don't mind. |
Thx, let's drop chown, was my mistake to assume that user won't be able to execute binary without it. Regarding WORKDIR – I guess sth may go wrong since user can't read config which is volumed into it. If you can update your PR taking best parts of both my suggestions and your concerns - please do, I'll try to test it out as soon as I can. |
ddb29de
to
a9f6cf4
Compare
@FZambia I've updated the PR to include your suggestions. |
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.
👍 👍
Many thanks @dmeremyanin |
Thank you for the review and for merging the PR. Looking forward to the new release! |
This PR updates the Dockerfile to improve security by running the application as a non-root user inside the container. This change ensures that the application no longer runs with root privileges, following best practices for containerized environments.
For more information, refer to the following resources: