本文說明如何新增輸入規則,允許 Event Threat Detection 監控 VPC Service Controls perimeter 內 Security Command Center 中的記錄串流。如果貴機構使用 VPC Service Controls 限制專案中的服務,且您希望事件威脅偵測功能監控這些專案,請執行這項工作。如要進一步瞭解 Event Threat Detection,請參閱「Event Threat Detection 總覽」。
事前準備
Make sure that you have the following role or roles on the organization:
Cloud Asset Service Agent
(roles/cloudasset.serviceAgent).
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the organization.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
前往 IAM - 選取所需組織。
- 按一下「Grant access」(授予存取權)。
-
在「New principals」(新增主體) 欄位中,輸入您的使用者 ID。 這通常是指 Google 帳戶的電子郵件地址。
- 按一下「選取角色」,然後搜尋角色。
- 如要授予其他角色,請按一下「Add another role」(新增其他角色),然後新增其他角色。
- 按一下「Save」(儲存)。
-
前往 Google Cloud 控制台的「VPC Service Controls」頁面。
- 選取您的機構或專案。
-
在下拉式清單中,選取包含要授予存取權的服務範圍的存取政策。
清單中會顯示與存取權政策相關聯的 service perimeter。
-
按一下要更新的服務安全防護範圍名稱。
如要找出需要修改的服務邊界,請檢查記錄檔中是否有顯示
RESOURCES_NOT_IN_SAME_SERVICE_PERIMETER違規事項的項目。在這些項目中,檢查servicePerimeterName欄位:accessPolicies/ACCESS_POLICY_ID/servicePerimeters/SERVICE_PERIMETER_NAME
- 按一下「Edit」(編輯)。
- 按一下「輸入政策」。
- 按一下「Add an ingress rule」(新增輸入規則)。
-
在「From」部分,設定下列詳細資料:
- 在「身分」>「身分」部分,選取「選取身分和群組」。
- 按一下「Add identities」(新增身分)。
-
輸入 安全中心服務專員的電子郵件地址。 服務代理人的地址格式如下:
service-org-ORGANIZATION_ID@security-center-api.iam.gserviceaccount.com
請將
ORGANIZATION_ID替換成組織 ID。 - 選取服務代理人或按 ENTER 鍵,然後按一下「新增身分」。
- 在「來源」部分,選取「所有來源」。
-
在「收件者」部分,設定下列詳細資料:
- 依序選取「資源」>「專案」>「所有專案」。
- 在「作業或 IAM 角色」中,選取「選取作業」。
-
按一下「新增作業」,然後新增下列作業:
- 新增 cloudasset.googleapis.com 服務。
- 按一下「所有方法」。
- 按一下「新增所有方法」。
- 新增 cloudasset.googleapis.com 服務。
- 按一下 [儲存]。
-
如果尚未設定配額專案,請設定配額專案。選擇已啟用 Access Context Manager API 的專案。
gcloud config set billing/quota_project QUOTA_PROJECT_ID
將
QUOTA_PROJECT_ID替換為您要用於帳單和配額的專案 ID。 -
建立名為
ingress-rule.yaml的檔案,並在當中加入下列內容:- ingressFrom: identities: - serviceAccount:service-org-ORGANIZATION_ID@security-center-api.iam.gserviceaccount.com sources: - accessLevel: '*' ingressTo: operations: - serviceName: cloudasset.googleapis.com methodSelectors: - method: '*' resources: - '*'
請將
ORGANIZATION_ID替換成組織 ID。 -
將輸入規則新增至範圍:
gcloud access-context-manager perimeters update PERIMETER_NAME \ --set-ingress-policies=ingress-rule.yaml
更改下列內容:
-
PERIMETER_NAME:perimeter 的名稱。例如:accessPolicies/1234567890/servicePerimeters/example_perimeter。如要找出需要修改的服務邊界,請檢查記錄檔中顯示
RESOURCES_NOT_IN_SAME_SERVICE_PERIMETER違規事項的項目。在這些項目中,檢查servicePerimeterName欄位:accessPolicies/ACCESS_POLICY_ID/servicePerimeters/SERVICE_PERIMETER_NAME
-
- 瞭解如何使用 Event Threat Detection。
建立輸入規則
如要允許 Event Threat Detection 監控 VPC Service Controls perimeter 內的 Security Command Center 記錄串流,請在這些 perimeter 中新增必要的輸入規則。針對要讓 Event Threat Detection 監控的每個安全防護範圍,執行下列步驟。
詳情請參閱 VPC Service Controls 說明文件的「更新 service perimeter 的輸入和輸出政策」。
控制台
gcloud
詳情請參閱「輸入和輸出規則」。