-
Notifications
You must be signed in to change notification settings - Fork 227
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
Improve sandboxing to allow more granular permissions #1358
Comments
sandboxing is a task that should be done by the operating system. |
At least some of what is proposed seems like reasonable extensions to the existing sandbox function. On a side note, as an example of a concrete use case, the sandbox feature was already put to good use by @AlecTroemel in the Janet support for TIC-80 to improve the security situation. See this PR if interested. |
I'm mainly interested in laying some groundwork for a more granular permission model so that it could maybe later be also exposed in janet's cli. |
Janet's own sandboxing should not conflict with external sandboxing by things like firejail, SELinux, and apparmor. If janet does its own sandboxing, I want to impose more restrictions through firejail and apparmor. |
I'm worried that granular internal sandboxing will make janet bloated.... |
Whitelisting approach will force janet to carry lists of common whitelisted paths. Apparmor and firejail carry such lists. Even apparmor can't block outgoing network connections by hostname. I don't know whether SELinux can do that. Apparmor can allow unix domain sockets by paths. It can't allow network connections by IP addresses or hosts. |
I think this is the kind of thing that's best written as an external tool. You could write such a tool in janet and C. However, I already have firejail and apparmor for that. I don't want to reinvent wheels. |
If you want this to be configured in command line options, then you should probably just use firejail or apparmor.... If janet ever does this, only sandboxing API makes sense. Landlock is linux sandboxing API. You really don't want to specify granular permissions on command line unless command line options are constructed programmatically. You want something like a firejail/apparmor profile for granular permissions. |
That's the job of firewall. Even SELinux doesn't block outgoing network connections by hosts or IP addresses. |
This is what apparmor does with profiles..... I really don't want to write verbose permissions on command line..... |
My assessment is that this is best done as an external janet library that sandboxes a janet function.... Or, it goes into spork... I don't know whether it's possible to sandbox janet.... from within... |
I'd like the sandbox (or a similar command that's more powerful, perhaps called sandcastle 😜 ) to support limiting network connections per host and file operations per path (also restrict to read, write or read/write etc.)
I might work on this when I find some time, but I wanted to create this issue to track ideas around this.
To summarize, the following features could be added to sandbox:
The text was updated successfully, but these errors were encountered: