Skip to content

Commit

Permalink
Add Anchore Go dependency security scanning
Browse files Browse the repository at this point in the history
Scan Go dependencies for known vulnerabilities.

Run on PRs to gate on vulns negligible or higher.
Also run on merges to devel and release branches to report results on
the GitHub Code Scanning tab.

Ignore two false positives.

Relates-to: submariner-io/submariner#794
Signed-off-by: Daniel Farrell <[email protected]>
  • Loading branch information
dfarrell07 authored and tpantelis committed Aug 18, 2022
1 parent 892ea84 commit 8f2af1f
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,28 @@ jobs:
- name: Run shellcheck
run: make shellcheck

vulnerability-scan:
name: Vulnerability Scanning
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run Anchore vulnerability scanner
uses: anchore/scan-action@516844f15d82b6cdd0765b87aab79ed3ac006225
id: scan
with:
path: "."
fail-build: true
severity-cutoff: negligible
- name: Show Anchore scan SARIF report
if: always()
run: cat ${{ steps.scan.outputs.sarif }}
- name: Upload Anchore scan SARIF report
if: always()
uses: github/codeql-action/upload-sarif@0c670bbf0414f39666df6ce8e718ec5662c21e03
with:
sarif_file: ${{ steps.scan.outputs.sarif }}

yaml-lint:
name: YAML
runs-on: ubuntu-latest
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Reporting

on:
push:
branches:
- devel
- release-*

jobs:
vulnerability-scan:
name: Vulnerability Scanning
if: github.repository_owner == 'submariner-io'
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run Anchore vulnerability scanner
uses: anchore/scan-action@516844f15d82b6cdd0765b87aab79ed3ac006225
id: scan
with:
path: "."
fail-build: false
- name: Show Anchore scan SARIF report
run: cat ${{ steps.scan.outputs.sarif }}
- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@0c670bbf0414f39666df6ce8e718ec5662c21e03
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
12 changes: 12 additions & 0 deletions .grype.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
ignore:
# False positive, CVE is actually about the C++ project protocolbuffers/protobuf
# https://github.com/anchore/grype/issues/558
- vulnerability: CVE-2015-5237
package:
name: google.golang.org/protobuf
# False positive, CVE is actually about the C++ project protocolbuffers/protobuf
# https://github.com/anchore/grype/issues/633
- vulnerability: CVE-2021-22570
package:
name: google.golang.org/protobuf

0 comments on commit 8f2af1f

Please sign in to comment.