snyk 1.1109.0 → 1.1110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2279,6 +2279,8 @@ const keys = [
2279
2279
  'detectionDepth',
2280
2280
  'cloud-context',
2281
2281
  'snyk-cloud-environment',
2282
+ 'custom-rules',
2283
+ 'experimental',
2282
2284
  // PolicyOptions
2283
2285
  'ignore-policy',
2284
2286
  'policy-path',
@@ -2385,6 +2387,8 @@ async function prepareTestConfig(paths, options) {
2385
2387
  const cloudContext = index_1.getFlag(options, 'cloud-context');
2386
2388
  const snykCloudEnvironment = index_1.getFlag(options, 'snyk-cloud-environment');
2387
2389
  const insecure = options.insecure;
2390
+ const customRules = options['custom-rules'];
2391
+ const experimental = options.experimental;
2388
2392
  return {
2389
2393
  paths,
2390
2394
  iacCachePath,
@@ -2403,6 +2407,8 @@ async function prepareTestConfig(paths, options) {
2403
2407
  snykCloudEnvironment,
2404
2408
  insecure,
2405
2409
  org,
2410
+ customRules,
2411
+ experimental,
2406
2412
  };
2407
2413
  }
2408
2414
 
@@ -3247,6 +3253,7 @@ function formatSnykIacTestScanVulnerability(vulnerability) {
3247
3253
  impact: vulnerability.rule.description,
3248
3254
  resolve,
3249
3255
  documentation: vulnerability.rule.documentation,
3256
+ isGeneratedByCustomRule: vulnerability.rule.isGeneratedByCustomRule,
3250
3257
  remediation: {
3251
3258
  [constants_1.iacRemediationTypes[vulnerability.resource.kind]]: resolve,
3252
3259
  },
@@ -4564,6 +4571,9 @@ function getErrorUserMessage(code, error) {
4564
4571
  code == types_1.IaCErrorCodes.ResourcesResolverError) {
4565
4572
  return `${error}. Please run the command again with the \`-d\` flag for more information.`;
4566
4573
  }
4574
+ if (code == types_1.IaCErrorCodes.FeatureFlagNotEnabled) {
4575
+ return error;
4576
+ }
4567
4577
  return snykIacTestErrorsUserMessages[errorName];
4568
4578
  }
4569
4579
  exports.getErrorUserMessage = getErrorUserMessage;
@@ -4753,7 +4763,7 @@ function vulnerabilitiesToIacIssues(vulnerabilities) {
4753
4763
  },
4754
4764
  lineNumber: v.resource.line || -1,
4755
4765
  documentation: v.rule.documentation,
4756
- isGeneratedByCustomRule: false,
4766
+ isGeneratedByCustomRule: !!v.rule.isGeneratedByCustomRule,
4757
4767
  path: v.resource.path || [],
4758
4768
  compliance: [],
4759
4769
  description: v.rule.description,
@@ -4851,12 +4861,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
4851
4861
  exports.getChecksum = exports.formatPolicyEngineFileName = exports.policyEngineVersion = void 0;
4852
4862
  const os = __webpack_require__(12087);
4853
4863
  const policyEngineChecksums = `
4854
- 0e505b9284ff31465a50656006a9fbbca943988e3dc1a2860ee0ab3e6b2573bc snyk-iac-test_0.39.0_Windows_arm64.exe
4855
- 566d8587057312ecbe8298ad0acf712904689e332652c43c6bd0a499d677a44c snyk-iac-test_0.39.0_Darwin_arm64
4856
- 7258a935fc08634a47f0c111400664cb9ff176f1cda67131891421f78bce115c snyk-iac-test_0.39.0_Linux_arm64
4857
- b172acbb0a84f40a9917f196e1f7b4d1aa21feddc1b2f1670ed6ef9dc71fb2e4 snyk-iac-test_0.39.0_Linux_x86_64
4858
- c3f38885ba20087ecf20587dd83ebc4f9df27438cd9d9281700cd670877f3144 snyk-iac-test_0.39.0_Windows_x86_64.exe
4859
- e1286f48b4bd297c05a52d256ddc4487d7c10a0e48298a177c43f3825ef83944 snyk-iac-test_0.39.0_Darwin_x86_64
4864
+ 2cc88f4f928d47ec914d6ab40c773ce3efef18a879db1c702df0500e250666fa snyk-iac-test_0.40.3_Darwin_arm64
4865
+ 987a9bb850739c727dff6f47f0daa673489ca2bf0ae87ca253c7a4c66ce81285 snyk-iac-test_0.40.3_Darwin_x86_64
4866
+ ff9e2dfaca90f0efe270cffc843a25252dec266d8ba3307babf70af4d28509e6 snyk-iac-test_0.40.3_Linux_arm64
4867
+ 0b516c5a25aa23950646b314d182236106ea984322837aa17e928dd9f24a0103 snyk-iac-test_0.40.3_Linux_x86_64
4868
+ 505f9371d0a5cc874ae979127b8d5690bd4ddc6c38046dcb43d091ce67c4978e snyk-iac-test_0.40.3_Windows_arm64.exe
4869
+ 62dbb08941b6d520ba68a1ab1aa804b1797133dc4f91560a4762e9510d14292b snyk-iac-test_0.40.3_Windows_x86_64.exe
4860
4870
  `;
4861
4871
  exports.policyEngineVersion = getPolicyEngineVersion();
4862
4872
  function formatPolicyEngineFileName(releaseVersion) {
@@ -5628,6 +5638,14 @@ function processFlags(options, rulesBundlePath, outputPath, policyPath) {
5628
5638
  if (options.org) {
5629
5639
  flags.push('-org', options.org);
5630
5640
  }
5641
+ if (options.customRules) {
5642
+ if (options.experimental) {
5643
+ flags.push('-custom-rules');
5644
+ }
5645
+ else {
5646
+ debug('--custom-rules specified without --experimental. ignoring --custom-rules.');
5647
+ }
5648
+ }
5631
5649
  return flags;
5632
5650
  }
5633
5651
  async function createTemporaryFiles(options) {