Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vexctl attest #126

Merged
merged 4 commits into from
Oct 10, 2023
Merged

Update vexctl attest #126

merged 4 commits into from
Oct 10, 2023

Conversation

puerco
Copy link
Member

@puerco puerco commented Oct 8, 2023

This PR introduces a somewhat largeish update to the vexctl attest subcommand, mostly to update it to the latest versions of the OpenVEX specification. The changes in the PR are as follows:

Support non OCI image products in attestations

vexctl now supports generating attestations for VEX products which are not OCI images. For example, if an openvex doc defines an apk as its product and the product has hashes defined, we can now convert it into an in-toto subject. This feature makes use of the new hashes field in OpenVEX v0.2.0

Reuse the image digest as the subject hash

When specifying an oci purl, we now reuse the hash in the package url version instead of looking it up in the registry, this results in faster attestations.

Update the normalization code to detect images and other products

The internal normalization function reads the products from an OpenVEX file and now returns three sets of references: images, other products, and any unattestable products. This 3-way split is introduced to support attesting products that define hashes, a new feature in the OpenVEX spec v0.2.0.

Update the vexctl attest subcommand

The attest subcommand now shares the same pattern and reusable options as the rest of the subcommands in vexctl. We Are also adding two new flags: --refs specifies image references to attach the OpenVEX attestation. --file is the shared outfile flag that other vexctl subcommands use. It specifies a file which vexctl will write the attestation to.

/cc @cpanato @luhring

Signed-off-by: Adolfo Garcia Veytia (puerco) [email protected]

puerco added 4 commits October 9, 2023 19:01
This commit modifies the product aprser in the attestation code
to reuse the purl hash when ingesting OCI-typed purls. This saves
a round trip to the registry if we already have the data.

Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
Since the OpenVEX product now has fields for hashes, reuse the product
hashes in addition to derived hashes from purls when attesting them.

Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
This commit adds a new --refs flag to the attest subcommand. This lets
the user define an image reference to attach the attestation to. The help
text is also improved.

This commit also adds the --file reusable flag to allow attestations to be
written to a file.

Finally, this commit reshuffles the attest subcommand to use the pattern
of reusable flags in use in other subcommmands.

Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took some time but lgtm

thank you

@cpanato cpanato merged commit e50faaf into openvex:main Oct 10, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants