認可ポリシー

認可ポリシー ファイルは、SDV サービス バンドルのソフトウェア定義車両(SDV)通信スタックの認可構成の唯一の信頼できる情報源です。

認可ポリシー ファイルには、このサービス バンドルの権限リストが含まれています。このリストは、バンドルが実行できることを指定します。

Proto スキーマ

認可ポリシー ファイルは、関連情報をエンコードするために textproto 形式を使用します。

認可ポリシーの proto スキーマは次のとおりです。

message AuthzPolicy {
  // Optional. List of permissions to publish Data Tunnel publications.
  repeated Publisher publisher = 4;

  // Optional. List of permissions to discover and subscribe to Data Tunnel
  // publications.
  repeated Subscriber subscriber = 5;

  // Optional. List of permissions to serve an RPC server.
  repeated Server server = 6;

  // Optional. List of permissions to discover and call methods of an RPC
  // server.
  repeated Client client = 7;

  // Optional. Allow blanket "read" permission.
  //
  // Gives permission to discover and call all methods of all RPC servers,
  // as well as discover and subscribe to all publications.
  //
  // WARNING: This flag grants elevated permissions and should be used with a
  // good reason and for privileged agents only (e.g. Telemetry).
  bool allow_read_all = 8;
}

// Defines a permission to publish Data Tunnel publications.
message Publisher {
  // Required. Publication's protobuf message name.
  string message = 1;

  // Topic(s) to which this permission allows to publish to.
  //
  // Setting this field or setting 'allow_all_topics == true' is required.
  repeated string topic = 2;

  // Flag indicates that Service Bundle is allowed to register publication
  // of the 'message' type with any 'topic'
  //
  // Should only be set to 'true' if the 'topic' field is not set.
  bool allow_all_topics = 3;
}

// Defines a permission to discover and subscribe to Data Tunnel publications.
message Subscriber {
  // Required. Publication's protobuf message name.
  string message = 1;

  // Topic(s) to which this permission allows to subscribe to.
  //
  // Setting this field or setting 'allow_all_topics == true' is required.
  repeated string topic = 2;

  // Flag indicates that Service Bundle is allowed to discover and subscribe to
  // all publications of the 'message' type.
  //
  // Should only be set to 'true' if the 'topic' field is not set.
  bool allow_all_topics = 3;
}

// Defines a permission to serve an RPC server.
message Server {
  // Required. Server's protobuf service name.
  string service = 1;

  // Channel(s) which this permission allows to register.
  //
  // Setting this field or setting 'allow_all_channels == true' is required.
  repeated string channel = 2;

  // Flag indicates that Service Bundle is allowed to register RPC servers
  // of the 'service' type with any 'channel'
  //
  // Should only be set to 'true' if the 'channel' field is not set.
  bool allow_all_channels = 3;
}

// Defines a permission to discover and call methods of an RPC server.
message Client {
  // Required. Server's protobuf service name.
  string service = 1;

  // Channel(s) which this permission allows to discover and call methods on.
  //
  // Setting this field or setting 'allow_all_channels == true' is required.
  repeated string channel = 2;

  // Flag indicates that Service Bundle is allowed to discover and call all RPC
  // servers of the 'service' type.
  //
  // Should only be set to 'true' if the 'channel' field is not set.
  bool allow_all_channels = 3;
}

# 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 on any channel.
server {
  service: "com.sdv.UserPreferencesManager"
  allow_all_channels: true
}

# Allows this SB to discover and call UserPreferencesManager service on any channel.
client {
  service: "com.sdv.UserPreferencesManager"
  allow_all_channels: true
}

すべての読み取り権限の例

# Blanket read permission for privileged agents (e.g. Telemetry).
allow_read_all: true

承認の決定

システムは、次の認可の決定を行うことができます。

許可されているコンテンツ
サブジェクトの AuthzPolicy に必要な権限ルールが含まれています。
明示的に拒否
サブジェクトの AuthzPolicy または VM の AuthzPolicy に必要な権限ルールが含まれていません。権限がないことを示す明確なエラー メッセージが返されます。
暗黙的に拒否
システムエラーまたは無効なデータ(ポリシー ファイルがない、名前の解析に失敗した、単位の定義がないなど)。

判断ロジックの例

サービス バンドルがチャンネル defaultcom.sdv.UserPreferencesManager を呼び出そうとすると、次の手順が行われます。

  1. 通信スタックは、サービス バンドルの AuthzPolicyclient 権限を確認します。権限がない場合、リクエストは明示的に拒否され、サブジェクトに権限がないことが示されます。
  2. メッシュ ネットワークを介した VM 間の通信の場合、ホスト VM の権限はアクセス試行時だけでなく、サービス ディスカバリ(SD)メッシュ情報の交換時にもチェックされます。通信スタックは、ホスト VM の VmAuthzPolicy をチェックして、VM がサービスとやり取りできるかどうかを判断します。
  3. サブジェクト ポリシーと VM レベルのポリシーの両方でインタラクションが許可されている場合、リクエストは許可されます。それ以外の場合は、明示的に拒否され、VM に権限がないことを示します。

VM 間で適用されるポリシーの詳細については、VM レベルの権限をご覧ください。