如果您在 VPC Service Controls 服務範圍內啟用 Compliance Manager,請務必設定輸出和輸入規則。
您可以視業務需求調整下列輸入和輸出規則範例。
如要瞭解限制,請參閱「支援的產品和限制」。
事前準備
請確認您在組織層級具備設定 VPC Service Controls 的必要角色。
如要確保能存取機構或資料夾中的資源,請在機構層級授予「法規遵循管理員」角色 (
roles/cloudsecuritycompliance.admin)。請務必瞭解下列事項:
Cloud Security Compliance 服務代理人的電子郵件地址 (
service-org-ORGANIZATION_ID@gcp-sa-csc-hpsa.iam.gserviceaccount.com)。法規遵循管理員使用者的電子郵件地址。 法規遵循管理員使用者負責管理法規遵循管理員,並執行稽核等活動。
確認 Cloud Security Compliance 服務代理在安全防護範圍內具備必要權限,可完成稽核。詳情請參閱「使用合規性管理員稽核環境」。
新增輸入和輸出規則
新增下列輸入規則:
- ingressFrom: identities: - user: USER_EMAIL_ADDRESS sources: - accessLevel: "*" ingressTo: operations: - serviceName: securitycenter.googleapis.com methodSelectors: - method: "*" resources: "*"將 USER_EMAIL_ADDRESS 替換為法規遵循管理員使用者的電子郵件地址。
新增下列連入規則,允許 Compliance Manager 監控及稽核 Google Cloud 機構中的資源:
- ingressFrom: identities: - user: USER_EMAIL_ADDRESS sources: - accessLevel: "*" ingressTo: operations: - serviceName: cloudsecuritycompliance.googleapis.com methodSelectors: - method: "*" resources: "*"將 USER_EMAIL_ADDRESS 替換為法規遵循管理員使用者的電子郵件地址。
設定下列輸入規則,為專案執行稽核:
- ingressFrom: identities: - serviceAccount: COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS - user: USER_EMAIL_ADDRESS sources: - accessLevel: "*" ingressTo: operations: - serviceName: cloudasset.googleapis.com methodSelectors: - method: "*" resources: "*"更改下列內容:
USER_EMAIL_ADDRESS:法規遵循管理員使用者的電子郵件地址。
COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS:Cloud Security Compliance 服務代理的電子郵件地址。
設定下列輸入規則,為資料夾執行稽核:
- ingressFrom: identities: - serviceAccount: COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS - user: USER_EMAIL_ADDRESS sources: - accessLevel: "*" ingressTo: operations: - serviceName: "*" resources: "*"更改下列內容:
USER_EMAIL_ADDRESS:法規遵循管理員使用者的電子郵件地址。
COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS:Cloud Security Compliance 服務代理的電子郵件地址。
如要稽核資料夾內專案的所有資源,您必須具備廣泛存取權。
設定下列輸入規則,在已註冊的 Cloud Storage bucket 位於 perimeter 內時執行稽核:
- ingressFrom: identities: - serviceAccount: COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS - user: USER_EMAIL_ADDRESS sources: - accessLevel: "*" ingressTo: operations: - serviceName: storage.googleapis.com methodSelectors: - method: google.storage.buckets.getIamPolicy - method: google.storage.buckets.testIamPermissions - method: google.storage.objects.getIamPolicy - method: google.storage.buckets.setIamPolicy - method: google.storage.objects.setIamPolicy - method: google.storage.objects.create - method: google.storage.objects.get resources: "*"更改下列內容:
USER_EMAIL_ADDRESS:法規遵循管理員使用者的電子郵件地址。
COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS:Cloud Security Compliance 服務代理的電子郵件地址。
設定下列輸出規則,在已註冊的 Cloud Storage bucket 位於 perimeter 內時執行稽核:
- egressFrom: identities: - serviceAccount: COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS - user: USER_EMAIL_ADDRESS sources: - accessLevel: "*" egressTo: operations: - serviceName: storage.googleapis.com methodSelectors: - method: google.storage.buckets.getIamPolicy - method: google.storage.buckets.testIamPermissions - method: google.storage.objects.getIamPolicy - method: google.storage.buckets.setIamPolicy - method: google.storage.objects.setIamPolicy - method: google.storage.objects.create - method: google.storage.objects.get resources: "*"更改下列內容:
USER_EMAIL_ADDRESS:法規遵循管理員使用者的電子郵件地址。
COMPLIANCE_MANAGER_SA_EMAIL_ADDRESS:Cloud Security Compliance 服務代理的電子郵件地址。