Skip to content
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

fix: drop privileges during docker build #773

Merged
merged 2 commits into from
Oct 23, 2024
Merged

Conversation

rti
Copy link
Contributor

@rti rti commented Sep 27, 2024

Until now, the WDQS image started as root. In the entrypoint priveleges were dropped and we switched to the "blazegraph" user. With this patch, we switch to the "blazegraph" user already during build. So the container always uses this user and does not start as root anymore.

This fixes some issues when running an interactive bash inside the container and simplifies the updater reset workaround.

https://phabricator.wikimedia.org/T362963

Until now, the WDQS image started as root. In the entrypoint priveleges
were dropped and we switched to the "blazegraph" user. With this patch,
we switch to the "blazegraph" user already during build. So the
container always uses this user and does not start as root anymore.

This fixes some issues when running an interactive bash inside the
container and simplifies the updater reset workaround.

https://phabricator.wikimedia.org/T362963
@rti rti requested a review from a team September 30, 2024 09:58
Copy link
Contributor

@lorenjohnson lorenjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! What will be the impact on existing use of the WDQS image I wonder? Would you anticipate any permissions issue?

@rti
Copy link
Contributor Author

rti commented Oct 2, 2024

This looks good! What will be the impact on existing use of the WDQS image I wonder? Would you anticipate any permissions issue?

Well, before we had this thing to fix data access rights in the entrypoint in case somebody was booting the image with a data volume populated with an image that still used the old blazegraph user AKA 666.

if [ -d /wdqs/data/ ]; then
  chown blazegraph:blazegraph -R /wdqs/data/
fi

We cannot do this anymore, because we are not root in the entrypoint with this change.

So if somebody would boot this new image with a data volume populated with an image before 9a775cc this could be a problem, because the access rights on the data do not match. But this change is already in wmde.20, wmde.18 and wmde.17 (wmde.19 missed it somehow). So coming from releases from the "deploy-era" shouldn't be a problem.

What do you think @lorenjohnson ?

@lorenjohnson
Copy link
Contributor

This looks good! What will be the impact on existing use of the WDQS image I wonder? Would you anticipate any permissions issue?

Well, before we had this thing to fix data access rights in the entrypoint in case somebody was booting the image with a data volume populated with an image that still used the old blazegraph user AKA 666.

if [ -d /wdqs/data/ ]; then
  chown blazegraph:blazegraph -R /wdqs/data/
fi

We cannot do this anymore, because we are not root in the entrypoint with this change.

So if somebody would boot this new image with a data volume populated with an image before 9a775cc this could be a problem, because the access rights on the data do not match. But this change is already in wmde.20, wmde.18 and wmde.17 (wmde.19 missed it somehow). So coming from releases from the "deploy-era" shouldn't be a problem.

What do you think @lorenjohnson ?

Given that this will not breaking anything in the 1.0 WDQS then this is still a patch or minor update, and I think ok to not document further at this time.

@rti
Copy link
Contributor Author

rti commented Oct 9, 2024

holding back for #782

@rti rti changed the title fix(wdqs): drop privileges during docker build fix: drop privileges during docker build Oct 23, 2024
@rti rti merged commit 3dd4b6f into main Oct 23, 2024
7 checks passed
@rti rti deleted the wdqs-drop-privileges-during-build branch October 23, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants