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

feat: mock in-toto attestations query #45

Merged
merged 4 commits into from
Jan 31, 2024
Merged

Conversation

felipecruz91
Copy link
Contributor

@felipecruz91 felipecruz91 commented Jan 30, 2024

This PR mocks the in-toto attestations query in order to support local evaluation for the ssc-metadata-goal policy.

The MockGetInTotoAttestationsForLocalEval function does the following:

  1. Consume the attestations from the SBOM struct.
  2. Ignore those whose envelope's payload type is different from application/vnd.in-toto+json.
  3. Base64-decode the envelope's payload to obtain the statement.
  4. Ignore statement if not SPDX or provenance.
  5. If the predicate type is SPDX add it to Subjects.
  6. If the predicate type is provenance and the startLine property exists (i.e max mode) then add it to Subjects.

@felipecruz91 felipecruz91 marked this pull request as ready for review January 30, 2024 14:51
@felipecruz91 felipecruz91 merged commit 5851fe9 into main Jan 31, 2024
2 checks passed
@felipecruz91 felipecruz91 deleted the feature/mock-intoto-attest branch January 31, 2024 10:42
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