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

Import of gojail #12

Open
gizahNL opened this issue Jun 3, 2021 · 1 comment
Open

Import of gojail #12

gizahNL opened this issue Jun 3, 2021 · 1 comment

Comments

@gizahNL
Copy link
Contributor

gizahNL commented Jun 3, 2021

I've written gojail as a tool for both runj & the Docker port that I'm working on. As we've talked about integrating gojail with the runj repo seems like the best step forward to evolve both.

As of now gojail is implemented in pure go, using the standard FreeBSD syscalls and simple parsing of jail parameters. Implementing via cgo, using only the libc jail syscalls or additionally also using libjail seems trivial and can be done if the consensus goes in that direction.

TODO (missing/uninplemented in gojail):
-proper validation of jail parameters, either via a static configuration or dynamically via pulling in the syscall mibs
-implementation of the RunIn command, I'm still on the fence on how to properly do this. One direction I think might be worth exploring is simply returning an exec.Cmd wrapping the supplied command with /usr/sbin/jexec, if golang/go#46259 makes it we could then via go version build tags drop the jexec

PR will follow

@briandowns
Copy link

Might be old and out of date as of now but I wrote this if it's of any help. https://github.com/briandowns/jail

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

2 participants