如果在 VPC Service Controls 服務範圍內啟用 Compliance Manager,您必須設定輸出和輸入規則。
您可以視業務需求調整下列範例的連入和連出規則。
如要瞭解限制,請參閱「支援的產品和限制」。
事前準備
如要確保能存取機構或資料夾中的資源,請在機構層級授予法規遵循管理員 (
roles/cloudsecuritycompliance.admin
) 角色。請務必瞭解下列事項:
Cloud Security Compliance 服務代理人的電子郵件地址 (
service-org-
ORGANIZATION_ID@gcp-sa-csc-hpsa.iam.gserviceaccount.com
)。法規遵循管理員使用者的電子郵件地址。 法規遵循管理員使用者負責管理法規遵循管理員,並執行稽核等活動。
確認 Cloud Security Compliance 服務代理在安全防護範圍內具備必要權限,可完成稽核。詳情請參閱「使用合規性管理員稽核環境」。
新增輸入和輸出規則
新增下列 Ingress 規則:
- 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 替換為法規遵循管理員使用者的電子郵件地址。
設定下列 Ingress 規則,為專案執行稽核:
- 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 服務代理的電子郵件地址。
設定下列 Ingress 規則,為資料夾執行稽核:
- 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 服務代理的電子郵件地址。
如要稽核資料夾內專案的所有資源,您必須具備廣泛存取權。
設定下列 Ingress 規則,在已註冊的 Cloud Storage 值區位於安全防護範圍內時執行稽核:
- 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 值區位於安全防護範圍內時執行稽核:
- 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 服務代理的電子郵件地址。