Skip to content

Commit

Permalink
Try out syft and grype for SBOMs and vulnerability scans
Browse files Browse the repository at this point in the history
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
  • Loading branch information
dominikschulz committed Jul 10, 2022
1 parent ad18f38 commit 6b8f0fe
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 355 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: sigstore/cosign-installer@v2.4.1 # installs cosign
- uses: anchore/sbom-action/download-syft@v0.11.0 # installs syft
# ubuntu is missing wixl https://github.com/actions/virtual-environments/issues/3857
-
name: "Install GNOME msitools (wixl)"
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Ubuntu Dependencies
run: sudo apt-get install --yes git gnupg
- run: git config --global user.name nobody
Expand All @@ -42,6 +48,10 @@ jobs:
run: make travis
- name: Integration Test
run: make test-integration
- name: Scan current project
uses: anchore/scan-action@v3
with:
path: "."

windows:
runs-on: windows-latest
Expand Down
22 changes: 21 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,26 @@ milestones:

signs:
-
id: gopass
id: gpg
artifacts: checksum
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--armor", "--output", "${signature}", "--detach-sign", "${artifact}"]
-
id: cosign
cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
certificate: '${artifact}.pem'
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
artifacts: checksum
output: true

# creates SBOMs of all archives and the source tarball using syft
# https://goreleaser.com/customization/sbom
sboms:
- artifacts: archive
- id: source # Two different sbom configurations need two different IDs
artifacts: source
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ require (
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354
github.com/schollz/closestmatch v0.0.0-20190308193919-1fbe626be92e
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/stretchr/testify v1.7.5
github.com/stretchr/testify v1.8.0
github.com/twpayne/go-pinentry v0.2.0
github.com/urfave/cli/v2 v2.10.3
github.com/urfave/cli/v2 v2.11.0
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d
golang.org/x/net v0.0.0-20220622184535-263ec571b305
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664
golang.org/x/exp v0.0.0-20220706164943-b4a6d9510983
golang.org/x/net v0.0.0-20220708220712-1185a9018129
golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467
gopkg.in/yaml.v3 v3.0.1
)
Expand Down
Loading

0 comments on commit 6b8f0fe

Please sign in to comment.