macOS: App sandboxing via sandbox-exec (2020)
karltarvas.com
karltarvas.com
You can see some Julia code that generates the sandbox config rules here: https://github.com/JuliaCI/sandboxed-buildkite-agent/blob/ma...
you can “enjoy” the sight of some c++ directly generating scheme here: https://github.com/NixOS/nix/blob/2.9.2/src/libstore/build/l...
be warned, it's from 2017, so there are 5 years of history you'll still need to go looking for
Periodically some third-party software will inadvisedly try to use sandbox-exec and encounter problems when the policy changes. Some examples I've run into with Bazel:
(For sandboxing systems, use the Hypervisor framework or, if you want to run Linux, the Virtualization framework built on top of it)
The sandboxing API is internal, but, Chrome uses it extensively. So Apple is limited in how much they can break it, otherwise new macOS versions can't run Chrome.
> man sandbox-exec
> The sandbox-exec command is DEPRECATED.
> Developers who wish to sandbox an app should instead adopt the App Sandbox feature described in the App Sandbox Design Guide.
(Their all-caps, not mine)