为 Audit Manager 配置 VPC Service Controls

Google Cloud 借助 VPC Service Controls,您可以设置服务边界以防范数据渗漏。使用 VPC Service Controls 配置 Audit Manager,以便 Audit Manager 可以访问其服务边界之外的资源和服务。

准备工作

  1. 确保您拥有在组织级配置 VPC Service Controls 所需的角色
  2. 请确保您拥有以下信息,具体取决于您是在审核管理器中注册资源还是运行审核。
    1. 注册资源以进行审核时:您在设置 Audit Manager 时指定的用户账号。 Google Cloud
    2. 运行审核时:为资源注册审核时自动创建的 Audit Manager 服务代理

限制

  • 无法通过服务边界保护文件夹级别或组织级别的 Audit Manager 资源。如需在文件夹或组织级别管理 Audit Manager 权限,我们建议使用 IAM。如需了解详情,请参阅管理对项目、文件夹和组织的访问权限

配置入站和出站规则

根据服务边界配置来配置入站和出站规则。如需了解详情,请参阅服务边界概览

在执行以下操作时,您可能需要配置入站和出站规则

  1. 注册资源以进行审核
  2. 运行审核

在注册资源以进行审核时配置入站和出站规则

您可以在审核管理器中将组织、文件夹或项目注册为审核资源

如果以下任何资源不在同一服务边界内,您必须配置入站或出站规则:

  • Audit Manager 服务代理
  • 配置为存储审核数据的目标 Cloud Storage 存储桶
  • 参与审核流程的服务

以下示例中使用的 Cloud Storage 方法是必需的。 您可以调整以下入站和出站规则示例,以满足您的业务需求。

针对您在设置 Audit Manager 时指定的 Google Cloud 用户账号完成以下任务。

  1. 配置以下入站规则:

    - ingressFrom:
        identities:
        - 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:您在设置 Audit Manager 时指定的电子邮件地址
  2. 配置以下出站规则:

    - egressFrom:
       identities:
        - 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:您在设置 Audit Manager 时指定的电子邮件地址

运行审核时配置入站和出站规则

您可以针对预定义或自定义的合规性框架运行审核

如果接受审核的文件夹或项目与已注册的 Cloud Storage 存储桶位于不同的服务边界内,请配置以下入站流量或出站流量规则。

以下示例中的 Cloud Storage 方法是必需的。您可以调整以下入站和出站规则示例,以满足您的业务需求。

在针对文件夹运行审核时配置入站规则

如果您针对某个文件夹运行审核,并且已注册的 Cloud Storage 存储桶或该文件夹中的某个项目位于边界内,请配置以下入站规则。

请为 Audit Manager 服务账号完成此任务。

- ingressFrom:
    identities:
    - serviceAccount: SA_EMAIL_ADDRESS
    - user: USER_EMAIL_ADDRESS
    sources:
        - accessLevel: "*"
  ingressTo:
    operations:
        - serviceName: "*"
    resources: "*"

替换以下内容:

  • SA_EMAIL_ADDRESS:Audit Manager 服务账号的电子邮件地址
  • USER_EMAIL_ADDRESS:您在设置 Audit Manager 时指定的电子邮件地址

在已注册的 Cloud Storage 存储桶位于服务边界内时配置入站流量规则

如果针对项目运行审核,并且已注册的 Cloud Storage 存储桶位于服务边界内,请配置以下入站规则。

请为 Audit Manager 服务账号完成此任务。

- ingressFrom:
    identities:
    - serviceAccount: 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: "*"

替换以下内容:

  • SA_EMAIL_ADDRESS:Audit Manager 服务账号的电子邮件地址
  • USER_EMAIL_ADDRESS:您在设置 Audit Manager 时指定的电子邮件地址

配置已注册的 Cloud Storage 存储桶位于服务边界外部时应遵循的出站规则

如果审核是针对服务边界内的项目运行的,并且已注册的 Cloud Storage 存储桶位于边界外部,请配置以下出站流量规则。

请为包含 Cloud Storage 存储桶的项目完成此任务。

- egressFrom:
   identities:
      - serviceAccount: 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: "*"

替换以下内容:

  • SA_EMAIL_ADDRESS:Audit Manager 服务账号的电子邮件地址
  • USER_EMAIL_ADDRESS:您在设置 Audit Manager 时指定的电子邮件地址

如果您遇到 VPC Service Controls 问题,请使用 VPC Service Controls 违规分析器来调试和分析问题。如需了解详情,请参阅在违规分析器中使用唯一 ID 诊断访问遭拒问题

后续步骤