The software-defined vehicle (SDV) platform provides an authorization framework to allow OEM control access to some resources.
Android has a permission model where every app declares its own permissions in the manifest file to describe its capabilities. The SDV authorization model is similar. SDV service bundles define permissions to declare the actions they can perform, such as publish, subscribe, serve, and call.
In Android 17 QPR2 and higher, vsidlc can automatically
generate the permissions.textproto authorization policy file from your VSIDL
catalog using the VSIDL system graph in addition to supporting manually
authored .textproto files.
Permission types
The following permission types are supported:
- Client
- Authorized to call methods on an RPC interface, identified by service type and channel.
- Server
- Authorized to implement and serve an RPC interface, identified by service type and channel.
- Publisher
- Authorized to publish messages into a data topic, identified by message type and topic.
- Subscriber
- Authorized to receive messages from a data topic, identified by message type and topic.
Authorization policy file
The authorization policy file is a single source of truth for the SDV
communications stack authorization configuration for an SDV service bundle. You
can generate the authorization policy file automatically from your VSIDL
catalog using the VSIDL system graph or write it directly in textproto
format (as a file with the extension .textproto).
Example
VSIDL
When you package a service bundle in an apex block in your VSIDL file
(with the extension .vsidl),
vsidlc automatically generates its permissions.textproto authorization
policy from the publisher, subscriber, server, and client declarations
in service_bundle:
package: "com.sdv"
service_bundle {
name: "SampleServiceBundle"
# Allows this SB to register publication of TireStatus type with "left-tire" topic only.
publisher {
message: "com.sdv.TireStatus"
topic: "left-tire"
capacity: 8
}
# Allows this SB to subscribe to publication of TireStatus type with "left-tire" topic only.
subscriber {
message: "com.sdv.TireStatus"
topic: "left-tire"
}
# Allows this SB to implement and serve UserPreferencesManager service.
server {
service: "com.sdv.UserPreferencesManager"
channel: "default"
}
# Allows this SB to discover and call UserPreferencesManager service.
client {
service: "com.sdv.UserPreferencesManager"
channel: "default"
}
}
apex {
service_bundle_manifest {
service_bundle: "SampleServiceBundle"
}
}
Textproto
# Allows this SB to register publication of TireStatus type with "left-tire" topic only.
publisher {
message: "com.sdv.TireStatus"
topic: "left-tire"
}
# Allows this SB to subscribe to publication of TireStatus type with "left-tire" topic only.
subscriber {
message: "com.sdv.TireStatus"
topic: "left-tire"
}
# Allows this SB to implement and serve UserPreferencesManager service.
server {
service: "com.sdv.UserPreferencesManager"
channel: "default"
}
# Allows this SB to discover and call UserPreferencesManager service.
client {
service: "com.sdv.UserPreferencesManager"
channel: "default"
}
To determine which service a specific authorization policy file belongs to, see Deployment. For more information about the proto schema, see Authorization policy. To learn how policies are enforced and how to inspect audit logs when a permission check fails, see Enforcement and Debug permissions violations.
VM-level permissions
VM-level permissions define authorization policies for communication between different VMs in the mesh network. This provides defense-in-depth security in case one VM is compromised. For more information, see VM-level permissions.
Mesh network
The Service Discovery architecture is set up so that all authorization policies are shared across VMs in the mesh network. No user intervention is required.
Service Discovery does a local cache lookup to discover service units on a remote VM. All authorization policies are shared among VMs to check whether the Service Discovery caller is authorized for the discovered service units.
Each node within the mesh network caches authorization policies from all other nodes. When a new node is introduced, its authorization policies are replicated to every other node. If a node connection is lost, such as during a reboot or crash, all cached authorization policies from that node are deleted. For guidance on placing unit type access control lists (ACLs) across multiple VMs and avoiding policy conflicts when a node disconnects, see Unit type ACLs.