Skip to content

Create database table for SLSA attestations

This issue is focused on the creation of the database table that will be used to persist the SLSA attestation bundles so they can be published via the attestations API. See https://gitlab.com/gitlab-org/gitlab/-/issues/553213 for more details on the proposed workflow and design.

Following suggestions from the POC and discussions below, the current proposed table structure is:

  • project_id
  • status (success or error enum)
  • predicate_kind (enum of provenance, sbom, and potentially others)
  • predicate_type (the predicateType URI)
  • subject_digest (sha256 of the build artifact)
  • expire_at (timestamp marking when to clean up this attestation, by policy, last usage, etc.—see discussion issue)
  • bundle (jsonb column for the attestation bundle data, limited to 64k) bundles to be stored as file uploads—see #556027 (closed)
  • timestamps

The table should also be indexed by digest since it will be the main value used to query the table by the API.

Please update the issue description if there are changes to the schema based on the discussion in this issue.

Edited by Aaron Huntsman