Google Cloud 提供身分與存取權管理 (IAM) 功能,可對特定 Google Cloud 資源授予更精細的存取權,避免未經授權者存取其他資源。本頁面說明 Cloud DNS API 角色。如要進一步瞭解 IAM,請參閱「身分與存取權管理說明文件」。
IAM 採用最小權限安全原則,可確保您僅授予使用者必要的資源存取權限。
設定 IAM 政策後,即可控管「哪些人」具備「何種」權限,可以存取「哪些」資源。IAM 政策可將特定角色授予使用者,讓該使用者擁有特定權限。例如,特定使用者可能需要建立和修改網域名稱系統 (DNS) 記錄資源。然後將 /roles/dns.admin 角色授予該使用者 (哪些人),其中該角色具有 dns.changes.create 和 dns.resourceRecordSets.create 權限 (何種權限),以便他們建立和更新資源記錄集 (哪些資源)。相較之下,支援部門可能只需要檢視現有的資源記錄集,因此可授予他們 /roles/dns.reader 角色。
Cloud DNS 支援專案層級和個別 DNS 區域層級的 IAM 權限。預設權限為專案層級。如要在個別 DNS 區域 (或資源) 層級設定權限,請參閱「建立具備特定 IAM 權限的可用區」。
權限與角色
每個 Cloud DNS API 方法都需要呼叫端具備必要的 IAM 權限。您可以將角色授予使用者、群組或服務帳戶,藉此指派權限。除了基本角色擁有者、編輯者和檢視者外,您還可以將 Cloud DNS API 角色授予專案使用者。
權限
下表列出呼叫端呼叫每個方法所需的權限。
| 方法 | 所需權限 |
|---|---|
dns.changes.create |
如要建立資源記錄,請在包含記錄集的專案中,同時設定 dns.changes.create 和 dns.resourceRecordSets.create。如要更新資源記錄,請在包含記錄集的專案中,同時設定 如要刪除資源記錄,請在包含記錄集的專案中,同時設定 |
dns.changes.get |
專案的 dns.changes.get 包含代管可用區。 |
dns.changes.list |
專案的 dns.changes.list 包含代管可用區。 |
dns.dnsKeys.get |
專案的 dns.dnsKeys.get 包含代管可用區。 |
dns.dnsKeys.list |
專案的 dns.dnsKeys.list 包含代管可用區。 |
dns.managedZoneOperations.get |
專案的 dns.managedZoneOperations.get 包含代管可用區。 |
dns.managedZoneOperations.list |
專案的 dns.managedZoneOperations.list 包含代管可用區。 |
dns.managedZones.create |
專案的 dns.managedZones.create 包含代管可用區。如要建立私人可用區,您還需要對每個專案具備 如果您要建立與 GKE 整合的私人可用區,也需要 |
dns.managedZones.delete |
專案的 dns.managedZones.delete 包含代管可用區。 |
dns.managedZones.get |
專案的 dns.managedZones.get 包含代管可用區。 |
dns.managedZones.list |
專案的 dns.managedZones.list 包含代管可用區。 |
dns.managedZones.update |
專案的 dns.managedZones.update 包含代管可用區。如要建立私人可用區,您還需要對每個專案具備 如果您要建立與 GKE 整合的私人可用區,也需要 |
dns.policies.create |
專案的 dns.policies.create 包含政策。如果是在虛擬私有雲網路上建立政策,您還需要對包含每個虛擬私有雲網路的每個專案具備 |
dns.policies.delete |
專案的 dns.policies.delete 包含政策。 |
dns.policies.get |
專案的 dns.policies.get 包含政策。 |
dns.policies.list |
專案的 dns.policies.list 包含政策。 |
dns.policies.update |
專案的 dns.policies.update 包含政策。如果政策更新為虛擬私有雲網路,您也需要對包含每個虛擬私有雲網路的每個專案具備 |
dns.projects.get |
專案的 dns.projects.get。 |
dns.resourceRecordSets.create |
專案的 dns.resourceRecordSets.create 包含記錄集。 |
dns.resourceRecordSets.delete |
專案的 dns.resourceRecordSets.delete 包含記錄集。 |
dns.resourceRecordSets.get |
專案的 dns.resourceRecordSets.get 包含記錄集。 |
dns.resourceRecordSets.list |
專案的 dns.resourceRecordSets.list 包含代管可用區。 |
dns.resourceRecordSets.update |
專案的 dns.resourceRecordSets.update 和 dns.changes.create 包含記錄集。 |
dns.responsePolicies.create |
專案的 dns.responsePolicies.create 包含回應政策。您也需要 如要建立附加至 GKE 叢集的回應政策,您需要 |
dns.responsePolicies.delete |
專案的 dns.responsePolicies.delete 包含回應政策。 |
dns.responsePolicies.get |
專案的 dns.responsePolicies.get 包含回應政策。 |
dns.responsePolicies.list |
專案的 dns.responsePolicies.list。 |
dns.responsePolicies.update |
專案的 dns.responsePolicies.update 包含回應政策。您也需要 如要建立附加至 GKE 叢集的回應政策,您需要 |
dns.responsePolicyRules.create |
專案的 dns.responsePolicyRules.create 包含回應政策規則。 |
dns.responsePolicyRules.delete |
專案的 dns.responsePolicyRules.delete 包含回應政策規則。 |
dns.responsePolicyRules.get |
專案的 dns.responsePolicyRules.get 包含回應政策規則。 |
dns.responsePolicyRules.list |
專案的 dns.responsePolicyRules.list 包含回應政策。 |
dns.responsePolicyRules.update |
專案的 dns.responsePolicyRules.update 包含回應政策規則。 |
networksecurity.dnsThreatDetectors.list (預先發布版) |
專案的 networksecurity.dnsThreatDetectors.list,用於監控虛擬私有雲網路中的威脅。 |
networksecurity.dnsThreatDetectors.get (預先發布版) |
專案的 networksecurity.dnsThreatDetectors.get,用於監控虛擬私有雲網路中的威脅。 |
networksecurity.dnsThreatDetectors.create (預先發布版) |
專案的 networksecurity.dnsThreatDetectors.create,包含要監控威脅的虛擬私有雲網路。 |
networksecurity.dnsThreatDetectors.update (預先發布版) |
專案的 networksecurity.dnsThreatDetectors.update,用於監控虛擬私有雲網路中的威脅。 |
networksecurity.dnsThreatDetectors.delete (預先發布版) |
專案的 networksecurity.dnsThreatDetectors.delete,用於監控虛擬私有雲網路中的威脅。 |
角色
下表列出 Cloud DNS API IAM 角色,以及各角色具備的所有權限對應清單。每個權限只適用於特定資源類型。
您也可以使用基本角色進行 DNS 變更。
| Role | Permissions |
|---|---|
DNS Administrator( Provides read-write access to all Cloud DNS resources. Lowest-level resources where you can grant this role:
|
|
DNS Peer( Access to target networks with DNS peering zones |
|
DNS Reader( Provides read-only access to all Cloud DNS resources. Lowest-level resources where you can grant this role:
|
|
Cloud DNS Service Agent( Gives Cloud DNS Service Agent access to Cloud Platform resources. |
|
| 角色 | 權限 |
|---|---|
DNS 威脅偵測工具管理員Beta 版( 可完整存取 DNS 威脅偵測工具資源。 |
|
DNS 威脅偵測工具檢視者Beta 版( 可查看 DNS 威脅偵測工具資源。 |
|
管理存取控管
您可以使用 Google Cloud 主控台管理主題和專案的存取控管。
如要在專案層級設定存取控管選項,請按照下列步驟操作。
控制台
前往 Google Cloud 控制台的「IAM」頁面。
從頂端的下拉式選單中選取專案。
按一下「Add」(新增)。
在「New principals」(新增主體) 中,輸入新主體的電子郵件地址。
從清單中選取角色。
按一下「Save」(儲存)。
確認列出的主體具備您所授予的角色。
後續步驟
- 如要開始使用 Cloud DNS,請參閱「快速入門導覽課程:使用 Cloud DNS 設定網域名稱的 DNS 記錄」。
- 如要瞭解使用 Cloud DNS 時可能遇到的常見問題解決方案,請參閱「疑難排解」。