snyk 1.868.0 → 1.869.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/917.index.js +13 -9
- package/dist/cli/917.index.js.map +1 -1
- package/dist/cli/commands/test/iac-local-execution/measurable-methods.d.ts +5 -1
- package/dist/cli/commands/test/iac-local-execution/share-results.d.ts +3 -1
- package/dist/lib/iac/cli-share-results.d.ts +2 -1
- package/dist/lib/iac/envelope-formatters.d.ts +2 -1
- package/package.json +1 -1
package/dist/cli/917.index.js
CHANGED
|
@@ -990,7 +990,6 @@ const feature_flags_1 = __webpack_require__(63011);
|
|
|
990
990
|
const rules_1 = __webpack_require__(98895);
|
|
991
991
|
const file_loader_1 = __webpack_require__(13552);
|
|
992
992
|
const share_results_1 = __webpack_require__(3558);
|
|
993
|
-
const handle_terraform_files_1 = __webpack_require__(41806);
|
|
994
993
|
// this method executes the local processing engine and then formats the results to adapt with the CLI output.
|
|
995
994
|
// this flow is the default GA flow for IAC scanning.
|
|
996
995
|
async function test(pathToScan, options) {
|
|
@@ -1029,7 +1028,7 @@ async function test(pathToScan, options) {
|
|
|
1029
1028
|
// we may have loaded and parsed all but terraform files in the previous step
|
|
1030
1029
|
// so now we check if we need to do a second load and parse which dereferences TF vars
|
|
1031
1030
|
if (validFileTypes && !validFileTypes.includes(types_1.ValidFileType.Terraform)) {
|
|
1032
|
-
const { allParsedFiles, allFailedFiles, } = await
|
|
1031
|
+
const { allParsedFiles, allFailedFiles, } = await measurable_methods_1.loadAndParseTerraformFiles(pathToScan, parsedFiles, failedFiles, options.detectionDepth);
|
|
1033
1032
|
parsedFiles = allParsedFiles;
|
|
1034
1033
|
failedFiles = allFailedFiles;
|
|
1035
1034
|
}
|
|
@@ -1044,7 +1043,7 @@ async function test(pathToScan, options) {
|
|
|
1044
1043
|
const resultsWithCustomSeverities = await measurable_methods_1.applyCustomSeverities(scannedFiles, iacOrgSettings.customPolicies);
|
|
1045
1044
|
let projectPublicIds = {};
|
|
1046
1045
|
if (options.report) {
|
|
1047
|
-
projectPublicIds = await share_results_1.formatAndShareResults(resultsWithCustomSeverities, options, orgPublicId);
|
|
1046
|
+
projectPublicIds = await share_results_1.formatAndShareResults(resultsWithCustomSeverities, options, orgPublicId, policy);
|
|
1048
1047
|
}
|
|
1049
1048
|
const formattedResults = measurable_methods_1.formatScanResults(resultsWithCustomSeverities, options, iacOrgSettings.meta, projectPublicIds);
|
|
1050
1049
|
const { filteredIssues, ignoreCount } = policy_1.filterIgnoredIssues(policy, formattedResults);
|
|
@@ -1289,7 +1288,7 @@ exports.calculatePercentage = (relativeValue, totalValue) => +(totalValue ? (rel
|
|
|
1289
1288
|
"use strict";
|
|
1290
1289
|
|
|
1291
1290
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1292
|
-
exports.pull = exports.localTest = exports.cleanLocalCache = exports.trackUsage = exports.formatScanResults = exports.applyCustomSeverities = exports.getIacOrgSettings = exports.scanFiles = exports.parseFiles = exports.loadFiles = exports.initLocalCache = exports.performanceAnalyticsDecorator = exports.asyncPerformanceAnalyticsDecorator = void 0;
|
|
1291
|
+
exports.loadAndParseTerraformFiles = exports.pull = exports.localTest = exports.cleanLocalCache = exports.trackUsage = exports.formatScanResults = exports.applyCustomSeverities = exports.getIacOrgSettings = exports.scanFiles = exports.parseFiles = exports.loadFiles = exports.initLocalCache = exports.performanceAnalyticsDecorator = exports.asyncPerformanceAnalyticsDecorator = void 0;
|
|
1293
1292
|
const file_loader_1 = __webpack_require__(13552);
|
|
1294
1293
|
const file_parser_1 = __webpack_require__(2314);
|
|
1295
1294
|
const file_scanner_1 = __webpack_require__(16879);
|
|
@@ -1302,6 +1301,7 @@ const index_1 = __webpack_require__(55409);
|
|
|
1302
1301
|
const oci_pull_1 = __webpack_require__(5029);
|
|
1303
1302
|
const analytics_1 = __webpack_require__(22716);
|
|
1304
1303
|
const types_1 = __webpack_require__(42258);
|
|
1304
|
+
const handle_terraform_files_1 = __webpack_require__(41806);
|
|
1305
1305
|
// Note: The return type of the returned async function needs to be Promise<Val> for
|
|
1306
1306
|
// the compiler to be happy, so we need to unwrap it with the messy
|
|
1307
1307
|
// Awaiter<ReturnType<T>> rather than just using ReturnType<T> directly.
|
|
@@ -1347,6 +1347,8 @@ const measurableLocalTest = asyncPerformanceAnalyticsDecorator(index_1.test, typ
|
|
|
1347
1347
|
exports.localTest = measurableLocalTest;
|
|
1348
1348
|
const measurableOciPull = asyncPerformanceAnalyticsDecorator(oci_pull_1.pull, types_1.PerformanceAnalyticsKey.Total);
|
|
1349
1349
|
exports.pull = measurableOciPull;
|
|
1350
|
+
const measurableLoadAndParseTerraformFiles = asyncPerformanceAnalyticsDecorator(handle_terraform_files_1.loadAndParseTerraformFiles, types_1.PerformanceAnalyticsKey.Total);
|
|
1351
|
+
exports.loadAndParseTerraformFiles = measurableLoadAndParseTerraformFiles;
|
|
1350
1352
|
|
|
1351
1353
|
|
|
1352
1354
|
/***/ }),
|
|
@@ -2234,13 +2236,13 @@ const feature_flags_1 = __webpack_require__(63011);
|
|
|
2234
2236
|
const cli_share_results_1 = __webpack_require__(24016);
|
|
2235
2237
|
const assert_iac_options_flag_1 = __webpack_require__(68590);
|
|
2236
2238
|
const share_results_formatter_1 = __webpack_require__(37324);
|
|
2237
|
-
async function formatAndShareResults(results, options, orgPublicId) {
|
|
2239
|
+
async function formatAndShareResults(results, options, orgPublicId, policy) {
|
|
2238
2240
|
const isCliReportEnabled = await feature_flags_1.isFeatureFlagSupportedForOrg('iacCliShareResults', orgPublicId);
|
|
2239
2241
|
if (!isCliReportEnabled.ok) {
|
|
2240
2242
|
throw new assert_iac_options_flag_1.FeatureFlagError('report', 'iacCliShareResults');
|
|
2241
2243
|
}
|
|
2242
2244
|
const formattedResults = share_results_formatter_1.formatShareResults(results, options);
|
|
2243
|
-
return await cli_share_results_1.shareResults(formattedResults);
|
|
2245
|
+
return await cli_share_results_1.shareResults(formattedResults, policy);
|
|
2244
2246
|
}
|
|
2245
2247
|
exports.formatAndShareResults = formatAndShareResults;
|
|
2246
2248
|
|
|
@@ -3343,8 +3345,8 @@ const request_1 = __webpack_require__(52050);
|
|
|
3343
3345
|
const api_token_1 = __webpack_require__(95181);
|
|
3344
3346
|
const envelope_formatters_1 = __webpack_require__(88784);
|
|
3345
3347
|
const authentication_failed_error_1 = __webpack_require__(23770);
|
|
3346
|
-
async function shareResults(results) {
|
|
3347
|
-
const scanResults = results.map(envelope_formatters_1.convertIacResultToScanResult);
|
|
3348
|
+
async function shareResults(results, policy) {
|
|
3349
|
+
const scanResults = results.map((result) => envelope_formatters_1.convertIacResultToScanResult(result, policy));
|
|
3348
3350
|
const { res, body } = await request_1.makeRequest({
|
|
3349
3351
|
method: 'POST',
|
|
3350
3352
|
url: `${config_1.default.API}/iac-cli-share-results`,
|
|
@@ -3371,7 +3373,8 @@ exports.shareResults = shareResults;
|
|
|
3371
3373
|
|
|
3372
3374
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3373
3375
|
exports.convertIacResultToScanResult = void 0;
|
|
3374
|
-
function convertIacResultToScanResult(iacResult) {
|
|
3376
|
+
function convertIacResultToScanResult(iacResult, policy) {
|
|
3377
|
+
var _a;
|
|
3375
3378
|
return {
|
|
3376
3379
|
identity: {
|
|
3377
3380
|
type: iacResult.projectType,
|
|
@@ -3386,6 +3389,7 @@ function convertIacResultToScanResult(iacResult) {
|
|
|
3386
3389
|
}),
|
|
3387
3390
|
name: iacResult.projectName,
|
|
3388
3391
|
target: { name: iacResult.projectName },
|
|
3392
|
+
policy: (_a = policy === null || policy === void 0 ? void 0 : policy.toString()) !== null && _a !== void 0 ? _a : '',
|
|
3389
3393
|
};
|
|
3390
3394
|
}
|
|
3391
3395
|
exports.convertIacResultToScanResult = convertIacResultToScanResult;
|