mcpField
A
attestation

attestation

github.com/jorgemuza安全045 次安装今天更新
代码仓库

关于 attestation

attestation 是 orbit 命令行技能,用于验证、下载和检查 Sigstore 构建来源证明包,适合核实制品来源、签名者身份及构建元数据。

主要功能

  1. 01根据证明包验证制品
  2. 02从 GitHub 下载证明包
  3. 03检查来源证明和签名者信息
  4. 04支持 JSON 与 YAML 输出
  5. 05支持 SHA-256 和 SHA-512 摘要

适用场景

  1. 01核验发布二进制文件的来源
  2. 02确认仓库及签名者身份
  3. 03查看证明包中的构建材料
  4. 04在 CI 脚本中使用结构化输出

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jorgemuza/orbit --skill attestation

安装后在 Claude Code 中输入/attestation确认已加载。

附带文件references/commands.md

详细介绍

使用 orbit CLI 进行证明验证

使用 Sigstore bundle、in-toto 证明格式和 SLSA 来源谓词验证、下载和检查构建来源证明。此功能有助于保障供应链安全,让你能够确认制品来源、签名者身份和构建元数据。

前提条件

  1. 已安装 orbit CLI — 如果 which orbit 执行失败,请使用以下方式安装:
    • macOS/Linux(Homebrew): brew install jorgemuza/tap/orbit
    • macOS/Linux(脚本): curl -sSfL https://raw.githubusercontent.com/jorgemuza/orbit/main/install.sh | sh
    • Windows(Scoop): scoop bucket add jorgemuza https://github.com/jorgemuza/scoop-bucket && scoop install orbit
  2. 要验证或检查的制品对应的 Sigstore 证明 bundle(.jsonl 或 .json)
  3. 对于 download:需要配置了 GitHub 服务的配置文件(证明 bundle 从 GitHub 获取)

快速参考

所有命令均遵循以下格式:orbit attestation <command> [arguments] [flags]

别名:orbit attest <command> [arguments] [flags]

所有命令均支持 -o json 和 -o yaml,用于生成结构化输出。完整的命令详情和所有标志请参阅 references/commands.md。

核心工作流

验证制品

验证制品是否与其证明 bundle 匹配,以确认构建来源、签名者身份和源代码仓库。

# Verify a local binary against a bundle
orbit attestation verify ./my-binary --bundle attestation.jsonl

# Verify with owner, repo, and signer identity checks.
# --owner and --repo must equal the owner and repository the provenance source
# URI names, compared case-insensitively; using either also requires the source
# to be hosted on --source-host (default github.com). --signer-identity must be
# an anchored prefix of the builder ID (matched from the start, ending on a '/',
# an '@', or end of string); its scheme://host/owner/repo head folds case, the
# workflow path and git ref after it do not. Nested namespaces work too:
# --owner mygroup/subgroup --repo myproject.
orbit attest verify ./artifact --bundle bundle.json --owner my-org --repo my-repo \
  --signer-identity "https://github.com/my-org/my-repo"

# Same, against a self-hosted forge instead of github.com
orbit attest verify ./artifact --bundle bundle.json --source-host git.example.com \
  --repo my-org/my-repo

# Verify a pre-computed digest
orbit attestation verify abc123def456... --bundle att.json --digest-algorithm sha256

# Output verification result as JSON
orbit attestation verify ./my-binary --bundle att.json -o json
下载证明 Bundle

从 GitHub 仓库获取制品摘要对应的证明 bundle。

# Download attestation bundle by digest
orbit attestation download sha256:abc123... --repo owner/repo

# With explicit digest algorithm
orbit attest download abc123... --repo owner/repo --digest-algorithm sha256
检查 Bundle

显示证明 bundle 的完整内容,包括 SLSA 来源证明、签名者身份、构建器、源和材料。

# Inspect a bundle file
orbit attestation inspect attestation.jsonl

# Output as JSON for processing
orbit attest inspect bundle.json -o json

常见用法

端到端验证发布二进制文件:

# Download the attestation bundle
orbit attestation download sha256:abc123... --repo my-org/my-repo

# Verify the binary against the downloaded bundle
orbit attestation verify ./my-binary --bundle attestation.jsonl --owner my-org

# Inspect the bundle for detailed provenance info
orbit attestation inspect attestation.jsonl

获取用于脚本处理的 JSON: 所有命令均支持 -o json,可输出机器可读的数据:

orbit attestation verify ./my-binary --bundle att.json -o json | jq '.signer'

查看制品的签名者:

orbit attestation inspect bundle.json -o json | jq '.signer'

严格验证签名者身份:

orbit attest verify ./artifact --bundle bundle.json \
  --owner my-org \
  --repo my-org/my-repo \
  --signer-identity "https://github.com/my-org/my-repo/.github/workflows/release.yml"

重要说明

  • Sigstore 格式 — 证明 bundle 遵循 Sigstore bundle 规范。验证采用 in-toto 证明格式和 SLSA 来源谓词。
  • 摘要算法 — 支持的算法为 sha256(默认)和 sha512。使用 --digest-algorithm 指定。
  • 下载所需的配置文件 — download 命令需要可访问 GitHub 的配置文件(-p <profile>),因为它会从 GitHub 仓库获取 bundle。必须提供 --repo 标志。
  • 仅限本地的命令 — verify 和 inspect 命令可处理本地文件,无需配置文件或网络访问(获取 bundle 时除外)。
  • 输出格式 — 所有命令均支持 -o json 和 -o yaml,可生成适用于脚本和 CI 流水线的结构化输出。

评论

支持 Markdown