We are writing a daemon that can communicate with a server and provide some basic system info as part of managing multiple devices. The server can pass a script to the daemon to be run on the device to either collect more info or fix an issue. The script is signed by the server using digital certificate of the server and we can can verify the script has not been modified over the network.
We wanted to separate the task of running the script itself into a different executable which can communicate with the daemon using XPC. Now that the script runner has the script, we could write to disk and run it but the script can potentially be modified between writing to disk and running it.
I am not sure if we have the script body and arguments, can we avoid writing to disk altogether and invoke it from memory? If not, is there a secure way for the process to write the script to disk and run it? Or is there another better option altogether?
Post
Replies
Boosts
Views
Activity
The helper app that is responsible for running scripts is sandboxed. The main app is expected to pass the signed script to the scriptRunner app through XPC.