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

Add spdxjson predicate type for attestations #1974

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

jdolitsky
Copy link
Contributor

Related to #1954

In attempt to dive deeper into the SBOM structure in attestations, added new predicate type "spdxjson" which allows us to apply Cue policies against inner fields in JSON-formatted SPDX documents. For example:

predicate: {
    Data: {
        spdxVersion: "SPDX-2.2"
    }
}

In the case of the "spdx" type, the Data field is just a string which prevents further progress on this.

It's still not 100% clear how Cue can be used to detect a specific package version within an SBOM, but this gets us one step further. Happy to follow up with "cyclone" predicate type too.

@codecov-commenter
Copy link

codecov-commenter commented Jun 7, 2022

Codecov Report

Merging #1974 (5f3486d) into main (2ef684f) will not change coverage.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main    #1974   +/-   ##
=======================================
  Coverage   34.66%   34.66%           
=======================================
  Files         152      152           
  Lines       10090    10090           
=======================================
  Hits         3498     3498           
  Misses       6222     6222           
  Partials      370      370           
Impacted Files Coverage Δ
cmd/cosign/cli/options/predicate.go 0.00% <0.00%> (ø)
pkg/policy/attestation.go 43.03% <0.00%> (ø)
...s/policy/v1alpha1/clusterimagepolicy_validation.go 94.97% <100.00%> (ø)
...is/policy/v1beta1/clusterimagepolicy_validation.go 94.97% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ef684f...5f3486d. Read the comment docs.

@developer-guy
Copy link
Member

Approve party! Great work @jdolitsky 👏

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.

5 participants