generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: find SLSA provenance v0.2 published on npm registry (#551)
This PR adds a feature to detect SLSA provenance v0.2 for npm packages that are published on the npm registry. Note that - This PR does not add verification of these provenances. The verification will be handled separately. - Support for SLSA provenance v1 will be added in future. - A test for an npm package is added to the integration tests. If making REST Calls to the npm registry is not possible, developers can skip that test by setting NO_NPM environment variable before running make integration-test. Signed-off-by: behnazh-w <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,086 additions
and
97 deletions.
There are no files selected for viewing
This file contains 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 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 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
7 changes: 7 additions & 0 deletions
7
.../source/pages/developers_guide/apidoc/macaron.slsa_analyzer.provenance.slsa.rst
This file contains 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
macaron.slsa\_analyzer.provenance.slsa package | ||
============================================== | ||
|
||
.. automodule:: macaron.slsa_analyzer.provenance.slsa | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. Copyright (c) 2023 - 2023, Oracle and/or its affiliates. All rights reserved. | ||
.. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
============ | ||
npm Registry | ||
============ |
This file contains 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 |
---|---|---|
|
@@ -38,6 +38,13 @@ function check_or_update_expected_output() { | |
fi | ||
} | ||
|
||
# Check if npm-related tests should be disabled. | ||
if [[ "$NO_NPM" == "TRUE" ]]; then | ||
echo "Note: NO_NPM environment variable is set to TRUE, so npm tests will be skipped." | ||
fi | ||
NO_NPM_TEST=$NO_NPM | ||
|
||
|
||
function log_fail() { | ||
printf "Error: FAILED integration test (line ${BASH_LINENO}) %s\n" $@ | ||
RESULT_CODE=1 | ||
|
@@ -66,6 +73,17 @@ $RUN_MACARON analyze -rp https://github.com/micronaut-projects/micronaut-core -b | |
|
||
check_or_update_expected_output $COMPARE_JSON_OUT $JSON_RESULT $JSON_EXPECTED || log_fail | ||
|
||
if [[ -z "$NO_NPM_TEST" ]]; then | ||
echo -e "\n----------------------------------------------------------------------------------" | ||
echo "sigstore/[email protected]: Analyzing the PURL when automatic dependency resolution is skipped." | ||
echo -e "----------------------------------------------------------------------------------\n" | ||
JSON_EXPECTED=$WORKSPACE/tests/e2e/expected_results/purl/npm/sigstore/mock/mock.json | ||
JSON_RESULT=$WORKSPACE/output/reports/npm/_sigstore/mock/mock.json | ||
$RUN_MACARON analyze -purl pkg:npm/@sigstore/[email protected] -rp https://github.com/sigstore/sigstore-js -b main -d ebdcfdfbdfeb9c9aeee6df53674ef230613629f5 --skip-deps || log_fail | ||
|
||
check_or_update_expected_output $COMPARE_JSON_OUT $JSON_RESULT $JSON_EXPECTED || log_fail | ||
fi | ||
|
||
echo -e "\n----------------------------------------------------------------------------------" | ||
echo "gitlab.com/tinyMediaManager/tinyMediaManager: Analyzing the repo path and the branch name when automatic dependency resolution is skipped." | ||
echo -e "----------------------------------------------------------------------------------\n" | ||
|
This file contains 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 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 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
Oops, something went wrong.