From 5b42613ebb22ce1d65de1914015f7195aa5a922f Mon Sep 17 00:00:00 2001 From: Katie Armstrong Date: Tue, 11 Apr 2023 15:23:08 +0100 Subject: [PATCH] feat: upgrade deps to support oci images --- package-lock.json | 89 ++++++++++++------- package.json | 4 +- .../snyk-container/container.spec.ts | 9 ++ 3 files changed, 66 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 799b98fd00..2be3b0f1e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@snyk/cloud-config-parser": "^1.14.5", "@snyk/code-client": "^4.18.1", "@snyk/dep-graph": "^1.27.1", - "@snyk/docker-registry-v2-client": "^2.7.3", + "@snyk/docker-registry-v2-client": "^2.9.0", "@snyk/fix": "file:packages/snyk-fix", "@snyk/gemfile": "1.2.0", "@snyk/snyk-cocoapods-plugin": "2.5.3", @@ -67,7 +67,7 @@ "semver": "^6.0.0", "snyk-config": "4.0.0", "snyk-cpp-plugin": "2.22.0", - "snyk-docker-plugin": "6.2.0", + "snyk-docker-plugin": "^6.3.0", "snyk-go-plugin": "^1.19.5", "snyk-gradle-plugin": "3.26.3", "snyk-module": "3.1.0", @@ -2168,11 +2168,11 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@snyk/docker-registry-v2-client": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@snyk/docker-registry-v2-client/-/docker-registry-v2-client-2.7.3.tgz", - "integrity": "sha512-5OY8z8RObmHpydKui+bbOmlEbzE2hSS8GAkJmPy+Zl19ZOUJ02L3K816qws9Kg1qDzJi3Cl2T6hmLSF2HHVfyw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@snyk/docker-registry-v2-client/-/docker-registry-v2-client-2.9.0.tgz", + "integrity": "sha512-zTUp7cCg8zqRlv74hzMLsaWIviWb+/AAJAk6A8eTMI5ixA95oiNESufOBKTBwjx5Ot5pducdaKm0gZSYMdBSqQ==", "dependencies": { - "needle": "^2.6.0", + "needle": "^3.2.0", "parse-link-header": "^2.0.0", "tslib": "^1.10.0" } @@ -2185,13 +2185,24 @@ "ms": "^2.1.1" } }, + "node_modules/@snyk/docker-registry-v2-client/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@snyk/docker-registry-v2-client/node_modules/needle": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", - "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.2.0.tgz", + "integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==", "dependencies": { "debug": "^3.2.6", - "iconv-lite": "^0.4.4", + "iconv-lite": "^0.6.3", "sax": "^1.2.4" }, "bin": { @@ -2338,11 +2349,11 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/@snyk/snyk-docker-pull": { - "version": "3.7.5", - "resolved": "https://registry.npmjs.org/@snyk/snyk-docker-pull/-/snyk-docker-pull-3.7.5.tgz", - "integrity": "sha512-o+qDQ2qRMsp4vr3UIWCMwWFYvDuqbROBO2psuUs2zaITWrmHmnzENYR67ek9y2jy9ay2jpf8LCFJHyNJNc1eHg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@snyk/snyk-docker-pull/-/snyk-docker-pull-3.8.0.tgz", + "integrity": "sha512-Tz5AuhP5PDoabyT2NsFJQYfLzV/uNoNbCejXZsCUn1bnYNRGD3EBrrClFmkU+v3z9VK+jOoeMGbN44JtKKxgIA==", "dependencies": { - "@snyk/docker-registry-v2-client": "^2.7.2", + "@snyk/docker-registry-v2-client": "^2.9.0", "child-process": "^1.0.2", "tar-stream": "^2.2.0", "tmp": "^0.2.1" @@ -16634,14 +16645,15 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/snyk-docker-plugin": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/snyk-docker-plugin/-/snyk-docker-plugin-6.2.0.tgz", - "integrity": "sha512-M+M78vQkyk1is1R1dU9O4nTLIDTZ6eCq3jcnnnLfwtkegqddydQttXptsAzhAWdWLZzIiofo+9asQmj1clCV5g==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/snyk-docker-plugin/-/snyk-docker-plugin-6.3.0.tgz", + "integrity": "sha512-M4pe49/L8WGyPW0vBllveDbtq8i7smAIcr3Oo/wMUIzqcZjSF/7Oluxi9eUEtZ8SSF73QojnNzlDZSJIglpx2w==", "dependencies": { "@snyk/composer-lockfile-parser": "^1.4.1", "@snyk/dep-graph": "^2.5.0", + "@snyk/docker-registry-v2-client": "^2.9.0", "@snyk/rpm-parser": "3.1.0", - "@snyk/snyk-docker-pull": "^3.7.5", + "@snyk/snyk-docker-pull": "^3.8.0", "adm-zip": "^0.5.5", "chalk": "^2.4.2", "debug": "^4.1.1", @@ -21934,11 +21946,11 @@ } }, "@snyk/docker-registry-v2-client": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@snyk/docker-registry-v2-client/-/docker-registry-v2-client-2.7.3.tgz", - "integrity": "sha512-5OY8z8RObmHpydKui+bbOmlEbzE2hSS8GAkJmPy+Zl19ZOUJ02L3K816qws9Kg1qDzJi3Cl2T6hmLSF2HHVfyw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@snyk/docker-registry-v2-client/-/docker-registry-v2-client-2.9.0.tgz", + "integrity": "sha512-zTUp7cCg8zqRlv74hzMLsaWIviWb+/AAJAk6A8eTMI5ixA95oiNESufOBKTBwjx5Ot5pducdaKm0gZSYMdBSqQ==", "requires": { - "needle": "^2.6.0", + "needle": "^3.2.0", "parse-link-header": "^2.0.0", "tslib": "^1.10.0" }, @@ -21951,13 +21963,21 @@ "ms": "^2.1.1" } }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, "needle": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", - "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.2.0.tgz", + "integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==", "requires": { "debug": "^3.2.6", - "iconv-lite": "^0.4.4", + "iconv-lite": "^0.6.3", "sax": "^1.2.4" } } @@ -22160,11 +22180,11 @@ } }, "@snyk/snyk-docker-pull": { - "version": "3.7.5", - "resolved": "https://registry.npmjs.org/@snyk/snyk-docker-pull/-/snyk-docker-pull-3.7.5.tgz", - "integrity": "sha512-o+qDQ2qRMsp4vr3UIWCMwWFYvDuqbROBO2psuUs2zaITWrmHmnzENYR67ek9y2jy9ay2jpf8LCFJHyNJNc1eHg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@snyk/snyk-docker-pull/-/snyk-docker-pull-3.8.0.tgz", + "integrity": "sha512-Tz5AuhP5PDoabyT2NsFJQYfLzV/uNoNbCejXZsCUn1bnYNRGD3EBrrClFmkU+v3z9VK+jOoeMGbN44JtKKxgIA==", "requires": { - "@snyk/docker-registry-v2-client": "^2.7.2", + "@snyk/docker-registry-v2-client": "^2.9.0", "child-process": "^1.0.2", "tar-stream": "^2.2.0", "tmp": "^0.2.1" @@ -33234,14 +33254,15 @@ } }, "snyk-docker-plugin": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/snyk-docker-plugin/-/snyk-docker-plugin-6.2.0.tgz", - "integrity": "sha512-M+M78vQkyk1is1R1dU9O4nTLIDTZ6eCq3jcnnnLfwtkegqddydQttXptsAzhAWdWLZzIiofo+9asQmj1clCV5g==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/snyk-docker-plugin/-/snyk-docker-plugin-6.3.0.tgz", + "integrity": "sha512-M4pe49/L8WGyPW0vBllveDbtq8i7smAIcr3Oo/wMUIzqcZjSF/7Oluxi9eUEtZ8SSF73QojnNzlDZSJIglpx2w==", "requires": { "@snyk/composer-lockfile-parser": "^1.4.1", "@snyk/dep-graph": "^2.5.0", + "@snyk/docker-registry-v2-client": "^2.9.0", "@snyk/rpm-parser": "3.1.0", - "@snyk/snyk-docker-pull": "^3.7.5", + "@snyk/snyk-docker-pull": "^3.8.0", "adm-zip": "^0.5.5", "chalk": "^2.4.2", "debug": "^4.1.1", diff --git a/package.json b/package.json index da14960b0b..e2794e2bc0 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@snyk/cloud-config-parser": "^1.14.5", "@snyk/code-client": "^4.18.1", "@snyk/dep-graph": "^1.27.1", - "@snyk/docker-registry-v2-client": "^2.7.3", + "@snyk/docker-registry-v2-client": "^2.9.0", "@snyk/fix": "file:packages/snyk-fix", "@snyk/gemfile": "1.2.0", "@snyk/snyk-cocoapods-plugin": "2.5.3", @@ -114,7 +114,7 @@ "semver": "^6.0.0", "snyk-config": "4.0.0", "snyk-cpp-plugin": "2.22.0", - "snyk-docker-plugin": "6.2.0", + "snyk-docker-plugin": "^6.3.0", "snyk-go-plugin": "^1.19.5", "snyk-gradle-plugin": "3.26.3", "snyk-module": "3.1.0", diff --git a/test/jest/acceptance/snyk-container/container.spec.ts b/test/jest/acceptance/snyk-container/container.spec.ts index fba8c0a15f..4ea1f30e5f 100644 --- a/test/jest/acceptance/snyk-container/container.spec.ts +++ b/test/jest/acceptance/snyk-container/container.spec.ts @@ -28,4 +28,13 @@ describe('snyk container', () => { ); await expect(cli).toDisplay(`yum @ 4.9.0`, { timeout: 60 * 1000 }); }); + + it('finds dependencies in oci image (library/ubuntu)', async () => { + cli = await startSnykCLI( + 'container test library/ubuntu@sha256:7a57c69fe1e9d5b97c5fe649849e79f2cfc3bf11d10bbd5218b4eb61716aebe6 --print-deps', + ); + await expect(cli).toDisplay(`coreutils @ 8.32-4.1ubuntu1`, { + timeout: 60 * 1000, + }); + }); });