Skip to content

Instantly share code, notes, and snippets.

@ipmb
Created March 18, 2022 16:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipmb/8d86308afb486c062711d00aad769839 to your computer and use it in GitHub Desktop.
Save ipmb/8d86308afb486c062711d00aad769839 to your computer and use it in GitHub Desktop.
Playing around with sandbox-exec for local development
(version 1)
(allow default)
(debug deny)
(define (home-subpath home-relative-subpath)
;; should be able to use something like (param "HOME_DIR") here, but it's not working for me
(subpath (string-append "/Users/pete" home-relative-subpath)))
;; can't write anywhere or read /Users by default
(deny file-write*)
(deny file-read*
(subpath "/Users")
)
(allow file-read*
;; access package manager (pdm)
(home-subpath "/.local/bin")
(home-subpath "/.local/pipx")
;; access python
(home-subpath "/.asdf")
(home-subpath "/.tool-versions")
)
(allow file-read* file-write*
;; only needed for install
(home-subpath "/Library/Caches/pdm")
;; project dir
(home-subpath "/projects/my-project")
;; temp
(regex "^(/private)?/tmp/")
(regex "^(/private)?/var/folders")
(subpath "/dev/null")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment