Skip to content

Commit be4deb0

Browse files
Try out syft and grype for SBOMs and vulnerability scans (#2268)
RELEASE_NOTES=[ENHANCEMENT] Scan for vulnerabilities and add SBOM on release Signed-off-by: Dominik Schulz <[email protected]>
1 parent 30fa378 commit be4deb0

File tree

7 files changed

+78
-348
lines changed

7 files changed

+78
-348
lines changed

.github/workflows/autorelease.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ jobs:
2323
uses: actions/setup-go@v3
2424
with:
2525
go-version: 1.18
26+
- uses: actions/cache@v3
27+
with:
28+
path: ~/go/pkg/mod
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
- uses: sigstore/[email protected] # installs cosign
33+
- uses: anchore/sbom-action/[email protected] # installs syft
2634
# ubuntu is missing wixl https://github.com/actions/virtual-environments/issues/3857
2735
-
2836
name: "Install GNOME msitools (wixl)"

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
uses: actions/setup-go@v3
2323
with:
2424
go-version: 1.18
25+
- uses: actions/cache@v3
26+
with:
27+
path: ~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
2531
- name: Ubuntu Dependencies
2632
run: sudo apt-get install --yes git gnupg
2733
- run: git config --global user.name nobody

.github/workflows/grype.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Scan gopass
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}-build
11+
cancel-in-progress: true
12+
13+
jobs:
14+
linux:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- name: Set up Go
21+
uses: actions/setup-go@v3
22+
with:
23+
go-version: 1.18
24+
- uses: actions/cache@v3
25+
with:
26+
path: ~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
- name: Scan current project
31+
uses: anchore/scan-action@v3
32+
with:
33+
path: "."
34+
fail-build: true
35+
severity-cutoff: critical

.goreleaser.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,10 @@ signs:
107107
id: gopass
108108
artifacts: checksum
109109
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--armor", "--output", "${signature}", "--detach-sign", "${artifact}"]
110+
111+
# creates SBOMs of all archives and the source tarball using syft
112+
# https://goreleaser.com/customization/sbom
113+
sboms:
114+
- artifacts: archive
115+
- id: source # Two different sbom configurations need two different IDs
116+
artifacts: source

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ require (
3232
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354
3333
github.com/schollz/closestmatch v0.0.0-20190308193919-1fbe626be92e
3434
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
35-
github.com/stretchr/testify v1.7.5
35+
github.com/stretchr/testify v1.8.0
3636
github.com/twpayne/go-pinentry v0.2.0
37-
github.com/urfave/cli/v2 v2.10.3
37+
github.com/urfave/cli/v2 v2.11.0
3838
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
39-
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d
40-
golang.org/x/net v0.0.0-20220622184535-263ec571b305
41-
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2
42-
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664
39+
golang.org/x/exp v0.0.0-20220706164943-b4a6d9510983
40+
golang.org/x/net v0.0.0-20220708220712-1185a9018129
41+
golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0
42+
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d
4343
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467
4444
gopkg.in/yaml.v3 v3.0.1
4545
)

go.sum

Lines changed: 12 additions & 341 deletions
Large diffs are not rendered by default.

pkg/pwgen/pwrules/pwrules_gen.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)