-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
darwin sandbox #3429
darwin sandbox #3429
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,12 @@ | |
(literal "/dev/zero") | ||
(subpath "/dev/fd")) | ||
|
||
; Allow pseudo-terminals. | ||
(allow file* | ||
(literal "/dev/ptmx") | ||
(regex #"^/dev/pty[a-z]+") | ||
(regex #"^/dev/ttys[0-9]+")) | ||
|
||
; Does nothing, but reduces build noise. | ||
(allow file* (literal "/dev/dtracehelper")) | ||
|
||
|
@@ -85,3 +91,7 @@ | |
(literal "/etc") | ||
(literal "/var") | ||
(literal "/private/var/tmp")) | ||
|
||
; This is used by /bin/sh on macOS 10.15 and later. | ||
(allow file* | ||
(literal "/private/var/select/sh")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We actually want to explicitly disallow access to this, because this file is what’s used to control whether There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thought I tested that and it failed, but looks like it's indeed only an error message.
Luckily it doesn't really matter and not having to spew out errors out by default is nice.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really prefer not to need bash here (#3223) but other than either disallowing
/bin/sh
completely or having nix depend on something like fuse bindfs I don't think we can work around it. 😕There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really wish there was some way to say "allow /bin/bash but only when executed by /bin/sh" 🤷♀️