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

Add a testing only feature for running as unprivileged user #949

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bjorn3
Copy link
Collaborator

@bjorn3 bjorn3 commented Jan 13, 2025

This feature must never be used in production. To ensure this, it needs to be enabled using RUSTFLAGS rather than as cargo feature, there is a compile error for using it with debug assertions enabled and we also check for setuid and being root at runtime and refuse to run in either case.

It would also be possible to keep this in a side branch from which you can cherry-pick when you want to do this kind of testing if the risk of someone using this in production is still considered too big despite the countermeasures against this.

@bjorn3 bjorn3 force-pushed the unprivileged_testing branch 3 times, most recently from 3ef0998 to 295e4dd Compare January 13, 2025 09:42
This feature must never be used in production. To ensure this, it needs
to be enabled using RUSTFLAGS rather than as cargo feature, there is a
compile error for using it with debug assertions enabled and we also
check for setuid and being root at runtime and refuse to run in either
case.
@bjorn3 bjorn3 force-pushed the unprivileged_testing branch from 295e4dd to 5b38647 Compare January 13, 2025 09:43
@squell squell added minor minor issue, PR without an issue discussion labels Jan 14, 2025
@squell
Copy link
Member

squell commented Jan 15, 2025

Having a tag for this commit, to be cherry-picked (and kept-up-to-date) seems very useful.

I'm not convinced yet that it needs to be in main--even though there are safeguards, those safeguards in themselves add some complexity logic. Unless there would be a way to more neatly separate this out.

@squell squell marked this pull request as draft January 21, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion minor minor issue, PR without an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants