-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
How to LGTM this PR (I'll work on a proper doc for this in slsa-framework/slsa-github-generator#112): 1. Clone repo ``` $ git clone git@github.com:slsa-framework/slsa-verifier.git $ cd slsa-verifier $ bash verify-release.sh v2.4.0 # NOTE: use the file in _this_ PR. # Note down the path to the temporary dir use. The bash script will print its first line as "INFO: using dir: /tmp/tmp.VaYi6HfbmL" ``` 2. Run command below and compare to SHA256SUM.md in this PR ``` $sha256sum /tmp/tmp.VaYi6HfbmL/* ``` The output hash should be the hash I'm updating to in this PR. If they match, LGTM. If they don't, someone tampered with the released binary and don't LGTM --------- Signed-off-by: laurentsimon <laurentsimon@google.com>
- Loading branch information
1 parent
886eb4b
commit d23c979
Showing
5 changed files
with
54 additions
and
4 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
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,40 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 tag" | ||
exit 1 | ||
fi | ||
|
||
# Verify GH_TOKEN is set. | ||
if [[ -z "${GH_TOKEN:-}" ]]; then | ||
echo "GH_TOKEN is unset" | ||
exit 1 | ||
fi | ||
|
||
# Set the gh CLI. | ||
if [[ -z "${GH:-}" ]]; then | ||
GH="gh" | ||
fi | ||
|
||
dir=$(mktemp -d) | ||
tag="$1" | ||
|
||
mkdir -p "${dir}" | ||
rm -rf "${dir:?}/"* 2>/dev/null || true | ||
|
||
echo "INFO: using dir: ${dir}" | ||
echo | ||
|
||
# Download artifacts and provenance. | ||
cd "${dir}" | ||
"${GH}" release -R slsa-framework/slsa-verifier download "${tag}" | ||
cd - | ||
|
||
for file in "${dir}"/*; do | ||
if [[ "${file}" == *".intoto.jsonl" ]]; then | ||
continue | ||
fi | ||
go run ./cli/slsa-verifier verify-artifact "${file}" --provenance-path "${file}".intoto.jsonl --source-uri github.com/slsa-framework/slsa-verifier --source-tag "${tag}" | ||
done |