Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit c34bbea

Browse files
committed
Update version of the Snyk CLI to v1.790.0
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
1 parent c8da19f commit c34bbea

5 files changed

Lines changed: 22 additions & 13 deletions

File tree

.github/workflows/build-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
env:
99
GO111MODULE: "on"
1010
steps:
11-
- name: Set up Go 1.15
11+
- name: Set up Go 1.17
1212
uses: actions/setup-go@v1
1313
with:
14-
go-version: 1.15
14+
go-version: 1.17
1515
id: go
1616

1717
- name: Checkout code into the Go module directory
@@ -38,10 +38,10 @@ jobs:
3838
- name: Docker version
3939
run: docker version
4040

41-
- name: Set up Go 1.15
41+
- name: Set up Go 1.17
4242
uses: actions/setup-go@v1
4343
with:
44-
go-version: 1.15
44+
go-version: 1.17
4545
id: go
4646

4747
- name: Checkout code into the Go module directory

cmd/docker-scan/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,15 @@ func configureProvider(ctx context.Context, dockerCli command.Cli, flags options
119119
opts = append(opts, options...)
120120
if flags.jsonFormat {
121121
opts = append(opts, provider.WithJSON())
122+
opts = append(opts, provider.WithExperimental())
122123
if flags.groupIssues {
123124
opts = append(opts, provider.WithGroupIssues())
124125
}
125126
} else if flags.groupIssues {
126127
return nil, fmt.Errorf("--json flag is mandatory to use --group-issues flag")
127-
} else {
128-
opts = append(opts, provider.WithAppVulns())
129128
}
129+
opts = append(opts, provider.WithAppVulns())
130+
130131
if flags.dockerFilePath != "" {
131132
opts = append(opts, provider.WithDockerFile(flags.dockerFilePath))
132133
if flags.excludeBase {

e2e/scan_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func TestScanWithFileAndExcludeBaseImageVulns(t *testing.T) {
230230

231231
cmd.Command = dockerCli.Command("scan", "--accept-license", "--file", "./testdata/Dockerfile", "--exclude-base", ImageBaseImageVulnerabilities)
232232
output := icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined()
233-
assert.Assert(t, strings.Contains(output, "found 0 issues."))
233+
assert.Assert(t, strings.Contains(output, "no vulnerable paths found."))
234234
}
235235

236236
func TestScanWithExcludeBaseImageVulns(t *testing.T) {
@@ -431,7 +431,7 @@ func TestScanWithFileAndExcludeBaseImageVulnsContainerizedProvider(t *testing.T)
431431

432432
cmd.Command = dockerCli.Command("scan", "--file", dockerfilePath, "--exclude-base", ImageBaseImageVulnerabilities)
433433
output := icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined()
434-
assert.Assert(t, strings.Contains(output, "found 0 issues."))
434+
assert.Assert(t, strings.Contains(output, "no vulnerable paths found."))
435435
}
436436

437437
func createSnykConfDirectories(t *testing.T, withConfFile bool, token string) (*fs.Dir, func()) {

internal/provider/provider.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ func WithPath(path string) Ops {
170170
}
171171
}
172172

173+
// WithExperimental allows running `--json` flag in combination of `--app-vulns`
174+
func WithExperimental() Ops {
175+
return func(provider *Options) error {
176+
provider.flags = append(provider.flags, "--experimental")
177+
return nil
178+
}
179+
}
180+
173181
func getToken(opts Options) (string, error) {
174182
if opts.auth.Username == "" {
175183
return "", fmt.Errorf(`You need to be logged in to Docker Hub to use scan feature.

vars.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Pinned Versions
2-
SNYK_DESKTOP_VERSION=1.563.0
2+
SNYK_DESKTOP_VERSION=1.790.0
33
SNYK_USER_VERSION=1.460.0
44
SNYK_OLD_VERSION=1.382.1
55
# Digest of the 1.563.0 snyk/snyk:docker image
6-
SNYK_IMAGE_DIGEST=sha256:defb5ba5517a29a78736d919d3dc0568f555980a43daefe1ac8a1e7fc0924f25
7-
GO_VERSION=1.15.0
8-
CLI_VERSION=19.03.9
9-
ALPINE_VERSION=3.12.0
6+
SNYK_IMAGE_DIGEST=sha256:579d7263467ec0cffb44ec1720a320dd1ed6a78d6d4a8d9f58088a26f1d35ac4
7+
GO_VERSION=1.17.5
8+
CLI_VERSION=20.10.11
9+
ALPINE_VERSION=3.15.0
1010
GOLANGCI_LINT_VERSION=v1.27.0-alpine
1111
GOTESTSUM_VERSION=0.5.2
1212

0 commit comments

Comments
 (0)