cosign

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OIDCIssuer     = "https://token.actions.githubusercontent.com"
	BinarySANRegex = `^https://github\.com/bernd/vibepit/\.github/workflows/build\.yml@refs/tags/v.*`
	ImageSANRegex  = `^https://github\.com/bernd/vibepit/\.github/workflows/docker-publish\.yml@refs/heads/main$`

	ProxyImageOIDCIssuer = "https://accounts.google.com"
	ProxyImageSubject    = "keyless@distroless.iam.gserviceaccount.com"
)

Variables

View Source
var DefaultTrustedMaterial func() (root.TrustedMaterial, error) = func() (root.TrustedMaterial, error) {
	return root.FetchTrustedRoot()
}

DefaultTrustedMaterial fetches Sigstore's public-good trusted root via TUF. Exposed as a variable so tests can replace it with a mock.

Functions

func VerifyBlob

func VerifyBlob(artifactPath, bundlePath string) error

VerifyBlob verifies a cosign bundle for the artifact at artifactPath. The bundle must be a Sigstore bundle JSON file (as produced by cosign sign-blob --bundle).

func VerifyImage

func VerifyImage(ctx context.Context, imageRef string) error

VerifyImage verifies the cosign signature for a container image using the Sigstore public-good infrastructure. It checks that the image was signed by the expected GitHub Actions workflow and that the signature payload references the correct image digest.

The imageRef should be a digest reference (e.g., "ghcr.io/bernd/vibepit@sha256:...") to ensure the verified digest matches the locally cached image.

Verified digests are cached in ~/.cache/vibepit/verified-digests to avoid repeated network round-trips on subsequent runs.

func VerifyProxyImage

func VerifyProxyImage(ctx context.Context, imageRef string) error

VerifyProxyImage verifies the cosign signature for the distroless proxy image, signed by Google's keyless identity.

Types

This section is empty.

Jump to

Keyboard shortcuts

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