Attestations
Overview
An attestation is a signed and verifiable unit of data sent to Chainloop. Users and CI systems use the Chainloop CLI to “craft” attestations, add pieces of evidence (materials) to them, and “push” them to Chainloop service (the evidence store).
Attestations are performed with the Chainloop command line interface (CLI) and its lifecycle has the following stages: init
, add
, push
or reset
.
As you can see, it mimics the workflow of a commonly used version control tool, and this is not by coincidence. Chainloop wants to make sure that the tooling feels familiar to developers and that no security jargon leaks into this stage of the process. For a developer, creating an attestation must be as simple as initializing it, adding pieces of evidence (materials) to it, and pushing it.
Attestation lifecycle
attestation init
A project version and optionally a version can be provided during initialization. You can read more here.
During this stage, the crafting tool will contact chainloop control plane to
- Signal the intent of starting an attestation.
- Retrieve or create the associated workflow contract
- If the contract has a specified runner context type, check that we are compliant with it.
- Initialize environment variables, explicitly stated in the contract and other contextual information.
attestation add
Add the materials required by the contract and any other additional (see contractless materials pieces of evidence, i.e artifact, OCI image ref, SBOM.
The add
command knows how to handle each kind of material transparently to the user.
For example
- ARTIFACT kinds will be uploaded to your artifact registry and referenced by their content digest.
- CONTAINER_IMAGE kinds will be resolved to obtain their repository digests using the local authentication keychain.
- SBOM_CYCLONEDX_JSON will validate the right SBOM format and upload it to the artifact registry.
For a complete list of available material types, see the reference section.
attestation push
This stage will take the current crafting state, validate that it has all the required materials and
- Create a signed, attestation envelope.
- Push it to the control plane for storage
You can leverage multiple signing mechanisms, including keyless signing and verification. For a complete list please refer to the signing guide.
attestation reset
By using the reset
command we can indicate to the control plane that something went wrong or we want to abort the attestation process.
attestation status
See the state of the current crafting process.
Attestation format
The generated attestations are in the form of a Sigstore bundle signed with the signing mechanism of your choice.
This bundle contains the attestation in the form of a DSSE envelope, and the verification materials required to verify the attestation. These include intermediate certificates, in the case of ephemeral certificates or timestamp services.
Example
You can retrieve the attestation in multiple formats by inspecting its associated workflow run
Your first attestation
To perform your first attestation locally, please refer to the getting started guide.
CI integration
Integrating the attestation process usually requires:
- Create an expose an API token or leverage native OIDC support (if applicable)
- Download the Chainloop CLI and perform the attestation lifecycle
Native CI/CD runner integrations (e.g., Jenkins plugin, GitHub action) are under development. In the meantime, please use the chainloop CLI as shown in these examples
For GitLab we support keyless attestations using GitLab’s OIDC tokens. Please refer to the GitLab Keyless Attestations guide for more information.
Advanced features
The basics of the attestation process is described in our getting started guide. This guide, instead will focus in some advance features guide
Contract-less, auto-discoverable materials
Security and Compliance teams can define requirements on what must be included in the attestation through contracts.
Alternatively, and in addition to the materials defined on the contract, you can add as many contract-less materials as you like by providing its value.
The CLI will automatically discover the kind of material you are adding, but you can also specify it by providing the --kind
flag.
For example
Contract-less and auto-discovery and two features that walk hand by hand. They compose a new way of adding pieces of evidences to an existing contract in a frictionless way. You can see it in action in our quickstart guide.
Remote State
By default, the attestation process state is stored locally. But this setup is not suitable when running a multi-step attestation process in a stateless environment, like our Dagger module, or when you want to leverage CI multi-job parallelism or similar.
For that, we implemented attestation remote state. Simply put, instead of the attestation CLI being in charge of maintaining the state during the attestation, this can be delegated to the server and retrieved at any time by providing an “attestation-id.”
With this optional feature, as long as you have the attestation-id, you can add any piece of evidence to the attestation from anywhere.