In updater code, we have a requirement that certain RPCs can only be called from a client running at the same privilege level, whereas others are permitted to cross privilege levels.
For example, we might imagine there exists a singleton server/receiver process on the system, running as root, which exposes an API like:
ServerApi {
GetVersion() => (string version)
InstallApplication(string app_id) => (int result)
}
A caller running as waffles@ should be able to ask the server its version, but not call InstallApplication (only a client running as root should be able to call InstallApplication). Additionally, the server may wish to check the code signing status of the client before proceeding with the operation. (The same idea applies on Windows with crossing integrity levels.)
Basically, the problem here is one of trusted/powerful receivers and untrustworthy remotes; sort of the opposite of a more common (I think) pattern in Chromium of trusted/powerful callers dispatching tasks to untrustworthy helpers.
My understanding is that we'd have to implement such checks when we set up the message pipe. Does that sound right / is it sufficient? And does this mean that we shouldn't use the platform API (or at least not NamedPlatformChannel with guessable names) and invitations?
Or in general, do you have any other advice/guidance here?