Skip to content

Instantly share code, notes, and snippets.

@eruffaldi
Created August 29, 2016 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eruffaldi/39092b583dd4b3280e60c5f4db48c5c5 to your computer and use it in GitHub Desktop.
Save eruffaldi/39092b583dd4b3280e60c5f4db48c5c5 to your computer and use it in GitHub Desktop.
OSX Sandboxing Writing
(version 1)
(deny default)
(allow file-read*)
(allow process-exec)
(allow sysctl-read)
(allow signal)
(allow file-write* (regex (string-append "^" (regex-quote (param "target")) ".*")))
#/bin/bash
target=$1
shift 1
P=$(dirname $(realpath -s ${BASH_SOURCE[0]}))
sandbox-exec -f $P/writethere.sb -Dtarget=$target $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment