About the naming: what's "secure" about SecureXPC? #3
-
What are the security benefits of using the C API (directly, or as its wrapped in this package) versus using the Objective C |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
macOS allows an incoming Mach service connection to come from any process. (Notably this is unlike the XPC connection used when communicating with an XPC Service; in that case incoming connections can only come from the same outermost bundle containing the service.) As of macOS 11, the XPC C API provides the public function Prior to macOS 11 API, the private function The code for this is encapsulated in The Now this doesn't mean the PID can't be used securely, it could be in a more complicated and stateful manner. Once an XPC connection is established the second message could be trusted because that means the calling process is in fact still alive and its PID does describe it. If SecureXPC were to be built on top of Alternatively there is the private |
Beta Was this translation helpful? Give feedback.
macOS allows an incoming Mach service connection to come from any process. (Notably this is unlike the XPC connection used when communicating with an XPC Service; in that case incoming connections can only come from the same outermost bundle containing the service.)
As of macOS 11, the XPC C API provides the public function
SecCodeCreateWithXPCMessage
which allows for determining which process is communicating with the Mach service. That function provides theSecCode
which represents signed code which is actively running. With aSecCode
instanceSecCodeCheckValidity
can be called which determines if the running code matches the requirements a user of the SecureXPC API would provide.Prior…