为 AWS 启用 VM Threat Detection

本页介绍了如何设置和使用虚拟机威胁检测,以在 Amazon Elastic Compute Cloud (EC2) 虚拟机的永久性磁盘中扫描恶意软件

如需为 AWS 启用 VM Threat Detection,您需要在 AWS 平台上创建 AWS IAM 角色,在 Security Command Center 中启用适用于 AWS 的 VM Threat Detection,然后在 AWS 上部署 CloudFormation 模板。

准备工作

如需启用 VM Threat Detection 以便与 AWS 搭配使用,您需要拥有特定的 IAM 权限,并且 Security Command Center 必须与 AWS 相关联。

角色与权限

如需完成适用于 AWS 的虚拟机威胁检测的设置,您需要获得在Google Cloud 和 AWS 中都具有必要权限的角色。

Google Cloud 角色

Make sure that you have the following role or roles on the organization: Security Center Admin Editor (roles/securitycenter.adminEditor)

Check for the roles

  1. In the Google Cloud console, go to the IAM page.

    Go to IAM
  2. Select the organization.
  3. 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.

  4. 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

  1. In the Google Cloud console, go to the IAM page.

    进入 IAM
  2. 选择组织。
  3. 点击 授予访问权限
  4. 新的主账号字段中,输入您的用户标识符。 这通常是 Google 账号的电子邮件地址。

  5. 选择角色列表中,选择一个角色。
  6. 如需授予其他角色,请点击 添加其他角色,然后添加其他各个角色。
  7. 点击 Save(保存)。
  8. AWS 角色

    在 AWS 中,AWS 管理员用户必须创建您需要的 AWS 账号,以便启用扫描。

    如需在 AWS 中为 VM Threat Detection 创建角色,请按照以下步骤操作:

    1. 使用 AWS 管理员用户账号,前往 AWS 管理控制台中的 IAM Roles 页面
    2. 服务或用例菜单中,选择 lambda
    3. 添加以下权限政策:
      • AmazonSSMManagedInstanceCore
      • AWSLambdaBasicExecutionRole
      • AWSLambdaVPCAccessExecutionRole
    4. 依次点击添加权限 > 创建内嵌政策,以创建新的权限政策:
      1. 打开以下页面并复制相应政策:适用于 AWS 漏洞评估和 VM Threat Detection 的角色政策
      2. JSON 编辑器中,粘贴相应政策。
      3. 为政策指定名称。
      4. 保存政策。
    5. 打开 Trust Relationships(信任关系)标签页。
    6. 粘贴以下 JSON 对象,将其添加到任何现有语句数组中:

      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Sid": "Statement1 or replace with a unique statementId",
            "Effect": "Allow",
            "Principal": {
              "Service": "cloudformation.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
          }
        ]
      }
      
    7. 保存角色。

    您稍后在 AWS 上安装 CloudFormation 模板时会分配此角色。

    确认 Security Command Center 已连接到 AWS

    虚拟机威胁检测功能需要访问您在创建 AWS 连接器时由 Cloud Asset Inventory 维护的 AWS 资源目录。

    如果尚未建立连接,则您在为 AWS 启用虚拟机威胁检测时必须设置连接。

    如需设置连接,请创建 AWS 连接器

    在 Security Command Center 中为 AWS 启用 VM Threat Detection

    必须在组织级 Google Cloud 启用适用于 AWS 的 VM Threat Detection。

    1. 在 Google Cloud 控制台中,前往 Virtual Machine Threat Detection Service Enablement 页面。

      前往“服务启用”页面

    2. 选择您的组织。

    3. 点击 Amazon Web Services(Amazon Web Services)标签页。

    4. 服务启用部分的状态字段中,选择启用

    5. AWS 连接器部分,验证状态是否显示为已添加 AWS 连接器

      如果状态显示为未添加 AWS 连接器,请点击添加 AWS 连接器。请先完成连接到 AWS 以进行配置和资源数据收集中的步骤,然后再执行下一步。

    6. 如果您已为 AWS 服务启用漏洞评估,并已在该功能中部署了 CloudFormation 模板,请跳过此步骤。点击下载 CloudFormation 模板。JSON 模板将下载到您的工作站。您需要在需要扫描的每个 AWS 账号中部署该模板。

    部署 AWS CloudFormation 模板

    请在创建 AWS 连接器至少 6 小时后执行以下步骤。

    如需详细了解如何部署 CloudFormation 模板,请参阅 AWS 文档中的通过 CloudFormation 控制台创建堆栈

    1. 前往 AWS Management Console 中的 AWS CloudFormation 模板页面。
    2. 依次点击 Stacks > With new resources (standard)
    3. 创建堆栈页面上,依次选择选择现有模板上传模板文件,以上传 CloudFormation 模板。
    4. 上传完成后,输入一个具有唯一性的堆栈名称。请勿修改模板中的任何其他参数。
    5. 选择指定堆栈详情。系统会打开配置堆栈选项页面。
    6. 权限下,选择您之前创建的 AWS 角色。
    7. 如果系统提示,请选中确认对应的复选框。
    8. 点击提交以部署模板。堆栈需要几分钟才能开始运行。

    部署状态会显示在 AWS 控制台中。如果 CloudFormation 模板部署失败,请参阅问题排查

    扫描开始运行后,如果检测到任何威胁,系统会生成相应的发现结果,并将其显示在 Google Cloud 控制台中的 Security Command Center 发现结果页面上。如需了解详情,请参阅在 Google Cloud 控制台中查看发现结果

    问题排查

    如果您已启用 VM Threat Detection 服务,但扫描未运行,请检查以下内容:

    • 检查 AWS 连接器是否已正确设置。
    • 确认 CloudFormation 模板堆栈已完全部署。其在 AWS 账号中的状态应为 CREATION_COMPLETE

    后续步骤