Google Cloud 提供身分與存取權管理 (IAM) 功能,可對特定Google Cloud 資源授予更精細的存取權,避免未經授權者存取其他資源。本頁面說明 Service Directory API 角色。如需 IAM 的詳細說明,請參閱 IAM 說明文件。
IAM 採用最小權限原則,可確保您僅授予使用者必要的資源存取權限。
設定 IAM 政策後,即可控管「哪些人」具備「何種」權限,可以存取「哪些」資源。IAM 政策可將特定角色授予使用者,讓該使用者擁有特定權限。
權限與角色
每個 Service Directory API 方法都需要呼叫端具備必要的 IAM 權限。您可以將角色授予使用者、群組或服務帳戶,藉此指派權限。除了基本角色擁有者、編輯者和檢視者外,您還可以將 Service Directory API 角色授予專案使用者。
權限
如要瞭解每種方法需要哪些權限,請參閱 Service Directory API 參考文件。
角色
| Role | Permissions |
|---|---|
Service Directory Admin( Full control of all Service Directory resources and permissions. |
|
Service Directory Editor( Edit Service Directory resources. |
|
Service Directory Viewer( View Service Directory resources. |
|
Service Directory Network Attacher( Gives access to attach VPC Networks to Service Directory Endpoints |
|
Private Service Connect Authorized Service( Gives access to VPC Networks via Service Directory |
|
Service agent roles
Service agent roles should only be granted to service agents.
| Role | Permissions |
|---|---|
Service Directory Service Agent( Give the Service Directory service agent access to Cloud Platform resources. |
|
使用 Google Cloud 控制台控管存取權
您可以使用 Google Cloud 主控台管理登錄的存取控管。
如要在專案層級設定存取權控管選項,請執行以下操作:
控制台
前往 Google Cloud 控制台的「IAM」(身分與存取權管理) 頁面。
從頂端的下拉式選單中選取專案。
按一下「Add」(新增)。
在「New principals」(新增主體) 中,輸入新主體的電子郵件地址。
從下拉式選單中選取所需角色:
servicedirectory.admin、servicedirectory.editor或servicedirectory.viewer按一下 [儲存]。
確認列出的主體具備您所授予的角色。
Service Directory 區域會覆寫 IAM 限制
將命名空間指派給 Service Directory 區域後,所有有權查詢私人區域的網路用戶端,都能看到服務名稱。DNS 沒有 IAM 存取控管,因為 DNS 通訊協定不提供驗證功能。
後續步驟
- 如要進一步瞭解身分與存取權管理,請參閱身分與存取權管理說明文件。
- 如要瞭解 Service Directory,請參閱「總覽」。