mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3417] [Feature Request] Please allow the daemon to setuid to a particular user #2733
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#2733
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yurivict on GitHub (Apr 19, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3417
Describe the feature request
The daemon needs to read certificates as root, but then it is desirable to setuid to some unprivileged user.
Describe alternatives you've considered
No response
Affected area
@galdor commented on GitHub (Apr 19, 2023):
Being able to drop privileges to a specific user and group would be really nice; this way frp can read files such as TLS key files as root then drop to a non-privileged user for security.
You can easily do that by:
user.Lookupanduser.LookupGroup.syscall.Setgidandsyscall.Setuid(in this order).@fatedier commented on GitHub (Apr 20, 2023):
I am not inclined to introduce such complexity, as it is not a universal solution.
@yurivict commented on GitHub (Apr 20, 2023):
Why is it not a universal solution?
A lot of network servers use such strategy to improve security.
@galdor commented on GitHub (Apr 20, 2023):
This is standard procedure for many security-aware daemons. And it is not that complex, you can do it in a couple lines of code!
@fatedier commented on GitHub (Apr 20, 2023):
Doing it this way is very inelegant. A better approach would be a unified solution that is independent of the application.
If we need to support certificate renewal in the future, do we need to switch users regularly?
@galdor commented on GitHub (Apr 20, 2023):
If you want to support dynamic certificate renewal, you are in trouble. What NGINX does is to maintain both a master process running as root and one or more worker processes running as a non-privileged user. This would be a large and complex change though.
But Frp does not support certificate renewal, and restarting the daemon every couple months on certificate rotation is a non issue.
I understand if you believe this feature could be a problem in the future.
If anyone reading this issue needs to run Frp as a non-root user with TLS, I've wrote an article where I explain how to use NGINX as TLS interface to Frp.
@github-actions[bot] commented on GitHub (May 21, 2023):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.