นโยบายการให้สิทธิ์

ไฟล์นโยบายการให้สิทธิ์เป็นแหล่งข้อมูลที่เชื่อถือได้เพียงแหล่งเดียว (SSOT) สำหรับการกำหนดค่าการให้สิทธิ์สแต็กการสื่อสารของยานพาหนะที่กำหนดโดยซอฟต์แวร์ (SDV) สำหรับแพ็กเกจบริการ SDV

ไฟล์นโยบายการให้สิทธิ์ประกอบด้วยรายการสิทธิ์สำหรับแพ็กเกจบริการนี้ ซึ่งระบุสิ่งที่แพ็กเกจทำได้

สคีมา Proto

ไฟล์นโยบายการให้สิทธิ์ใช้รูปแบบ textproto สำหรับการเข้ารหัสข้อมูลที่เกี่ยวข้อง

สคีมาโปรโตของนโยบายการให้สิทธิ์มีดังนี้

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 ของเรื่องหรือ AuthzPolicy ของ VM ไม่มีกฎการให้สิทธิ์ที่จำเป็น ระบบจะแสดงข้อความแสดงข้อผิดพลาดที่ชัดเจนซึ่งระบุสิทธิ์ที่ขาดหายไป
ปฏิเสธโดยนัย
ข้อผิดพลาดของระบบหรือข้อมูลไม่ถูกต้อง เช่น ไม่มีไฟล์นโยบาย แยกวิเคราะห์ชื่อไม่สำเร็จ หรือไม่มีคำจำกัดความของหน่วย

ตัวอย่างตรรกะการตัดสินใจ

ขั้นตอนต่อไปนี้จะเกิดขึ้นเมื่อแพ็กเกจบริการพยายามโทรหา com.sdv.UserPreferencesManager ในช่องทาง default

  1. สแต็กการสื่อสารจะตรวจสอบ AuthzPolicy ของแพ็กเกจบริการเพื่อหาสิทธิ์ client หากไม่มีสิทธิ์ คำขอจะถูกปฏิเสธอย่างชัดแจ้ง ซึ่งบ่งชี้ว่าเรื่องดังกล่าวไม่มีสิทธิ์
  2. สำหรับการสื่อสารข้าม VM ผ่านเครือข่ายที่ทำงานร่วมกัน ระบบจะตรวจสอบสิทธิ์ของ VM โฮสต์ระหว่างการแลกเปลี่ยนข้อมูลที่ทำงานร่วมกันของ Service Discovery (SD) แทนที่จะตรวจสอบเฉพาะระหว่างการพยายามเข้าถึงเท่านั้น สแต็กการสื่อสารจะตรวจสอบ VmAuthzPolicy ของ VM โฮสต์เพื่อพิจารณาว่า VM ได้รับอนุญาตให้โต้ตอบกับบริการหรือไม่
  3. หากทั้งนโยบายเรื่องและนโยบายระดับ VM อนุญาตการโต้ตอบ คำขอจะได้รับอนุญาต มิฉะนั้น ระบบจะปฏิเสธอย่างชัดแจ้ง ซึ่งบ่งชี้ว่า VM ไม่มีสิทธิ์

ดูข้อมูลเพิ่มเติมเกี่ยวกับนโยบายที่บังคับใช้ระหว่าง VM ได้ที่สิทธิ์ระดับ VM