-
Notifications
You must be signed in to change notification settings - Fork 0
Publish release binaries govulncheck can assess #37
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
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
854ee07
Keep the symbol table in released binaries
stackstate-ci 71885d9
Gate the release on binaries govulncheck can assess
stackstate-ci 102981f
Bump golang.org/x/crypto to v0.55.0
stackstate-ci 99f8457
Assert the symbol table directly instead of via govulncheck
stackstate-ci 8ff3aef
Merge the x/crypto v0.55.0 bump
stackstate-ci 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Binary-mode govulncheck can only judge which packages are linked while the | ||
| # release binaries keep their symbol table, so stripping it again (`-s` in the | ||
| # GoReleaser ldflags) makes this fail instead of publishing artifacts whose | ||
| # reachability nobody can assess. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| rootfs_dir="${1:-artifact-scan/rootfs}" | ||
| govulncheck_version="${GOVULNCHECK_VERSION:-v1.6.0}" | ||
| expected_binaries=5 | ||
| binaries=() | ||
|
|
||
| while IFS= read -r binary; do | ||
| binaries+=("${binary}") | ||
| done < <(find "${rootfs_dir}" -type f \( -name sts-backup -o -name sts-backup.exe \) -print | sort) | ||
|
|
||
| if [[ "${#binaries[@]}" -ne "${expected_binaries}" ]]; then | ||
| echo "Expected ${expected_binaries} release binaries under '${rootfs_dir}', found ${#binaries[@]}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| status=0 | ||
| for binary in "${binaries[@]}"; do | ||
| echo "== ${binary}" | ||
| if ! go run "golang.org/x/vuln/cmd/govulncheck@${govulncheck_version}" -mode=binary "${binary}"; then | ||
| status=1 | ||
| fi | ||
| done | ||
|
|
||
| exit "${status}" | ||
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.