snyk 1.892.0 → 1.893.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.
- package/dist/cli/784.index.js +101 -2
- package/dist/cli/784.index.js.map +1 -1
- package/dist/cli/917.index.js +13 -6
- package/dist/cli/917.index.js.map +1 -1
- package/dist/lib/formatters/iac-output/index.d.ts +5 -0
- package/dist/lib/formatters/{iac-output.d.ts → iac-output/v1/index.d.ts} +2 -2
- package/dist/lib/formatters/iac-output/v2/index.d.ts +4 -0
- package/dist/lib/formatters/test/display-result.d.ts +5 -1
- package/package.json +1 -1
package/dist/cli/784.index.js
CHANGED
|
@@ -1690,7 +1690,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1690
1690
|
exports.formatTestMeta = void 0;
|
|
1691
1691
|
const chalk_1 = __webpack_require__(32589);
|
|
1692
1692
|
const right_pad_1 = __webpack_require__(80627);
|
|
1693
|
-
const iac_output_1 = __webpack_require__(
|
|
1693
|
+
const iac_output_1 = __webpack_require__(68145);
|
|
1694
1694
|
function formatTestMeta(res, options) {
|
|
1695
1695
|
const padToLength = 19; // chars to align
|
|
1696
1696
|
const packageManager = res.packageManager || options.packageManager;
|
|
@@ -1794,7 +1794,36 @@ exports.getSeverityValue = getSeverityValue;
|
|
|
1794
1794
|
|
|
1795
1795
|
/***/ }),
|
|
1796
1796
|
|
|
1797
|
-
/***/
|
|
1797
|
+
/***/ 68145:
|
|
1798
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1799
|
+
|
|
1800
|
+
"use strict";
|
|
1801
|
+
|
|
1802
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1803
|
+
exports.getIacDisplayErrorFileOutput = exports.getIacDisplayedOutput = void 0;
|
|
1804
|
+
const v1 = __webpack_require__(7666);
|
|
1805
|
+
const v2 = __webpack_require__(49041);
|
|
1806
|
+
function getIacDisplayedOutput(iacTest, testedInfoText, meta, prefix, isNewIacOutputSupported) {
|
|
1807
|
+
return isNewIacOutputSupported
|
|
1808
|
+
? v2.getIacDisplayedOutput(iacTest, testedInfoText, meta, prefix)
|
|
1809
|
+
: v1.getIacDisplayedOutput(iacTest, testedInfoText, meta, prefix);
|
|
1810
|
+
}
|
|
1811
|
+
exports.getIacDisplayedOutput = getIacDisplayedOutput;
|
|
1812
|
+
function getIacDisplayErrorFileOutput(iacFileResult, isNewIacOutputSupported) {
|
|
1813
|
+
return isNewIacOutputSupported
|
|
1814
|
+
? v2.getIacDisplayErrorFileOutput(iacFileResult)
|
|
1815
|
+
: v1.getIacDisplayErrorFileOutput(iacFileResult);
|
|
1816
|
+
}
|
|
1817
|
+
exports.getIacDisplayErrorFileOutput = getIacDisplayErrorFileOutput;
|
|
1818
|
+
var v1_1 = __webpack_require__(7666);
|
|
1819
|
+
Object.defineProperty(exports, "capitalizePackageManager", ({ enumerable: true, get: function () { return v1_1.capitalizePackageManager; } }));
|
|
1820
|
+
Object.defineProperty(exports, "createSarifOutputForIac", ({ enumerable: true, get: function () { return v1_1.createSarifOutputForIac; } }));
|
|
1821
|
+
Object.defineProperty(exports, "shareResultsOutput", ({ enumerable: true, get: function () { return v1_1.shareResultsOutput; } }));
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
/***/ }),
|
|
1825
|
+
|
|
1826
|
+
/***/ 7666:
|
|
1798
1827
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1799
1828
|
|
|
1800
1829
|
"use strict";
|
|
@@ -2067,6 +2096,76 @@ function shareResultsOutput(iacOutputMeta) {
|
|
|
2067
2096
|
exports.shareResultsOutput = shareResultsOutput;
|
|
2068
2097
|
|
|
2069
2098
|
|
|
2099
|
+
/***/ }),
|
|
2100
|
+
|
|
2101
|
+
/***/ 49041:
|
|
2102
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2103
|
+
|
|
2104
|
+
"use strict";
|
|
2105
|
+
|
|
2106
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2107
|
+
exports.getIacDisplayErrorFileOutput = exports.getIacDisplayedOutput = void 0;
|
|
2108
|
+
const chalk_1 = __webpack_require__(32589);
|
|
2109
|
+
const theme_1 = __webpack_require__(86988);
|
|
2110
|
+
const Debug = __webpack_require__(15158);
|
|
2111
|
+
const pathLib = __webpack_require__(85622);
|
|
2112
|
+
const remediation_based_format_issues_1 = __webpack_require__(57995);
|
|
2113
|
+
const legacy_format_issue_1 = __webpack_require__(63540);
|
|
2114
|
+
const common_1 = __webpack_require__(53110);
|
|
2115
|
+
const get_severity_value_1 = __webpack_require__(24898);
|
|
2116
|
+
const debug = Debug('iac-output');
|
|
2117
|
+
function formatIacIssue(issue, isNew, path) {
|
|
2118
|
+
const newBadge = isNew ? ' (new)' : '';
|
|
2119
|
+
const name = issue.subType ? ` in ${chalk_1.default.bold(issue.subType)}` : '';
|
|
2120
|
+
let introducedBy = '';
|
|
2121
|
+
if (path) {
|
|
2122
|
+
// In this mode, we show only one path by default, for compactness
|
|
2123
|
+
const pathStr = remediation_based_format_issues_1.printPath(path, 0);
|
|
2124
|
+
introducedBy = `\n introduced by ${pathStr}`;
|
|
2125
|
+
}
|
|
2126
|
+
return (common_1.colorTextBySeverity(issue.severity, ` ${theme_1.icon.ISSUE} ${chalk_1.default.bold(issue.title)}${newBadge} [${legacy_format_issue_1.titleCaseText(issue.severity)} Severity]`) +
|
|
2127
|
+
` [${issue.id}]` +
|
|
2128
|
+
name +
|
|
2129
|
+
introducedBy +
|
|
2130
|
+
'\n');
|
|
2131
|
+
}
|
|
2132
|
+
function getIacDisplayedOutput(iacTest, testedInfoText, meta, prefix) {
|
|
2133
|
+
const issuesTextArray = [
|
|
2134
|
+
chalk_1.default.bold.white('\nInfrastructure as code issues:'),
|
|
2135
|
+
];
|
|
2136
|
+
const NotNew = false;
|
|
2137
|
+
const issues = iacTest.result.cloudConfigResults;
|
|
2138
|
+
debug(`iac display output - ${issues.length} issues`);
|
|
2139
|
+
issues
|
|
2140
|
+
.sort((a, b) => get_severity_value_1.getSeverityValue(b.severity) - get_severity_value_1.getSeverityValue(a.severity))
|
|
2141
|
+
.forEach((issue) => {
|
|
2142
|
+
issuesTextArray.push(formatIacIssue(issue, NotNew, issue.cloudConfigPath));
|
|
2143
|
+
});
|
|
2144
|
+
const issuesInfoOutput = [];
|
|
2145
|
+
debug(`Iac display output - ${issuesTextArray.length} issues text`);
|
|
2146
|
+
if (issuesTextArray.length > 0) {
|
|
2147
|
+
issuesInfoOutput.push(issuesTextArray.join('\n'));
|
|
2148
|
+
}
|
|
2149
|
+
let body = issuesInfoOutput.join('\n\n') + '\n\n' + meta;
|
|
2150
|
+
const vulnCountText = `found ${issues.length} issues`;
|
|
2151
|
+
const summary = testedInfoText + ', ' + chalk_1.default.red.bold(vulnCountText);
|
|
2152
|
+
body = body + '\n\n' + summary;
|
|
2153
|
+
return prefix + body;
|
|
2154
|
+
}
|
|
2155
|
+
exports.getIacDisplayedOutput = getIacDisplayedOutput;
|
|
2156
|
+
function getIacDisplayErrorFileOutput(iacFileResult) {
|
|
2157
|
+
const fileName = pathLib.basename(iacFileResult.filePath);
|
|
2158
|
+
return `
|
|
2159
|
+
|
|
2160
|
+
-------------------------------------------------------
|
|
2161
|
+
|
|
2162
|
+
Testing ${fileName}...
|
|
2163
|
+
|
|
2164
|
+
${iacFileResult.failureReason}`;
|
|
2165
|
+
}
|
|
2166
|
+
exports.getIacDisplayErrorFileOutput = getIacDisplayErrorFileOutput;
|
|
2167
|
+
|
|
2168
|
+
|
|
2070
2169
|
/***/ }),
|
|
2071
2170
|
|
|
2072
2171
|
/***/ 81329:
|