跳到正文
Skillpedia
安全35k · #8123

implementing-sigstore-for-software-signing

它能做什么

这个工具可以帮助你确认所用软件是正版的,并且没有被篡改。它会利用你的在线身份(比如 Google 或 GitHub 账号)为软件创建数字签名,你无需管理复杂的密码。

适用场景

  • ✓发布新的软件版本时。
  • ✓验证下载的软件是否为原版时。
  • ✓在自动化的软件构建和测试系统中。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-sigstore-for-software-signing/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-sigstore-for-software-signing/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“用我的 GitHub 账号为这个容器镜像签名。”

每周 5 个新技能,1 分钟读完。

工作原理

它使用一个名为 Cosign 的工具来创建数字签名。这个签名会与你的在线身份(OIDC)绑定,并记录在公开日志(Rekor)中,任何人都可以进行验证。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Implementing Sigstore for Software Signing

When to Use

  • Signing container images and software artifacts without managing long-lived cryptographic keys
  • Establishing verifiable provenance for build outputs in CI/CD pipelines using OIDC identity binding
  • Querying the Rekor transparency log to audit when and by whom an artifact was signed
  • Verifying that container images pulled from registries were signed by authorized identities and issuers
  • Integrating Sigstore verification into Kubernetes admission controllers to enforce signed-image policies

Do not use for signing artifacts that require air-gapped or offline signing workflows where OIDC authentication is unavailable, for environments that cannot reach the public Sigstore infrastructure (Fulcio, Rekor) and have no private instance deployed, or as a replacement for traditional PGP/GPG signing where regulatory compliance mandates specific key management procedures.

Prerequisites

  • Cosign CLI v2.4+ installed (go install github.com/sigstore/cosign/v2/cmd/cosign@latest or binary release)
  • Access to an OIDC identity provider supported by Fulcio (Google, GitHub, Microsoft, or a custom OIDC issuer)
  • Container registry credentials (for signing container images) with push access to store signature objects
  • Python 3.9+ with sigstore, requests, and cryptography packages for the automation agent
  • Network access to fulcio.sigstore.dev, rekor.sigstore.dev, and tuf-repo-cdn.sigstore.dev (or private Sigstore instance URLs)

Workflow

Step 1: Install and Configure Cosign

Install Cosign and verify it can reach the Sigstore infrastructure:

  • Install from binary release: Download the appropriate binary from the Cosign GitHub releases page and verify its checksum. On Linux: curl -LO https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64 && chmod +x cosign-linux-amd64 && sudo mv cosign-linux-amd64 /usr/local/bin/cosign
  • Verify installation: Run cosign version to confirm the version and check connectivity to Sigstore services with cosign initialize which fetches the TUF root of trust
  • Configure custom infrastructure (optional): If running a private Sigstore stack, set --fulcio-url, --rekor-url, and --oidc-issuer flags or use environment variables COSIGN_REKOR_URL and COSIGN_FULCIO_URL

Step 2: Keyless Signing with Cosign and Fulcio

Perform identity-based signing where Fulcio issues a short-lived certificate bound to your OIDC identity:

  • Sign a container image: Run cosign sign <IMAGE_DIGEST> which triggers an OIDC authentication flow. Cosign generates an ephemeral key pair, obtains a short-lived certificate from Fulcio binding the public key to the OIDC identity, signs the image digest, and records the signing event in Rekor. The private key is destroyed immediately after signing.
  • Sign a blob (file): Run cosign sign-blob <file> --bundle artifact.sigstore.json to sign arbitrary files. The bundle contains the signature, certificate, timestamp, and Rekor inclusion proof.
  • Non-interactive signing in CI: Set SIGSTORE_ID_TOKEN environment variable with a valid OIDC token (e.g., from GitHub Actions OIDC or GCP workload identity) to skip the browser-based authentication flow:
    export SIGSTORE_ID_TOKEN=$(curl -sH "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
      "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sigstore" | jq -r '.value')
    cosign sign $IMAGE_DIGEST
    
  • Supported OIDC providers: Google (https://accounts.google.com), GitHub (https://github.com/login/oauth), Microsoft (https://login.microsoftonline.com), GitLab (https://gitlab.com), and custom providers registered with a private Fulcio instance

Step 3: Verify Signed Artifacts

Verify that artifacts were signed by expected identities from expected OIDC issuers:

  • Verify a container image: Run cosign verify <IMAGE_URI> --certificate-identity=name@example.com --certificate-oidc-issuer=https://accounts.google.com to confirm the image was signed by the specified identity. Cosign validates the certificate chain, checks the Rekor inclusion proof, and verifies the signature matches the current image digest.
  • Verify a signed blob: Run cosign verify-blob <file> --bundle artifact.sigstore.json --certificate-identity=name@example.com --certificate-oidc-issuer=https://accounts.google.com

…

常见问题

我需要创建密码或密钥吗?

不需要。它使用你的在线身份(如 Google 或 GitHub)进行签名,这种方式被称为“无密钥”(keyless)签名。

什么是“密码学溯源”(cryptographic provenance)?

这是一种证明某个软件由谁创建或签名,并确保它自创建或签名以来没有被修改过的方法。

如果没有网络连接怎么办?

这种方法需要联网,以连接 Sigstore 的服务(Fulcio、Rekor)。因此它无法用于完全离线的环境。

详情

作者的原始描述

Implements Sigstore-based software signing and verification using Cosign keyless signing, Rekor transparency log verification, and Fulcio certificate authority integration to establish cryptographic provenance for container images, binaries, and software artifacts, including OIDC-based identity binding and CI/CD pipeline integration. Use when setting up keyless container/artifact signing, verifyin

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#8123
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能