docker scout quickview

描述(Description)镜像的快速概述(Quick overview of an image)
用法(Usage)docker scout quickview [IMAGE|DIRECTORY|ARCHIVE]
别名(Aliases)
docker scout qv

描述(Description)

docker scout quickview 命令显示镜像的快速概述。它显示指定镜像中漏洞以及基础镜像中漏洞的摘要。如果可用,它还会显示基础镜像刷新和更新建议。

如果没有指定镜像,则使用最近构建的镜像。

支持以下工件类型(The following artifact types are supported)

  • 镜像(Images)
  • OCI 布局目录(OCI layout directories)
  • 通过docker save创建的 Tarball 归档文件(Tarball archives, as created by docker save
  • 本地目录或文件(Local directory or file)

默认情况下,该工具期望一个镜像引用,例如:

  • redis
  • curlimages/curl:7.87.0
  • mcr.microsoft.com/dotnet/runtime:7.0

如果要分析的工件是 OCI 目录、Tarball 归档文件、本地文件或目录,或者如果要控制从哪里解析镜像,则必须使用以下前缀之一:

  • image:// (默认)使用本地镜像,或回退到注册表查找
  • local:// 使用本地镜像存储中的镜像(不进行注册表查找)
  • registry:// 使用注册表中的镜像(不使用本地镜像)
  • oci-dir:// 使用 OCI 布局目录
  • archive:// 使用通过docker save创建的 Tarball 归档文件
  • fs:// 使用本地目录或文件
  • sbom:// SPDX 文件或包含 SPDX 谓词的 in-toto 证明文件或syft json SBOM 文件。对于sbom://前缀,如果未定义文件,则它将尝试从标准输入读取。

选项(Options)

选项(Option)默认值(Default)描述(Description)
--env环境名称(Name of the environment)
--ignore-suppressed根据指定的异常范围过滤在 Scout 异常中发现的 CVE。
--latest最新索引的镜像(Latest indexed image)
--only-policy要评估的策略的逗号分隔列表(Comma separated list of policies to evaluate)
--only-vex-affected按 VEX 语句过滤 CVE,状态为不受影响(Filter CVEs by VEX statements with status not affected)
--orgDocker 组织的命名空间(Namespace of the Docker organization)
-o, --output将报告写入文件(Write the report to a file)
--platform要分析的镜像的平台(Platform of image to analyze)
--ref如果提供的 tarball 包含多个引用,则使用该引用。(Reference to use if the provided tarball contains multiple references.)
只能与 archive 一起使用(Can only be used with archive)
--vex-author要接受的 VEX 语句作者列表(List of VEX statement authors to accept)
--vex-location包含 VEX 语句的目录或文件的文件位置(File location of directory or file containing VEX statements)

示例

镜像的快速概述(Quick overview of an image)

$ docker scout quickview golang:1.19.4
    ...Pulling
    ✓ Pulled
    ✓ SBOM of image already cached, 278 packages indexed

  Your image  golang:1.19.4                          │    5C     3H     6M    63L
  Base image  buildpack-deps:bullseye-scm            │    5C     1H     3M    48L     6?
  Refreshed base image  buildpack-deps:bullseye-scm  │    0C     0H     0M    42L
                                                     │    -5     -1     -3     -6     -6
  Updated base image  buildpack-deps:sid-scm         │    0C     0H     1M    29L
                                                     │    -5     -1     -2    -19     -6

最近构建镜像的快速概述

$ docker scout qv

来自 SPDX 文件的快速概述

$  syft -o spdx-json alpine:3.16.1 | docker scout quickview sbom://
 ✔ Loaded image                                                                                                                              alpine:3.16.1
 ✔ Parsed image                                                                    sha256:3d81c46cd8756ddb6db9ec36fa06a6fb71c287fb265232ba516739dc67a5f07d
 ✔ Cataloged contents                                                                     274a317d88b54f9e67799244a1250cad3fe7080f45249fa9167d1f871218d35f
   ├── ✔ Packages                        [14 packages]
   ├── ✔ File digests                    [75 files]
   ├── ✔ File metadata                   [75 locations]
   └── ✔ Executables                     [16 executables]

  Target   │ <stdin>        │    1C     2H     8M     0L
    digest │  274a317d88b5  │