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

setgid/setuid/chroot? #7

Open
avsm opened this issue Apr 15, 2015 · 3 comments
Open

setgid/setuid/chroot? #7

avsm opened this issue Apr 15, 2015 · 3 comments

Comments

@avsm
Copy link
Contributor

avsm commented Apr 15, 2015

See stud's command-line options:

  -r  --chroot=DIR           Sets chroot directory (Default: "")
  -u  --user=USER            Set uid/gid after binding the socket (Default: "")
  -g  --group=GROUP          Set gid after binding the socket (Default: "")
@avsm
Copy link
Contributor Author

avsm commented Apr 15, 2015

Maybe use release for this: https://github.com/andrenth/release

@cfcs
Copy link

cfcs commented Apr 16, 2015

Not sure what the point of this would be, but if you do need to sandbox it, it should probably be done in a thorough fashion:

  • Care should also be taken to close inherited file descriptors and get rid of shared memory segments (shm*()).
  • When setting uid/gid, euid and egid should be set accordingly
  • Under Linux:
    • seccomp-bpf whitelisting should be used to limit system calls
    • Namespaces should be used (clean mount and network namespaces, probably process namespace too)

Additional resources:

@hannesm
Copy link
Owner

hannesm commented Apr 18, 2015

patches welcome. I also stumbled upon mirage/charrua@de2c28f recently

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

No branches or pull requests

3 participants