generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 29
fix: use artifact filenames as keys for verifying jfrog assets in provenance_witness_l1_check #796
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
Merged
tromai
merged 6 commits into
staging
from
tromai/fix-look-up-table-for-provenance-discovery
Jul 23, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2247f74
fix: use artifact filenames as keys for verifying jfrog assets in pro…
baf3691
chore: fix the description of test cases
c57936b
chore: add validation of Witness product attestor
415da09
chore: add an unit test case for mismatched sha256_digest of an asset
fe787b2
chore: update an integration test case
01d4672
chore: update expected reports
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 30 additions & 30 deletions
60
tests/integration/cases/behnazh-w_example-maven-app/vsa_payload.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
{ | ||
"_type": "https://in-toto.io/Statement/v1", | ||
"subject": [ | ||
{ | ||
"uri": "pkg:maven/io.github.behnazh-w.demo/example-maven-app@1.0-SNAPSHOT?type=jar", | ||
"digest": { | ||
"sha256": "19986144a60f3d16d1e8d96bc1807c42bb7c91068ab3018b85033f62c2845921" | ||
} | ||
}, | ||
{ | ||
"uri": "pkg:maven/io.github.behnazh-w.demo/example-maven-app@1.0?type=jar", | ||
"digest": { | ||
"sha256": "759a3c7f76ef2c467cedb814ed3fd38cb9125126664f66f9a62d1cfa0e54b6b7" | ||
} | ||
"_type": "https://in-toto.io/Statement/v1", | ||
"subject": [ | ||
{ | ||
"uri": "pkg:maven/io.github.behnazh-w.demo/example-maven-app@1.0-SNAPSHOT?type=jar", | ||
"digest": { | ||
"sha256": "19986144a60f3d16d1e8d96bc1807c42bb7c91068ab3018b85033f62c2845921" | ||
} | ||
}, | ||
{ | ||
"uri": "pkg:maven/io.github.behnazh-w.demo/example-maven-app@1.0?type=jar", | ||
"digest": { | ||
"sha256": "759a3c7f76ef2c467cedb814ed3fd38cb9125126664f66f9a62d1cfa0e54b6b7" | ||
} | ||
} | ||
], | ||
"predicateType": "https://slsa.dev/verification_summary/v1", | ||
"predicate": { | ||
"verifier": { | ||
"id": "https://github.com/oracle/macaron", | ||
"version": { | ||
"macaron": "0.11.0" | ||
} | ||
}, | ||
"timeVerified": "2024-07-23T05:34:41.564563+00:00", | ||
"resourceUri": "", | ||
"policy": { | ||
"content": "/* Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. */\n/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */\n\n#include \"prelude.dl\"\n\nPolicy(\"example_maven_app_policy\", component_id, \"Policy for github Maven project with Witness and GitHub provenances\") :-\n check_passed(component_id, \"mcn_build_service_1\"),\n check_passed(component_id, \"mcn_build_script_1\"),\n check_passed(component_id, \"mcn_provenance_available_1\"),\n check_passed(component_id, \"mcn_provenance_expectation_1\"),\n // We expect mcn_provenance_witness_level_one_1 to fail because at the moment\n // it tries to discover the witness provenance even when the provenance is provided as input.\n // TODO: address this policy once the issue with mcn_provenance_witness_level_one_1 is addressed.\n check_failed(component_id, \"mcn_provenance_witness_level_one_1\").\n\napply_policy_to(\"example_maven_app_policy\", component_id) :-\n is_repo(\n _, // repo_id\n \"github.com/behnazh-w/example-maven-app\", // http URL to the repo but without the \"http://\"\n component_id\n ).\n" | ||
}, | ||
"verificationResult": "PASSED", | ||
"verifiedLevels": [] | ||
} | ||
], | ||
"predicateType": "https://slsa.dev/verification_summary/v1", | ||
"predicate": { | ||
"verifier": { | ||
"id": "https://github.com/oracle/macaron", | ||
"version": { | ||
"macaron": "0.9.0" | ||
} | ||
}, | ||
"timeVerified": "2024-05-07T05:32:42.105941+00:00", | ||
"resourceUri": "", | ||
"policy": { | ||
"content": "/* Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. */\n/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */\n\n#include \"prelude.dl\"\n\nPolicy(\"example_maven_app_policy\", component_id, \"Policy for github Maven project with Witness and GitHub provenances\") :-\n check_passed(component_id, \"mcn_build_service_1\"),\n check_passed(component_id, \"mcn_build_script_1\"),\n check_passed(component_id, \"mcn_provenance_available_1\"),\n check_passed(component_id, \"mcn_provenance_expectation_1\").\n\napply_policy_to(\"example_maven_app_policy\", component_id) :-\n is_repo(\n _, // repo_id\n \"github.com/behnazh-w/example-maven-app\", // http URL to the repo but without the \"http://\"\n component_id\n ).\n" | ||
}, | ||
"verificationResult": "PASSED", | ||
"verifiedLevels": [] | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code splitting this string is assuming that the name is of the form
https://witness.dev/attestations/product/v0.1/file:path/to/file
. I know that this function is currently only called on a list that comes fromextract_build_artifacts_from_witness_subjects
, which currently only produces subjects of that form, but if that changes in future this code would silently break. I think it would be safer for this code to validate that it is a witness file subject before extracting the filename and throw an exception if it is not (which currently should never happen).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I have added the validation here - c57936b