Implementing sigstore for software signing

From mukul975/Anthropic-Cybersecurity-Skills · View interactive version

Implementing sigstore for software signing is an AI agent skill from the GitHub repository mukul975/Anthropic-Cybersecurity-Skills. 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 bind

How to use this skill

Skill file

Implementing Sigstore for Software Signing

When to Use

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

Workflow

Step 1: Install and Configure Cosign

Install Cosign and verify it can reach the Sigstore infrastructure:

Step 2: Keyless Signing with Cosign and Fulcio

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

```bash

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

```

Step 3: Verify Signed Artifacts

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

```bash

cosign verify $IMAGE --certificate-identity-regexp="https://github.com/myorg/myrepo/.*" \

--certificate-oidc-issuer=https://token.actions.githubusercontent.com

```

Step 4: Query the Rekor Transparency Log

Search and verify entries in the Rekor transparency log to audit signing events:

Step 5: Integrate into CI/CD Pipelines

Embed signing and verification into build and deployment pipelines:

Key Concepts

| Term | Definition |

|------|------------|

| Keyless Signing | Identity-based signing that uses short-lived certificates from Fulcio bound to OIDC identities instead of long-lived cryptographic keys, eliminating key management overhead |

| Fulcio | Sigstore's certificate authority that issues short-lived X.509 certificates after verifying OIDC tokens, binding an ephemeral public key to a verified identity |

| Rekor | Sigstore's immutable, append-only transparency log that records signing events with timestamps, enabling auditors to verify when and by whom an artifact was signed |

| Cosign | The primary CLI tool for signing and verifying container images and blobs using the Sigstore infrastructure (Fulcio + Rekor) |

| TUF Root of Trust | The Update Framework distribution mechanism for Sigstore's root CA certificate and Rekor public key, ensuring clients trust the correct Sigstore infrastructure |

| OIDC Identity Binding | The process where Fulcio verifies a user's identity through an OpenID Connect token and binds it to a short-lived signing certificate |

| Inclusion Proof | A cryptographic proof from Rekor demonstrating that a signing event entry exists within the transparency log's Merkle tree |

Tools & Systems

Common Scenarios

Scenario: Securing a Container Image Build Pipeline with Keyless Signing

Context: A DevOps team builds container images in GitHub Actions and deploys to a Kubernetes cluster. They need to ensure only images built by their CI pipeline can be deployed, preventing supply chain attacks from compromised registries or unauthorized pushes.

Approach:

  1. Add sigstore/cosign-installer@v3 to the GitHub Actions workflow and enable OIDC token permissions with id-token: write
  2. After building and pushing the image, sign it with cosign sign $IMAGE_DIGEST using the GitHub Actions OIDC identity automatically
  3. Deploy Sigstore Policy Controller to the Kubernetes cluster with a ClusterImagePolicy requiring signatures from --certificate-identity-regexp=https://github.com/myorg/myrepo/.* and --certificate-oidc-issuer=https://token.actions.githubusercontent.com
  4. Verify the signing entry appears in Rekor by querying with the image digest hash to confirm the transparency log recorded the event
  5. Test the admission controller by attempting to deploy an unsigned image and confirming it is rejected with a policy violation error

Pitfalls:

Output Format

## Sigstore Signing Verification Report

**Artifact**: ghcr.io/myorg/myapp@sha256:a1b2c3d4...
**Verification Status**: PASSED

**Certificate Details**:
  Subject: https://github.com/myorg/myapp/.github/workflows/build.yml@refs/heads/main
  Issuer: https://token.actions.githubusercontent.com
  Valid From: 2026-03-19T10:00:00Z
  Valid To: 2026-03-19T10:10:00Z

**Rekor Entry**:
  UUID: 24296fb24b8ad77a8d52...
  Log Index: 89234567
  Integrated Time: 2026-03-19T10:00:05Z
  Inclusion Proof: VERIFIED (tree size: 92000000, root hash: e4f5a6...)

**Policy Check**: Image signed by authorized CI workflow identity
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.