snyk 1.1044.0 → 1.1045.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.
@@ -68,6 +68,7 @@ const is_multi_project_scan_1 = __webpack_require__(62435);
68
68
  const ecosystems_1 = __webpack_require__(5168);
69
69
  const monitor_2 = __webpack_require__(62406);
70
70
  const process_command_args_1 = __webpack_require__(52369);
71
+ const feature_flags_1 = __webpack_require__(63011);
71
72
  const SEPARATOR = '\n-------------------------------------------------------\n';
72
73
  const debug = Debug('snyk');
73
74
  const appVulnsReleaseWarningMsg = `${theme.icon.WARNING} Important: Beginning January 24th, 2023, application dependencies in container
@@ -104,13 +105,27 @@ async function monitor(...args0) {
104
105
  // TODO remove 'app-vulns' options and warning message once
105
106
  // https://github.com/snyk/cli/pull/3433 is merged
106
107
  if (options.docker) {
107
- if (!options['app-vulns'] || options['exclude-app-vulns']) {
108
+ // order is important here, we want:
109
+ // 1) exclude-app-vulns set -> no app vulns
110
+ // 2) app-vulns set -> app-vulns
111
+ // 3) neither set -> containerAppVulnsEnabled
112
+ if (options['exclude-app-vulns']) {
108
113
  options['exclude-app-vulns'] = true;
109
114
  }
110
- // we can't print the warning message with JSON output as that would make
111
- // the JSON output invalid.
112
- if (!options['app-vulns'] && !options['json']) {
113
- console.log(theme.color.status.warn(appVulnsReleaseWarningMsg));
115
+ else if (options['app-vulns']) {
116
+ options['exclude-app-vulns'] = false;
117
+ }
118
+ else {
119
+ options['exclude-app-vulns'] = !(await feature_flags_1.hasFeatureFlag('containerCliAppVulnsEnabled', options));
120
+ // we can't print the warning message with JSON output as that would make
121
+ // the JSON output invalid.
122
+ // We also only want to print the message if the user did not overwrite
123
+ // the default with one of the flags.
124
+ if (options['exclude-app-vulns'] &&
125
+ !options['json'] &&
126
+ !options['sarif']) {
127
+ console.log(theme.color.status.warn(appVulnsReleaseWarningMsg));
128
+ }
114
129
  }
115
130
  }
116
131
  // Handles no image arg provided to the container command until