Skip to content

About

Sigstore implemented in Rust for Github v0.3 bundles

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

29 stars

Watchers

2 watching

Forks

sigstore-rust

A Rust implementation of Sigstore for signing and verifying software artifacts.

Overview

This workspace provides a modular Rust implementation of the Sigstore ecosystem, enabling keyless code signing and verification. Sigstore eliminates the need for long-lived signing keys by binding signatures to OpenID Connect identities and recording them in an immutable transparency log.

Crates

Crate Description
sigstore-sign High-level signing API
sigstore-verify High-level verification API
sigstore-trust-root Trusted root management
sigstore-bundle Sigstore bundle format handling
sigstore-oidc OpenID Connect authentication
sigstore-fulcio Fulcio certificate authority client
sigstore-rekor Rekor transparency log client
sigstore-tsa RFC 3161 timestamp authority client
sigstore-tuf The Update Framework (TUF) client
sigstore-merkle RFC 6962 Merkle tree verification
sigstore-crypto Cryptographic primitives
sigstore-types Core types and data structures

Installation

Add the crates you need to your Cargo.toml:

[dependencies]
# For verification only
sigstore-verify = "0.11"
sigstore-trust-root = "0.11"
sigstore-types = "0.11"

# For signing
sigstore-sign = "0.11"
sigstore-oidc = "0.11"

Usage

Verifying a Signature

use sigstore_verify::{Verifier, VerificationPolicy};
use sigstore_trust_root::TrustedRoot;

// Load the trusted root via TUF (recommended - ensures up-to-date trust material)
let root = TrustedRoot::production().await?;
let verifier = Verifier::new(&root)?;

// Parse the bundle (contains signature, certificate, transparency log entry)
let bundle: sigstore_types::Bundle = serde_json::from_str(&bundle_json)?;

// Authorize the expected signer, not just any valid Sigstore identity.
let policy = VerificationPolicy::new(
    "https://github.com/myorg/myrepo/.github/workflows/release.yml@refs/tags/v1.0.0",
    "https://token.actions.githubusercontent.com",
);
verifier.verify(artifact_bytes, &bundle, &policy)?;

Signing an Artifact

use sigstore_sign::SigningContext;

// Fetch the public-good signing config through TUF and authenticate with its
// OIDC provider. Use `.signer(token)` instead to supply a token yourself.
let signer = SigningContext::production().await?.authenticate().await?;

// Sign the artifact - returns a Sigstore bundle
let bundle = signer.sign(artifact_bytes).await?;

// Save the bundle
let bundle_json = serde_json::to_string_pretty(&bundle)?;

Examples

Sign and verify an artifact locally

# Sign the README.md file
cargo run -p sigstore-sign --features browser --example sign_blob -- README.md -o README.md.sigstore.json

# Verify with our tool
cargo run -p sigstore-verify --example verify_bundle -- --identity "$INSERT_YOUR_EMAIL" --issuer https://github.com/login/oauth README.md README.md.sigstore.json

# You can also verify with cosign
cosign verify-blob --bundle README.md.sigstore.json \
    --certificate-identity $INSERT_YOUR_EMAIL \
    --certificate-oidc-issuer https://github.com/login/oauth \
    README.md

Verify a Bundle from GitHub

You can verify Sigstore bundles from GitHub releases:

# 1. Download a release artifact and its Sigstore bundle
curl -LO https://github.com/sigstore/cosign/releases/download/v3.0.2/cosign_checksums.txt
curl -LO https://github.com/sigstore/cosign/releases/download/v3.0.2/cosign_checksums.txt.sigstore.json

# 2. Verify the bundle (cryptographic verification without identity policy)
cargo run -p sigstore-verify --example verify_bundle -- \
    --allow-any-identity cosign_checksums.txt cosign_checksums.txt.sigstore.json

# 3. Or verify with identity policy (this release was signed with Google's keyless signer)
cargo run -p sigstore-verify --example verify_bundle -- \
    --identity "keyless@projectsigstore.iam.gserviceaccount.com" \
    --issuer "https://accounts.google.com" \
    cosign_checksums.txt cosign_checksums.txt.sigstore.json

Architecture

┌───────────────────────────────────────────────────────────────────────┐
│                           Application Layer                           │
├───────────────────────┬───────────────────────┬───────────────────────┤
│     sigstore-sign     │    sigstore-verify    │  sigstore-trust-root  │
├───────────────────────┴───────────────┬───────┴───────────────────────┤
│            sigstore-bundle            │         sigstore-oidc         │
├─────────────────┬─────────────────┬───┴─────────────┬─────────────────┤
│ sigstore-fulcio │ sigstore-rekor  │  sigstore-tsa   │  sigstore-tuf   │
├─────────────────┴─────────────────┼─────────────────┴─────────────────┤
│          sigstore-crypto          │          sigstore-merkle          │
├───────────────────────────────────┴───────────────────────────────────┤
│                            sigstore-types                             │
└───────────────────────────────────────────────────────────────────────┘

How Sigstore Works

  1. Keyless Signing: Instead of managing long-lived keys, signers authenticate with an OIDC provider (GitHub, Google, etc.)
  2. Short-lived Certificates: Fulcio issues a certificate valid for ~10 minutes, binding the OIDC identity to an ephemeral key
  3. Transparency Log: The signature is recorded in Rekor, providing a tamper-evident audit trail
  4. Verification: Verifiers check the certificate chain, signature, and transparency log entry against the trusted root

Features

  • Full Sigstore bundle support (v0.1, v0.2, v0.3 formats)
  • Keyless signing with OIDC authentication
  • Certificate chain validation against Fulcio CA
  • Transparency log verification (checkpoints, inclusion proofs, SETs)
  • RFC 3161 timestamp support
  • Identity-based verification policies
  • Ambient credential detection for CI/CD environments

Cryptography and TLS Configuration

By default, sigstore-rust uses aws-lc-rs for cryptographic operations and rustls (with aws-lc-rs) for HTTPS transport. It supports:

  • ECDSA (P-256, P-384) signature verification and P-256 signing
  • Ed25519, RSA (PKCS#1 v1.5 and PSS), and ML-DSA (44, 65, 87) signature verification
  • SHA-256/SHA-384/SHA-512 hashing
  • X.509 certificate parsing and chain validation

AWS-LC has a FIPS 140-3 validated module. This workspace does not enable a FIPS build by default and does not claim FIPS validation for sigstore-rust. Compliance depends on the exact module build, configuration, platform, and approved operations.

Custom CryptoProvider (Avoiding aws-lc-sys)

Downstream applications or language bindings that already link another cryptographic library (such as BoringSSL, OpenSSL, or a custom FFI table) and cannot link aws-lc-sys into the same binary can disable default features (default-features = false), implement sigstore_crypto::CryptoProvider, and register their provider once at startup via sigstore_crypto::install_default_provider(&MY_PROVIDER).

See crates/sigstore-crypto/tests/boring_provider.rs for a complete reference implementation backed by boring (BoringSSL).

When using network clients (tuf, sigstore-sign, sigstore-rekor, etc.) without aws-lc-rs, replace the default rustls feature with either:

  • native-tls: Uses the OS TLS stack (OpenSSL on Linux, Secure Transport on macOS, SChannel on Windows). Note that native-tls on Linux links OpenSSL (openssl-sys), which conflicts at link time with boring-sys.
  • rustls-no-provider: Uses rustls for HTTPS without pulling in rustls's default aws-lc-rs crypto provider. Install your own rustls provider at startup via rustls::crypto::CryptoProvider::install_default(...).
[dependencies]
sigstore-crypto = { version = "0.14", default-features = false }
sigstore-verify = { version = "0.14", default-features = false, features = ["tuf", "rustls-no-provider"] }
sigstore-trust-root = { version = "0.14", default-features = false, features = ["tuf", "rustls-no-provider"] }

Note: In sigstore-oidc / sigstore-sign, the ambient-id dependency only supports rustls (aws-lc-rs) or native-tls, so automatic HTTPS ambient credential detection in CI requires one of those two TLS features (or passing an explicit OIDC token with rustls-no-provider).

Minimum Supported Rust Version

Rust 1.86 or later (checked in CI for the locked dependency set on Linux).

License

Apache-2.0; see LICENSE.

About

Sigstore implemented in Rust for Github v0.3 bundles

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

29 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages