feat: add uid and gid support for command execution#332
feat: add uid and gid support for command execution#332joaquinescalante23 wants to merge 1 commit intoalibaba:mainfrom
Conversation
|
Love the changes made, and the added security measures! |
|
Thanks for the detailed review, @Pangjiping . Great point about the supplemental groups. I definitely overlooked that they wouldn't be inherited correctly just by setting Uid/Gid in SysProcAttr. |
Whether to provide "zero values" has always been a criticized design in Go. A simple way to handle this is that you can receive |
76663c3 to
1d578d4
Compare
|
Thanks for the feedback, @Pangjiping. I've updated the implementation to address the UID/GID zero-value ambiguity by using pointers ( In addition to handling the identity of the process correctly (distinguishing between root 0 and unset), I've also implemented support for supplemental groups. The execution process now uses If the Gid is omitted but a Uid is provided, the process now correctly defaults to the user's primary GID. Let me know if you have any further thoughts! |
LGTM. It seems there are some linter errors, you can run |
Summary
uidandgidfields toRunCommandRequestfor command executionMotivation
This feature allows users to run commands as specific users in the sandbox for better security isolation and access control.
Changes