diff --git a/package-lock.json b/package-lock.json index cc7ec51b7d..f454572c05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@snyk/cloud-config-parser": "^1.14.3", "@snyk/code-client": "^4.12.3", "@snyk/dep-graph": "^1.27.1", - "@snyk/docker-registry-v2-client": "^2.7.2", + "@snyk/docker-registry-v2-client": "^2.7.3", "@snyk/fix": "file:packages/snyk-fix", "@snyk/gemfile": "1.2.0", "@snyk/snyk-cocoapods-plugin": "2.5.2", @@ -67,10 +67,10 @@ "snyk-config": "4.0.0", "snyk-cpp-plugin": "2.20.0", "snyk-docker-plugin": "^5.1.2", - "snyk-go-plugin": "1.19.0", + "snyk-go-plugin": "^1.19.0", "snyk-gradle-plugin": "3.21.1", "snyk-module": "3.1.0", - "snyk-mvn-plugin": "^2.31.0", + "snyk-mvn-plugin": "2.31.0", "snyk-nodejs-lockfile-parser": "1.38.0", "snyk-nuget-plugin": "1.23.5", "snyk-php-plugin": "1.9.2", @@ -2080,50 +2080,15 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@snyk/docker-registry-v2-client": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@snyk/docker-registry-v2-client/-/docker-registry-v2-client-2.7.2.tgz", - "integrity": "sha512-RCqoXVCgbaSJhD4NSSXDSrHppuzvw1dqcBw9BHuWmgrMZ0UYQt0fYbmFVCR5L+qGpyKH9JUwtWpaXewVMYZSRw==", + "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==", "dependencies": { - "needle": "^3.1.0", + "needle": "^2.6.0", "parse-link-header": "^2.0.0", "tslib": "^1.10.0" } }, - "node_modules/@snyk/docker-registry-v2-client/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dependencies": { - "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": "3.1.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-3.1.0.tgz", - "integrity": "sha512-gCE9weDhjVGCRqS8dwDR/D3GTAeyXLXuqp7I8EzH6DllZGXSUyxuqqLh+YX9rMAWaaTFyVAg6rHGL25dqvczKw==", - "dependencies": { - "debug": "^3.2.6", - "iconv-lite": "^0.6.3", - "sax": "^1.2.4" - }, - "bin": { - "needle": "bin/needle" - }, - "engines": { - "node": ">= 4.4.x" - } - }, "node_modules/@snyk/docker-registry-v2-client/node_modules/parse-link-header": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-2.0.0.tgz", @@ -21585,41 +21550,15 @@ } }, "@snyk/docker-registry-v2-client": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@snyk/docker-registry-v2-client/-/docker-registry-v2-client-2.7.2.tgz", - "integrity": "sha512-RCqoXVCgbaSJhD4NSSXDSrHppuzvw1dqcBw9BHuWmgrMZ0UYQt0fYbmFVCR5L+qGpyKH9JUwtWpaXewVMYZSRw==", + "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==", "requires": { - "needle": "^3.1.0", + "needle": "^2.6.0", "parse-link-header": "^2.0.0", "tslib": "^1.10.0" }, "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "requires": { - "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": "3.1.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-3.1.0.tgz", - "integrity": "sha512-gCE9weDhjVGCRqS8dwDR/D3GTAeyXLXuqp7I8EzH6DllZGXSUyxuqqLh+YX9rMAWaaTFyVAg6rHGL25dqvczKw==", - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.6.3", - "sax": "^1.2.4" - } - }, "parse-link-header": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-2.0.0.tgz", diff --git a/package.json b/package.json index 83d40a920f..bf20cab7db 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@snyk/cloud-config-parser": "^1.14.3", "@snyk/code-client": "^4.12.3", "@snyk/dep-graph": "^1.27.1", - "@snyk/docker-registry-v2-client": "^2.7.2", + "@snyk/docker-registry-v2-client": "^2.7.3", "@snyk/fix": "file:packages/snyk-fix", "@snyk/gemfile": "1.2.0", "@snyk/snyk-cocoapods-plugin": "2.5.2", @@ -114,7 +114,7 @@ "snyk-config": "4.0.0", "snyk-cpp-plugin": "2.20.0", "snyk-docker-plugin": "^5.1.2", - "snyk-go-plugin": "1.19.0", + "snyk-go-plugin": "^1.19.0", "snyk-gradle-plugin": "3.21.1", "snyk-module": "3.1.0", "snyk-mvn-plugin": "2.31.0", diff --git a/src/cli/commands/test/iac/v2/index.ts b/src/cli/commands/test/iac/v2/index.ts index 459e1f2d75..99e3e948d1 100644 --- a/src/cli/commands/test/iac/v2/index.ts +++ b/src/cli/commands/test/iac/v2/index.ts @@ -56,6 +56,7 @@ async function prepareTestConfig( const orgSettings = await getIacOrgSettings(org); const projectTags = parseTags(options); const targetName = getFlag(options, 'target-name'); + const remoteRepoUrl = getFlag(options, 'remote-repo-url'); const attributes = parseAttributes(options); @@ -71,6 +72,7 @@ async function prepareTestConfig( projectTags, targetReference: options['target-reference'], targetName, + remoteRepoUrl, }; } diff --git a/src/lib/iac/test/v2/scan/index.ts b/src/lib/iac/test/v2/scan/index.ts index 94917ee4ea..99d47e2282 100644 --- a/src/lib/iac/test/v2/scan/index.ts +++ b/src/lib/iac/test/v2/scan/index.ts @@ -53,6 +53,7 @@ function scanWithConfig( const process = childProcess.spawnSync(policyEnginePath, args, { encoding: 'utf-8', stdio: 'pipe', + maxBuffer: 1024 * 1024 * 10, // The default value is 1024 * 1024, if we see in the future that multiplying it by 10 is not enough we can increase it further. }); debug('policy engine standard error:\n%s', '\n' + process.stderr); @@ -133,6 +134,10 @@ function processFlags( flags.push('-target-name', options.targetName); } + if (options.remoteRepoUrl) { + flags.push('-remote-repo-url', options.remoteRepoUrl); + } + return flags; } diff --git a/src/lib/iac/test/v2/setup/local-cache/policy-engine/constants/utils.ts b/src/lib/iac/test/v2/setup/local-cache/policy-engine/constants/utils.ts index 5e6a3d8aac..9366b2a1af 100644 --- a/src/lib/iac/test/v2/setup/local-cache/policy-engine/constants/utils.ts +++ b/src/lib/iac/test/v2/setup/local-cache/policy-engine/constants/utils.ts @@ -1,11 +1,11 @@ import * as os from 'os'; -const policyEngineChecksums = `0faf6c7d65d46c1d05a729e5bd73a1f5638734a06f363a93f8e1489c75cc23e4 snyk-iac-test_0.20.0_Windows_arm64.exe -2eea4e2cf236feb694701a5fe19c81f04cca3486e354a0593b04982b02790e0e snyk-iac-test_0.20.0_Linux_x86_64 -a7631d19ac3eb2eb62b4381813bfe7b5583311150dd3d8eab512b0d2f24c7f18 snyk-iac-test_0.20.0_Darwin_x86_64 -b266e90dc2f3fb2fb6c7f501b9906532680de245ae7572c6010e0f7168d64a40 snyk-iac-test_0.20.0_Darwin_arm64 -ca351817c3cfacac52cb2e9c138ca9d7a7a748fcdf884029176279cd78a350e9 snyk-iac-test_0.20.0_Linux_arm64 -e30f9277daac37e4f056396a111d0dc15144cb3abb7bced6b7386efa8258516d snyk-iac-test_0.20.0_Windows_x86_64.exe +const policyEngineChecksums = `4f86b8133caa3e27410c853a910a41551a92de3c6402891fc22d8306185a170a snyk-iac-test_0.21.1_Windows_arm64.exe +58b617385dcb1f7da100c1c04e50260d98dbee6811eda9575fc0a41367f9222e snyk-iac-test_0.21.1_Windows_x86_64.exe +6fdd0b0d944bc4986a061d1eec404c6ef5cc7cc5ce4d9a3755b3dd24aa89af57 snyk-iac-test_0.21.1_Darwin_x86_64 +80dc9ab2b4b51df29d4a3edd994a394c1c62d6c1f2d364ce98e1b5365a05f855 snyk-iac-test_0.21.1_Linux_arm64 +b06f169fc03f6e6c3c7047c9270c6b7b20496070122ed3babeedd7e568c98009 snyk-iac-test_0.21.1_Linux_x86_64 +c98a06db1bafa683cc479ecf77e7191eb94ece82dfdf9c229ac7258e73094f10 snyk-iac-test_0.21.1_Darwin_arm64 `; export const policyEngineVersion = getPolicyEngineVersion(); diff --git a/src/lib/iac/test/v2/types.ts b/src/lib/iac/test/v2/types.ts index a24b052cab..1e67341de9 100644 --- a/src/lib/iac/test/v2/types.ts +++ b/src/lib/iac/test/v2/types.ts @@ -15,4 +15,5 @@ export interface TestConfig { projectTags?: Tag[]; targetReference?: string; targetName?: string; + remoteRepoUrl?: string; } diff --git a/test/smoke/spec/snyk_test_spec.sh b/test/smoke/spec/snyk_test_spec.sh index a769c46e56..459a4f24a0 100644 --- a/test/smoke/spec/snyk_test_spec.sh +++ b/test/smoke/spec/snyk_test_spec.sh @@ -104,13 +104,13 @@ Describe "Snyk test command" The stderr should equal "" End - It "fails with a correct user message on a non-existent library" - Skip if "execute only in regression test" check_if_regression_test - When run snyk test lodash --org=nope - The status should be failure - The output should include "Org nope was not found or you may not have the correct permissions" - The stderr should equal "" - End + # It "fails with a correct user message on a non-existent library" + # Skip if "execute only in regression test" check_if_regression_test + # When run snyk test lodash --org=nope + # The status should be failure + # The output should include "Org nope was not found or you may not have the correct permissions" + # The stderr should equal "" + # End End Describe "npm test with JSON output"