Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I think first we need to implement Cosign attestations so Flux users can set polices based on Issuer and Subject. Right now our keyless verification only checks for a valid log, but this doesn't protect against some bad actor signing artifacts via GH Actions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With Flux
HelmChart
andOCIRepository
CRD it is possible to define OCI artifacts as sources for the different Flux controllers. Recently we also added the possibility for users to verify the declared artifacts signatures at reconciliation time usingcosign
.One next phase would be to be able to declare that a software bill of material exist for a given artifact, and expect Flux to find it and verify it.
In the following sections, we expose two possibilities to solve the use case. The intent here is not to provide a final solution, but to open the discussion and gather feedback.
1. Verify SBOM by using the referrer api
The oci-distribution-spec provides a new
referrers api
that we could use for that purpose. We could generate an sbom for an oci image namedmanifest:1.0.0
withsyft
like:And then use
oras
to push the generated sbom as an OCI artifact and add a reference to thesubject
artifact.That would create an artifact with the following manifest:
Using the
referrer api
we could retrieve the sbom artifact with our source image digest like:The result is an
image index
containing all the references(referenced with thesubject
field) to our source imagemanifest:1.0.0
. What would be left to do for Flux is:Verifying the attestation means that Flux has to implement the logic or depend on another library for that.
Furthermore the referrer api is quite new and most registries do not support it yet. DockerHub is currently implementing it it seems and
ACR
andECR
seem also to be working on it.Verify SBOM by using Cosign
Cosign
provides capabilities to push, sign and verifysbom
.Using
syft
andcosign
, it is possible to push and sbom in an OCI registry, colocated with the target artifact.We generate a key pair with cosign and use
--key
withsyft
to sign the generated sbom.manifest_1_0_0_sbom_attestation.json
attestation type ispayloadType":"application/vnd.in-toto+json
.Cosign
can only verify attestation in the in-toto format at the moment.We then push the signed sbom
Cosign
does this the same way it attaches a signature. It creates a manifest in the same repository which is tagged with<name>:<digest.att>
,digest
being our artifact's digest.Verify the sbom as follow
Note
cosign verify-attestation
accepts a list of policies inrego
orcue
language that can run against the sbom for validation.Flux integrates
cosign
for OCI artifact signature verification. It could extend that integration to sbom verification. That is quite appealing as that is a use case that cosign exist to address.cc @fluxcd/core-maintainers
Beta Was this translation helpful? Give feedback.
All reactions