1. Resources
  2. /
  3. Plugins
  4. /
  5. generate-provenance-attestation-buildkite-plugin

Generate Provenance Attestation Buildkite Plugin

This Buildkite plugin generates a SLSA Provenance attestation for artifacts that were produced in a Buildkite build step.

It runs as a post-artifact hook that generates a provenance attestation for all the relevant artifacts that were built and uploaded by the step that it is attached to.

The plugin then uploads the attestation to artifact storage for downstream usage.

Attestation format

The core of the attestation is an in-toto Statement that attests to the build provenance of artifacts that were produced in a Buildkite build step. See examples/statement.json.

This statement is serialised and signed in an in-toto Envelope using the DSSE v1.0 format. See examples/envelope.json.

The envelope is the resultant attestation that is uploaded to the build’s artifact storage.

SLSA Build Levels

The in-toto Statement satisfies the Provenance Exists requirement needed for SLSA Build Level 1.

The in-toto Envelope is currently signed using a hard-coded private key for demonstration purposes. This lays the groundwork for the Statement to be signed with a user-specified private key in the future, which will satisfy the Provenance is Authentic requirement needed for SLSA Build Level 2.

Quick Start

steps:
  - label: "Build Gem"
    command: "gem build awesome-logger.gemspec"
    artifact_paths: "awesome-logger-*.gem"
    plugins:
      - generate-provenance-attestation#v1.1.0:
        artifacts: "awesome-logger-*.gem"
        attestation_name: "gem-provenance-attestation.json"

Options

artifacts (string, required)

A glob pattern to select for artifacts that will be included in the provenance attestation.

attestation_name (string, required)

Name to use when uploading the provenance attestation to artifact storage.

Usage

In the example below, the pipeline step builds a gem awesome-logger-.gem and uploads it to artifact storage.

Generate Provenance Attestation plugin generates a provenance attestation that incorporates the gem file (included by the artifacts glob), and uploads the attestation to artifact storage as gem-provenance-attestation.json (as specified by attestation_name).

gem-provenance-attestation.json can then be persisted in later steps or published to a package registry alongside the newly built gem.

steps:
  - label: "Build Gem"
    key: "build-gem"
    command: "gem build awesome-logger.gemspec"
    artifact_paths: "awesome-logger-*.gem"
    plugins:
      - generate-provenance-attestation#v1.1.0:
        artifacts: "awesome-logger-*.gem"
        attestation_name: "gem-provenance-attestation.json"

Development

The core of the plugin is a Python program main.py.

It accepts the following arguments:

ArgumentDescription
-g, —artifacts-globOnly include artifacts that match this glob.
-o, —outputWrite provenance attestation to a file instead of STDOUT

Example

python3 ./main.py \
  --artifacts-glob "*.gem" \
  --output "./gem-provenance-attestation.json"

Other common tasks

Running with fake environment variables

If FAKE_ENV environment variable is set to 1, the program will use a set of fake BUILDKITE_* environment variables and fake artifact files defined in attestation_generator/helpers.py.

FAKE_ENV=1 python3 ./main.py

Check type annotations with mypy

brew install mypy # once-off setup

mypy --strict **/*.py

Run unit tests

python3 -m unittest tests/*.py

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Security
  5. Brand assets
  6. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025