创建 VEX 语句

本文档介绍了如何创建漏洞可利用性交流 (VEX) 声明。

对于推送到 Artifact Registry 的每个容器映像,Artifact Analysis 都可以存储关联的 VEX 声明。VEX 是一种安全公告,用于指示产品是否受到已知漏洞的影响。

每份对账单都提供以下信息:

  • VEX 声明的发布者
  • 声明所针对的制品
  • 任何已知漏洞的漏洞评估(VEX 状态)

软件发布商可以创建 VEX 声明来描述应用的安全状况。VEX 声明会记录在特定制品中发现的所有漏洞,并提供有关这些漏洞对客户或监管机构的影响的背景信息。

安全和政策执行者可以使用 VEX 状态来评估软件供应链中的风险,并使用 VEX 声明来证明其制品组成,从而帮助组织满足监管要求。

VEX 状态

VEX 状态指示制品是否受到已知漏洞的影响。

状态可以是以下值之一:

  • 不受影响:无需对此漏洞采取修复措施。
  • 受影响:建议采取修复措施。
  • 已修复:在此版本的产品中,已采取修复措施来解决此漏洞。
  • 正在调查:此产品的状态尚未确定。 发布方将在后续版本中提供更新后的状态。

准备工作

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Container Analysis, Artifact Registry APIs.

    Enable the APIs

  5. Install the Google Cloud CLI.

  6. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  7. To initialize the gcloud CLI, run the following command:

    gcloud init
  8. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  9. Make sure that billing is enabled for your Google Cloud project.

  10. Enable the Container Analysis, Artifact Registry APIs.

    Enable the APIs

  11. Install the Google Cloud CLI.

  12. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  13. To initialize the gcloud CLI, run the following command:

    gcloud init
  14. 在 Artifact Registry 代码库中存储容器映像,或创建代码库推送映像
  15. 所需的角色

    如需获得上传 VEX 评估和检查漏洞的 VEX 状态所需的权限,请让您的管理员向您授予项目的以下 IAM 角色:

    如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限

    您也可以通过自定义角色或其他预定义角色来获取所需的权限。

    创建 VEX 声明

    Artifact Analysis 支持 JSON 格式的通用安全公告格式 (CSAF) 2.0 标准。如需生成新的 VEX 声明,请使用 CSAF 架构

    以下示例展示了 Artifact Registry 中某个映像的 VEX 声明,其中包含一个针对已知漏洞的 cve 分支。

    您必须为每个 CVE 定义 product_status 的值。

    
    {
      "document": {
        "csaf_version": "2.0",
        "lang": "en-US",
        "publisher": {
          "name": "Sample-Company",
          "namespace": "https://sample-company.com"
        },
        "title": "Vex document 1.1"
      },
      "product_tree": {
        "branches": [
          {
            "name": "https://LOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/IMAGE_NAME",
            "product": {
              "name": "PRODUCT_NAME",
              "product_id": "IMAGE_NAME"
            }
          }
        ]
      },
      "vulnerabilities": [
        {
          "cve": "CVE_ID",
          "product_status": {
            "PRODUCT_STATUS": [
              "IMAGE_NAME"
            ]
          }
        }
      ]
    }
    

    地点

    • PRODUCT_NAME 图片中商品的简单易懂的名称。 接受字符串值。该值应为商品的完整规范名称,包括版本号和其他属性。
    • LOCATION 是代码库的单区域或多区域位置。
    • PROJECT_ID 是包含您的代码库的项目的 ID。
    • REPO_NAME 是您在 Artifact Registry 中的 Docker 代码库的名称。
    • IMAGE_NAME 是映像的名称。
    • CVE_ID 是漏洞的标识符,例如 CVE-2017-11164
    • PRODUCT_STATUS 是安全风险评估。 Artifact Analysis 支持四种状态类型:known_affectedknown_not_affectedunder_investigationfixed

    对于要在 VEX 声明中列出的每个漏洞,您都必须创建一个 cve 分支并定义 product_status 的值。

    product_tree.branches.namename 字段的值是图片 URI。包含此值会将 VEX 声明与特定的 Docker 映像相关联。

    后续步骤

    • 上传 VEX 声明:您现有的 VEX 声明或其他出版商提供的 VEX 声明。
    • 使用 VEX 确定漏洞问题的优先级。了解如何查看 VEX 声明以及按 VEX 状态过滤漏洞。