I'm working on securing communication between an Authorization Plugin and an XPC daemon, and I’d appreciate some guidance on best practices and troubleshooting.
The current design which, I’ve implemented a custom Authorization Plugin for step-up authentication, which is loaded by Authorization Services at the loginwindow (inside SecurityAgent). This plugin acts as an XPC client and connects to a custom XPC daemon.
Setup Details
1. XPC Daemon
Runs as root (LaunchDaemon)
Not sandboxed (my understanding is that root daemons typically don’t run sandboxed—please correct me if this is wrong)
Mach service: com.roboInc.AuthXpcDaemon
Bundle identifier: com.roboInc.OfflineAuthXpcDaemon
2. Authorization Plugin
Bundle identifier: com.roboInc.AuthPlugin
Loaded by SecurityAgent during login
3. Code Signing
Both plugin and daemon are signed using a development certificate
What I’m Trying to Achieve
I want to secure the XPC communication so that:
The daemon only accepts connections from trusted clients
The plugin only connects to the legitimate daemon
Communication is protected against unauthorized access
The Issue I'm facing
I attempted to validate code signatures using:
SecRequirementCreateWithString
SecCodeCopyGuestWithAttributes
SecCodeCheckValidity
However, validation consistently fails with:
-67050 (errSecCSReqFailed)
Could you please help here
What is the recommended way to securely authenticate an Authorization Plugin (running inside SecurityAgent) to a privileged XPC daemon?
Since the plugin runs inside SecurityAgent, how can the daemon reliably distinguish my plugin from other plugins?
What is the correct approach to building a SecRequirement in this scenario?
Any guidance, examples, or pointers would be greatly appreciated. Thanks in advance!
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags:
Security
Service Management
XPC
6
0
216