Hi. I have a private cryptographic key that I want to generate and store for use by the system extension only (a network extension NETransparentProxyProvider). The ideal properties I want is:
- only accessible by extension
- never leave extension
- not be accessible by root user or other apps
Here is what I have tried so far (by/within the system extension):
- app data container / local storage: this works, but is accessible by root user
- app data shared container (storage): this works, but also acccessible by root user
- system keyring: works, but also accesible by root user
System extension by itself does not seem to be able to store/load secrets in app protected keyring.
The host application however can store in app protected keyring.... So I though, let's use an app group (as access group) and have it like this shared between host and (system) extension... but nop... (system) extension cannot access the secret...
Ok... so than I thought:
- manual low-level XPC calls.... Also that doesn't work, got something almost to work but seemed to require an entire 3rd (launchd/daemon) service.... way to complex for what I want... also seems that as a root user I can use debug tools to also access it
There is however the SendMessage/HandleMessage thing available for TransparentProxy.... that does work... but
(1) also doesn't seem the most secure (2) the docs clearly state cannot rely on that for this state as the system extension can be started while the host app is not active.... (e.g. at startup)
So that is not a solution either....
I went in so many different directions and rabbit holes in the last days.... this feels like a lot harder than it should be? How do other VPN/Proxy like solutions store secrets that are unique to an extension???? I am hoping there is something available here that I am simply missing despite all my effort... any guidance greatly appreciated...