新增 IAM 條件
Identity and Access Management (IAM) 條件可讓您針對 Google Cloud 資源 (包括 Application Integration 資源),定義和強制執行條件式、以屬性為基礎的存取權控管。如要進一步瞭解 IAM 條件,請參閱「IAM 條件總覽」。
在 Application Integration 中,您可以根據下列屬性強制執行條件式存取:
- 日期/時間屬性: 可用來為 Application Integration 資源設定暫時 (有效期)、排定或限時等各類存取。舉例來說,您可以允許使用者存取整合服務,但設下期限。詳情請參閱「設定臨時存取權」。
- 資源屬性: 根據資源名稱、資源類型或資源服務屬性設定條件式存取權。 舉例來說,您可以允許使用者管理在特定區域建立的整合。如需支援的值清單,詳情請參閱「設定以資源為準的存取權」。
新增 IAM 條件
如要為現有主體 (使用者、群組或服務帳戶) 新增 IAM 條件,請按照下列步驟操作:
- 前往 Google Cloud 控制台的「IAM」(身分與存取權管理) 頁面。
- 選取專案、資料夾或機構。
- 在主體清單中,找出要新增 IAM 條件的主體,然後按一下 (「編輯主體」)。
「編輯存取權」窗格隨即顯示。
- 找出要新增 IAM 條件的角色,然後按一下「+ 新增 IAM 條件」。
- 在「新增條件」窗格中,填入下列資訊:
- 名稱:輸入您要新增至角色的條件名稱。
- 說明: (選用) 輸入條件說明。
- 您可以使用「條件建構工具」或「條件編輯器」新增條件。
條件建構工具提供互動式介面,可供選取所需條件類型、運算子,以及運算式的其他適用詳細資料。條件編輯器提供文字介面,可使用 CEL 語法手動輸入條件運算式。
如需如何使用條件建構工具或條件編輯器的詳細操作說明,請參閱「設定以資源為準的存取權」。
- 按一下「儲存」即可套用條件。
如要瞭解 Application Integration 支援的資源屬性,請參閱「資源屬性值」
- 再次按一下「編輯存取權」窗格中的「儲存」,即可更新主體。
資源屬性值
下表列出應用程式整合的資源類型屬性可包含的值:
| 資源名稱 | 資源類型 | 參考資料 |
|---|---|---|
| Location | integrations.googleapis.com/Location
|
API 參考資料 |
| 整合 | integrations.googleapis.com/Integration
|
API 參考資料 |
| IntegrationVersion | integrations.googleapis.com/IntegrationVersion
|
API 參考資料 |
| 執行 | integrations.googleapis.com/Execution
|
API 參考資料 |
| 停權 | integrations.googleapis.com/Suspension
|
API 參考資料 |
| AuthConfig | integrations.googleapis.com/AuthConfig
|
API 參考資料 |
使用 IAM 條件進行 Application Integration 的範例
範例 1:限制存取區域中的任何 IntegrationVersion 資源
您可以在條件編輯器中使用下列條件運算式,限制對 IntegrationVersion 資源的存取權。限制存取權包括將 create、delete、download、get、list、patch、publish、unpublish 和 upload 作業限制在該區域的整合版本。
(resource.name.startsWith("projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME")) ||
resource.type == "integrations.googleapis.com/Location" ||resource.type == "cloudresourcemanager.googleapis.com/Project"取代下列項目:
PROJECT_ID: Google Cloud 專案的 ID。LOCATION:整合位置。請參閱「Application Integration 位置」。INTEGRATION_NAME:整合項目的名稱。
範例 2:允許存取區域中的任何 IntegrationVersion 資源
您可以在條件編輯器中使用下列條件運算式,允許存取 IntegrationVersion 資源:
resource.name.startsWith("projects/PROJECT_ID/locations/LOCATION/") ||
resource.type == "integrations.googleapis.com/Location" ||
resource.type == "cloudresourcemanager.googleapis.com/Project"取代下列項目:
PROJECT_ID: Google Cloud 專案的 ID。LOCATION:整合位置。如需支援的位置,請參閱「Application Integration 位置」。