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
orerror
enum) -
predicate_kind
(enum ofprovenance
,sbom
, and potentially others) -
predicate_type
(thepredicateType
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) -
bundles to be stored as file uploads—see #556027 (closed)bundle
(jsonb column for the attestation bundle data, limited to 64k) - 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