google / oss-rebuild

Securing open-source package ecosystems by originating, validating, and augmenting build attestations.
Apache License 2.0
23 stars 3 forks source link

Split metadata bucket. #58

Closed wbxyz closed 1 month ago

wbxyz commented 2 months ago

Previously the metadata bucket was used for both the rebuilt artifacts and also the build info/docker file.

This gave cloud build unnecessary access to both the build info and the dockerfile which are both written and read by the orchestrator.

After this PR, cloud build only has Create access to the newly created rebuild-artifacts bucket. That bucket only stores:

  1. The rebuilt artifact.
  2. The docker image used for the build.

Further, cloud build no longer has access to the metadata bucket, which contains the build info and docker file. Because it's only used locally to the orchestrator, I considered switching it to a filesystem or in-memory asset store, except we want these assets available for debugging so I'm keeping it as a bucket for now.

One interesting affect of this PR, is that verifier.SummarizeArtifacts only requires rebuildStore and verifier.CreateAttestations only requires the metadata store, clearly distinguishing where each of those steps get their input.

This further reduces the already tightly restricted permissions afforded the the cloud build role.