I have an application, it has main process and some child processes. As we want those child processes to have their own minimum sandbox privilege, not inheriting from parent process, we plan to use XPCService which uses a NSTask to launch those child processes, so those child processes can have its own sandbox privilege.
We plan to deliver the application to Mac App Store, so process mode is: the sandboxed main process builds connections to the unsandboxed XPCService, the unsandboxed XPCService launch those sandboxed child processes.
Can this process mode pass the Mac App Store rules? I see, there is a rule that all processes must be sandboxed, including XPCService. But I tested locally, the Application downloaded from Mac apple store also launches unsandboxed XPCService, like OneDrive.
Do you have any suggestions for my application scenario, sandboxed child processes having its own privilege not inheriting from parent?
[Hmmmm, I’m not sure why I didn’t see your response back in April, or why DevForums decided to notify me about the thread today, but I’m going to answer this just for the record.]
If the child executable [uses] sandbox_init with SBPL policy after child process is launched to enable its sandbox capacity.
Again, I don’t work for App Review, and thus can’t give you definitive answers about their policies. However, from a DTS perspective, SBPL is not documented for third-party use, so any use of it is unsupported.
Do you have any suggestions for my application scenario, sandboxed child processes having its own privilege not inheriting from sandboxed parent process?
No. It’s possible to have components with different sandbox privileges in a Mac App Store app. For example, you can embed an XPC service with a different sandbox setup than your main app. However, all executables must be signed with com.apple.security.app-sandbox
. So:
-
Executables that are launched by the system — your app, any appexes, any XPC services, and so on — start with a fresh sandbox. You can configure that sandbox with the entitlements described here.
-
Executables that are spawn by you must be signed with
com.apple.security.app-sandbox
andcom.apple.security.inherit
.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"