-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Scan with govulncheck and upload SARIF report #9474
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
45f1def
Add executable that contains Go's symbol table
jaehnri 90496b1
Scan govulncheck and upload SARIF report in pipeline
jaehnri 49a27a5
Give pigz write permission to unzip the scannable binary
jaehnri f95dedc
Git checkout before executing scan
jaehnri 9d944c9
Upload SARIF report using templum's action
jaehnri b378bf1
Allow writes to security-events
jaehnri e3acf7f
Upload SARIF report using codeql's action
jaehnri 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 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 |
---|---|---|
|
@@ -187,12 +187,62 @@ jobs: | |
ingress-controller/controller-chroot:1.0.0-dev \ | ||
| pigz > docker.tar.gz | ||
|
||
# pigz needs write permission to zip the scannable binary | ||
sudo chown -R $USER:$USER /home/runner/work/ingress-nginx | ||
pigz rootfs/bin/amd64/scannable-nginx-ingress-controller | ||
|
||
- name: cache | ||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 | ||
with: | ||
name: docker.tar.gz | ||
path: docker.tar.gz | ||
|
||
- name: Upload scannable binary | ||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 | ||
with: | ||
name: scannable-nginx-ingress-controller.gz | ||
path: rootfs/bin/amd64/scannable-nginx-ingress-controller.gz | ||
|
||
govulncheck: | ||
name: govulncheck | ||
runs-on: ubuntu-latest | ||
needs: | ||
- changes | ||
- build | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0 | ||
|
||
- name: Download binary | ||
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1 | ||
with: | ||
name: scannable-nginx-ingress-controller.gz | ||
|
||
- name: Unzip binary | ||
run: | | ||
echo "loading ingress binary file..." | ||
pigz -d scannable-nginx-ingress-controller.gz | ||
|
||
- name: Scan for Vulnerabilities in Code | ||
uses: Templum/[email protected] | ||
with: | ||
go-version: 1.19 | ||
vulncheck-version: latest | ||
skip-upload: true | ||
package: scannable-nginx-ingress-controller | ||
fail-on-vuln: false | ||
|
||
- uses: geekyeggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af # v2.0.0 | ||
with: | ||
name: scannable-nginx-ingress-controller.gz | ||
failOnError: false | ||
|
||
- name: Upload SARIF report | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: govulncheck-report.sarif | ||
|
||
helm: | ||
name: Helm chart | ||
runs-on: ubuntu-latest | ||
|
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 |
---|---|---|
|
@@ -57,6 +57,16 @@ ${GO_BUILD_CMD} \ | |
-buildvcs=false \ | ||
-o "${TARGETS_DIR}/nginx-ingress-controller" "${PKG}/cmd/nginx" | ||
|
||
echo "Building ${PKG}/cmd/nginx with Go's symbol table" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whats the difference between |
||
|
||
${GO_BUILD_CMD} \ | ||
-trimpath -ldflags="-buildid= -w \ | ||
-X ${PKG}/version.RELEASE=${TAG} \ | ||
-X ${PKG}/version.COMMIT=${COMMIT_SHA} \ | ||
-X ${PKG}/version.REPO=${REPO_INFO}" \ | ||
-buildvcs=false \ | ||
-o "${TARGETS_DIR}/scannable-nginx-ingress-controller" "${PKG}/cmd/nginx" | ||
|
||
echo "Building ${PKG}/cmd/dbg" | ||
|
||
${GO_BUILD_CMD} \ | ||
|
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.
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.
we have updated the go tool chain to v1.20