snyk 1.791.0 → 1.792.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.
@@ -1964,6 +1964,7 @@ const format_test_error_1 = __webpack_require__(68214);
1964
1964
  const display_result_1 = __webpack_require__(89667);
1965
1965
  const analytics = __webpack_require__(82744);
1966
1966
  const protect_update_notification_1 = __webpack_require__(79304);
1967
+ const spotlight_vuln_notification_1 = __webpack_require__(24083);
1967
1968
  const debug = Debug('snyk-test');
1968
1969
  const SEPARATOR = '\n-------------------------------------------------------\n';
1969
1970
  // TODO: avoid using `as any` whenever it's possible
@@ -2145,6 +2146,10 @@ async function test(...args) {
2145
2146
  }
2146
2147
  }
2147
2148
  response += chalk_1.default.bold.red(summaryMessage);
2149
+ response += os_1.EOL + os_1.EOL;
2150
+ const foundSpotlightVulnIds = spotlight_vuln_notification_1.containsSpotlightVulnIds(results);
2151
+ const spotlightVulnsMsg = spotlight_vuln_notification_1.notificationForSpotlightVulns(foundSpotlightVulnIds);
2152
+ response += spotlightVulnsMsg;
2148
2153
  const error = new Error(response);
2149
2154
  // take the code of the first problem to go through error
2150
2155
  // translation
@@ -3085,6 +3090,73 @@ function mapIacIssue(iacIssue) {
3085
3090
  exports.mapIacIssue = mapIacIssue;
3086
3091
 
3087
3092
 
3093
+ /***/ }),
3094
+
3095
+ /***/ 24083:
3096
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3097
+
3098
+ "use strict";
3099
+
3100
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3101
+ exports.notificationForSpotlightVulns = exports.containsSpotlightVulnIds = void 0;
3102
+ const theme = __webpack_require__(86988);
3103
+ const createDebug = __webpack_require__(15158);
3104
+ const os_1 = __webpack_require__(12087);
3105
+ const debug = createDebug('snyk-spotlight-vuln-notification');
3106
+ const spotlightVulnIds = ['SNYK-JAVA-ORGAPACHELOGGINGLOG4J-2314720'];
3107
+ function containsSpotlightVulnIds(results) {
3108
+ try {
3109
+ const spotlightVulnsFound = new Set();
3110
+ for (const r of results) {
3111
+ if (r.vulnerabilities) {
3112
+ for (const v of r.vulnerabilities) {
3113
+ if (spotlightVulnIds.includes(v.id)) {
3114
+ spotlightVulnsFound.add(v.id);
3115
+ }
3116
+ }
3117
+ }
3118
+ }
3119
+ return [...spotlightVulnsFound];
3120
+ }
3121
+ catch (err) {
3122
+ debug('Error in containsSpotlightVulnIds()', err);
3123
+ return [];
3124
+ }
3125
+ }
3126
+ exports.containsSpotlightVulnIds = containsSpotlightVulnIds;
3127
+ function notificationForSpotlightVulns(foundSpotlightVulnsIds) {
3128
+ try {
3129
+ if (foundSpotlightVulnsIds.length > 0) {
3130
+ let message = '';
3131
+ for (const vulnId of spotlightVulnIds) {
3132
+ if (vulnId === 'SNYK-JAVA-ORGAPACHELOGGINGLOG4J-2314720') {
3133
+ message += theme.color.severity.critical(`${theme.icon.WARNING} WARNING: Critical severity vulnerabilities were found with Log4j!` +
3134
+ os_1.EOL);
3135
+ for (const vulnId of foundSpotlightVulnsIds) {
3136
+ message += ` - ${vulnId} (See https://snyk.io/vuln/${vulnId})`;
3137
+ }
3138
+ message += os_1.EOL + os_1.EOL;
3139
+ message +=
3140
+ theme.color.severity.critical(`We highly recommend fixing this vulnerability. If it cannot be fixed by upgrading, see mitigation information here:`) +
3141
+ os_1.EOL +
3142
+ ' - https://security.snyk.io/vuln/SNYK-JAVA-ORGAPACHELOGGINGLOG4J-2314720' +
3143
+ os_1.EOL +
3144
+ ' - https://snyk.io/blog/log4shell-remediation-cheat-sheet/' +
3145
+ os_1.EOL;
3146
+ }
3147
+ }
3148
+ return message;
3149
+ }
3150
+ return '';
3151
+ }
3152
+ catch (err) {
3153
+ debug('Error in notificationForSpotlightVulns()', err);
3154
+ return '';
3155
+ }
3156
+ }
3157
+ exports.notificationForSpotlightVulns = notificationForSpotlightVulns;
3158
+
3159
+
3088
3160
  /***/ }),
3089
3161
 
3090
3162
  /***/ 14784: