Hello!
I'm writing a System Extension that is an Endpoint Security client. And I want to Deny/Allow executing some XPC Service processes (using the ES_EVENT_TYPE_AUTH_EXEC
event) depending on characteristics of a process that starts the XPC Service.
For this purpose, I need an API that could allow me to obtain an execution context of the XPC Service process. I can obtain this information using the "sudo launchctl procinfo <pid>
" command (e.g. I can use the "domain = pid/3428" part of the output for this purpose). Also, I know that when the xpcproxy
process is started, it gets as the arguments a service name and a pid
of the process that requests the service so I can grasp the execution context from xpcproxy
launching. But are these ways to obtain this info legitimate?