-
Notifications
You must be signed in to change notification settings - Fork 567
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
Options to deal with open file descriptors #4845
Comments
I'd say any prevention of accidental leakage is a welcome enhancement and the proposed options sound great.
Just out of curiosity, could you provide an example of such a case? |
Is there anything bad expect that you can read/write on that fd?
|
Open FDs are bad in simple chroots, as you can use them to escape with Not sure how firejail behaves with |
Yeah, if the open fd refers to a directory you can |
It depends on the file descriptor. As a rule of thumb everything that can be done with a file descriptor outside the sandbox can be done also inside the sandbox. This includes reading/writing to files or interprocess communication. Many file descriptors (those that are obtained by actually opening a file) are bound to a mount point, and inherited file descriptors necessarily refer to mount points outside the sandbox. So a worst case scenario would be a file descriptor that allows to bypass a Pythons
Hopefully not! |
It is rarely used, so we should prevent it by default + some command line option to opt-out. |
I used |
Currently Firejail sandboxes inherit all open file descriptors from their parent process.
As far as standard streams (stdin, stdout, stderr) are concerned this is probably desired behaviour. On the other hand, passing non-standard file descriptors (> 2) into the sandbox is only rarely necessary in my experience.
IMHO Firejail should provide a mechanism to prevent accidental leakage of open file descriptors, either by default with a way to opt-out, or alternatively as an opt-in. I would like to know if there is general interest in options like
inheritfd
(don't close one or more file descriptors > 2)discard-stdin
(-> /dev/null)discard-stdout
(-> /dev/null)discard-stderr
(-> /dev/null)The text was updated successfully, but these errors were encountered: