Skip to content
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

feat: Improve output for dockerfile instructions #2353

Merged
merged 2 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"semver": "^6.0.0",
"snyk-config": "4.0.0",
"snyk-cpp-plugin": "2.13.0",
"snyk-docker-plugin": "4.26.1",
"snyk-docker-plugin": "4.27.0",
"snyk-go-plugin": "1.18.0",
"snyk-gradle-plugin": "3.17.0",
"snyk-module": "3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/snyk-test/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ async function parseRes(
const dockerfilePackage = dockerfilePackages[vuln.name.split('/')[0]];
if (dockerfilePackage) {
(vuln as DockerIssue).dockerfileInstruction =
dockerfilePackage.instruction;
dockerfilePackage.installCommand;
This conversation was marked as resolved.
Show resolved Hide resolved
}
(vuln as DockerIssue).dockerBaseImage = res.docker!.baseImage;
return vuln;
Expand Down
10 changes: 6 additions & 4 deletions test/acceptance/cli-test/cli-test.docker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export const DockerTests: AcceptanceTests = {
dockerfilePackages: {
'openssl@1.5.0': {
instruction: 'RUN apk add openssl@1.5.0',
installCommand: 'apk add openssl@1.5.0',
},
},
dockerfileLayers: {
Expand Down Expand Up @@ -264,6 +265,7 @@ export const DockerTests: AcceptanceTests = {
dockerfilePackages: {
'openssl@1.5.0': {
instruction: 'RUN apk add openssl@1.5.0',
installCommand: 'apk add openssl@1.5.0',
},
},
dockerfileLayers: {
Expand Down Expand Up @@ -649,7 +651,7 @@ export const DockerTests: AcceptanceTests = {
data: {
dockerfilePackages: {
bzip2: {
instruction: 'RUN test instruction',
installCommand: 'test installCommand',
},
},
},
Expand Down Expand Up @@ -678,7 +680,7 @@ export const DockerTests: AcceptanceTests = {
t.fail('should have found vuln');
} catch (err) {
const msg = err.message;
t.match(msg, "Image layer: 'RUN test instruction'");
t.match(msg, "Image layer: 'test installCommand'");
}
},

Expand All @@ -697,7 +699,7 @@ export const DockerTests: AcceptanceTests = {
data: {
dockerfilePackages: {
bzip2: {
instruction: 'RUN test instruction',
installCommand: 'test installCommand',
},
},
},
Expand Down Expand Up @@ -726,7 +728,7 @@ export const DockerTests: AcceptanceTests = {
t.fail('should have found vuln');
} catch (err) {
const msg = err.message;
t.match(msg, "Image layer: 'RUN test instruction'");
t.match(msg, "Image layer: 'test installCommand'");
}
},

Expand Down