aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/sandbox-defaults.sb.in
diff options
context:
space:
mode:
authorJude Taylor <me@jude.bio>2015-09-29 10:08:33 -0700
committerJude Taylor <me@jude.bio>2015-10-21 12:38:52 -0700
commit1fc0fe1baf85866bbb8d9b731e7811e3f7cf25af (patch)
treea98fad3cee5731b817b6f541c194c604ef1fd360 /src/libstore/sandbox-defaults.sb.in
parentd4cac051f7f6ebfb24856eb35f5250de1faf1a80 (diff)
remove sandbox defaults into a new file
Diffstat (limited to 'src/libstore/sandbox-defaults.sb.in')
-rw-r--r--src/libstore/sandbox-defaults.sb.in56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/libstore/sandbox-defaults.sb.in b/src/libstore/sandbox-defaults.sb.in
new file mode 100644
index 000000000..77467322b
--- /dev/null
+++ b/src/libstore/sandbox-defaults.sb.in
@@ -0,0 +1,56 @@
+(allow file-read* file-write-data (literal "/dev/null"))
+(allow ipc-posix*)
+(allow mach-lookup (global-name "com.apple.SecurityServer"))
+
+(allow file-read*
+ (literal "/dev/dtracehelper")
+ (literal "/dev/tty")
+ (literal "/dev/autofs_nowait")
+ (literal "/private/var/run/systemkeychaincheck.done")
+ (literal "/private/etc/protocols")
+ (literal "/private/var/tmp")
+ (subpath "/usr/share/locale")
+ (subpath "/usr/share/zoneinfo")
+ (literal "/private/var/db")
+ (subpath "/private/var/db/mds"))
+
+(allow file-write*
+ (literal "/dev/tty")
+ (literal "/dev/dtracehelper")
+ (literal "/mds"))
+
+(allow file-ioctl (literal "/dev/dtracehelper"))
+
+(allow file-read-metadata
+ (literal "/var")
+ (literal "/tmp")
+ ; symlinks
+ (literal "@sysconfdir@")
+ (literal "@sysconfdir@/nix")
+ (literal "@sysconfdir@/nix/nix.conf")
+ (literal "/etc/resolv.conf")
+ (literal "/private/etc/resolv.conf"))
+
+(allow file-read*
+ (literal "/private@sysconfdir@/nix/nix.conf")
+ (literal "/private/var/run/resolv.conf"))
+
+; some builders use filehandles other than stdin/stdout
+(allow file* (subpath "/dev/fd"))
+
+; allow everything inside TMP
+(allow file* process-exec
+ (subpath (param "_GLOBAL_TMP_DIR"))
+ (subpath "/private/tmp"))
+
+(allow process-fork)
+(allow sysctl-read)
+(allow signal (target same-sandbox))
+
+; allow getpwuid (for git and other packages)
+(allow mach-lookup
+ (global-name "com.apple.system.notification_center")
+ (global-name "com.apple.system.opendirectoryd.libinfo"))
+
+; allow local networking
+(allow network* (local ip) (remote unix-socket))