如果您在 VPC Service Controls 服务边界内启用合规性管理器,则必须配置出站和入站规则。
您可以调整以下示例入站和出站规则,以满足您的业务需求。
如需了解限制,请参阅支持的产品和限制。
准备工作
确保您拥有在组织级配置 VPC Service Controls 所需的角色。
为确保能够访问组织或文件夹中的资源,请在组织级层授予 Compliance Manager Admin (
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 存储桶位于边界内时运行审核:
- 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 服务代理的电子邮件地址。