blobsig

package
v0.47.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package blobsig verifies a sigstore (cosign keyless) signature of a downloaded file, offline: the certificate chains to the Sigstore public good Fulcio roots, the signature is in the Rekor transparency log (the inclusion proof and signed timestamp travel in the bundle), and the certificate names exactly the signer the caller expects (OIDC issuer and subject, for a GitHub workflow its file and ref).

Sensors use it before they install content that runs on tenant code (the sast-rules bundle, for example): a mirror, a proxy or a compromised download host cannot substitute files, because only the expected release workflow can produce a valid bundle.

The trust root (trusted_root.json, the Sigstore public good instance's Fulcio CAs, Rekor and CT log keys) is embedded and refreshed with SDK releases, so verification needs no network.

Stability: Beta (docs/STABILITY.md).

Index

Constants

View Source
const GitHubActionsIssuer = "https://token.actions.githubusercontent.com"

GitHubActionsIssuer is the OIDC issuer of GitHub Actions workflow identities.

View Source
const MaxBundleBytes = 1 << 20

MaxBundleBytes bounds a bundle a caller reads before Verify.

Variables

This section is empty.

Functions

func Verify

func Verify(artifact io.Reader, bundleJSON []byte, want Signer) error

Verify checks bundleJSON, a sigstore bundle (cosign sign-blob --bundle), as the signature of the content read from artifact, made by want.

func VerifyDigest

func VerifyDigest(sha256Digest, bundleJSON []byte, want Signer) error

VerifyDigest is Verify for an artifact the caller already hashed (SHA-256).

Types

type Signer

type Signer struct {
	Issuer  string
	Subject string
}

Signer is the identity a signature must carry: the certificate's OIDC issuer and its subject (SAN), both compared exactly.

func GitHubWorkflow

func GitHubWorkflow(repo, workflowPath, ref string) Signer

GitHubWorkflow is the signer identity of a GitHub Actions workflow run: https://github.com/<repo>/<workflowPath>@<ref>, for example GitHubWorkflow("openctemio/sast-rules", ".github/workflows/release.yml", "refs/tags/v0.1.0").

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL