-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
sandboxing prevents access to /proc/
directory
#169
Comments
Hi, thanks for the feature request, and the offer to implement it! I'm not familiar with what the security implications are for allowing access to its own process. I have several questions regarding this request. First, what uses cases are we supporting by allowing access to this? If we're going to be making the default sandbox less strict, we need to have good reason to take on the potential risk. We're aiming to provide a sandbox with sane, secure defaults. Bear in mind that it is possible to use a custom config for one's own snekbox instance. Second, how can we be reasonably confident that this change poses no or minimal security risk? Finally, how can we be reasonably confident the implementation is correct? |
The main use case of this (and really all that it would allow it to do) would be to allow a process to dynamically access/analyze information about itself.
To my knowledge, there are no security risks involved with a process accessing its own process information. However, the access could be limited to only certain parts of the
We'd check if the process can access its Let me know how what you think! (I might not get back to you immediately as things are quite busy here, but I will get back to you within the next few days.) Thanks for taking the time to respond to my idea. |
Do you have any specific use cases in mind? How is a process being able to access information about itself useful?
I'm more comfortable starting with this, and leaving the door open to expanding it in the future. There are some things that seem pretty benign and straight forward (like |
It's not the most useful thing, in that almost everything you could do using it you could do via similar already allowed means, but there are some things like
The ones that I originally wanted were While we're at it, |
These all sound fine. And
On second thought, wouldn't this allow one eval to access another eval's file descriptors? We do create a PID namespace with nsjail. I wonder if when we mount |
That is correct. It's just a convenient shortcut that we might as well include if we're going to include
As long as each eval is a separate process, (and as I understand it, that's true), that wouldn't be an issue. Each process would see
|
Yeah, each eval invokes a separate nsjail process which IIRC uses
How would we accomplish that? Would we have to know the PID of the process ahead of time? Mount options have to be passed to nsjail before it creates the Python process. |
The directory
/proc/[pid]/
isn't available, which I think is a bit too harsh of a sandboxing measure in this case. I don't know of any use case where accessing/proc/[pid]/*
could be abused. I understand not letting it mess with other processes, but you can restrict it to only its own process using symlinks or something similar, so that shouldn't be much of an issue.Let me know if that idea sounds good! If it does I'll probably submit a PR within the next week or so to implement this idea.
The text was updated successfully, but these errors were encountered: