@contrast/contrast 2.0.2-beta.0 → 2.0.2-beta.10
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/README.md +2 -1
- package/dist/assess/assessConfig.js +9 -0
- package/dist/assess/assessConfig.js.map +1 -0
- package/dist/assess/help.js +37 -0
- package/dist/assess/help.js.map +1 -0
- package/dist/assess/http/index.js +39 -0
- package/dist/assess/http/index.js.map +1 -0
- package/dist/assess/index.js +69 -0
- package/dist/assess/index.js.map +1 -0
- package/dist/assess/metadata/findYamlFile.js +59 -0
- package/dist/assess/metadata/findYamlFile.js.map +1 -0
- package/dist/assess/metadata/index.js +37 -0
- package/dist/assess/metadata/index.js.map +1 -0
- package/dist/assess/metadata/utils.js +159 -0
- package/dist/assess/metadata/utils.js.map +1 -0
- package/dist/assess/printing/index.js +11 -0
- package/dist/assess/printing/index.js.map +1 -0
- package/dist/assess/printing/utils.js +119 -0
- package/dist/assess/printing/utils.js.map +1 -0
- package/dist/audit/auditConfig.js +9 -0
- package/dist/audit/auditConfig.js.map +1 -0
- package/dist/{commands/audit → audit}/auditController.js +9 -13
- package/dist/audit/auditController.js.map +1 -0
- package/dist/audit/auditRequests.js +193 -0
- package/dist/audit/auditRequests.js.map +1 -0
- package/dist/audit/auditRequestsLegacy.js +63 -0
- package/dist/audit/auditRequestsLegacy.js.map +1 -0
- package/dist/audit/catalogueApplication/catalogueApplication.js +16 -29
- package/dist/audit/catalogueApplication/catalogueApplication.js.map +1 -0
- package/dist/audit/help.js +68 -0
- package/dist/audit/help.js.map +1 -0
- package/dist/audit/languageAnalysisEngine/commonApi.js +12 -14
- package/dist/audit/languageAnalysisEngine/commonApi.js.map +1 -0
- package/dist/audit/languageAnalysisEngine/filterProjectPath.js +2 -1
- package/dist/audit/languageAnalysisEngine/filterProjectPath.js.map +1 -0
- package/dist/audit/languageAnalysisEngine/getProjectRootFilenames.js +9 -12
- package/dist/audit/languageAnalysisEngine/getProjectRootFilenames.js.map +1 -0
- package/dist/audit/languageAnalysisEngine/sendSnapshot.js +18 -30
- package/dist/audit/languageAnalysisEngine/sendSnapshot.js.map +1 -0
- package/dist/audit/nodeAnalysisEngine/parseYarn2LockFileContents.js +9 -9
- package/dist/audit/nodeAnalysisEngine/parseYarn2LockFileContents.js.map +1 -0
- package/dist/audit/processAudit.js +21 -0
- package/dist/audit/processAudit.js.map +1 -0
- package/dist/audit/report/commonReportingFunctions.js +33 -61
- package/dist/audit/report/commonReportingFunctions.js.map +1 -0
- package/dist/audit/report/models/reportGuidanceModel.js +2 -5
- package/dist/audit/report/models/reportGuidanceModel.js.map +1 -0
- package/dist/audit/report/models/reportLibraryModel.js +3 -7
- package/dist/audit/report/models/reportLibraryModel.js.map +1 -0
- package/dist/audit/report/models/reportListModel.js +4 -9
- package/dist/audit/report/models/reportListModel.js.map +1 -0
- package/dist/audit/report/models/reportOutputModel.js +4 -9
- package/dist/audit/report/models/reportOutputModel.js.map +1 -0
- package/dist/audit/report/models/reportSeverityModel.js +2 -5
- package/dist/audit/report/models/reportSeverityModel.js.map +1 -0
- package/dist/audit/report/models/severityCountModel.js +3 -5
- package/dist/audit/report/models/severityCountModel.js.map +1 -0
- package/dist/audit/report/reportingFeature.js +27 -55
- package/dist/audit/report/reportingFeature.js.map +1 -0
- package/dist/audit/report/utils/reportUtils.js +28 -59
- package/dist/audit/report/utils/reportUtils.js.map +1 -0
- package/dist/audit/save.js +14 -16
- package/dist/audit/save.js.map +1 -0
- package/dist/{commands/audit → audit}/saveFile.js +3 -6
- package/dist/audit/saveFile.js.map +1 -0
- package/dist/auth/auth.js +103 -0
- package/dist/auth/auth.js.map +1 -0
- package/dist/auth/authRequests.js +18 -0
- package/dist/auth/authRequests.js.map +1 -0
- package/dist/cliConstants.js +48 -18
- package/dist/cliConstants.js.map +1 -0
- package/dist/commands/config/config.js +12 -13
- package/dist/commands/config/config.js.map +1 -0
- package/dist/commands/learn/learn.js +3 -6
- package/dist/commands/learn/learn.js.map +1 -0
- package/dist/commands/learn/processLearn.js +3 -6
- package/dist/commands/learn/processLearn.js.map +1 -0
- package/dist/common/HTTPClient.js +193 -94
- package/dist/common/HTTPClient.js.map +1 -0
- package/dist/{scan → common}/autoDetection.js +53 -36
- package/dist/common/autoDetection.js.map +1 -0
- package/dist/common/baseRequest.js +59 -23
- package/dist/common/baseRequest.js.map +1 -0
- package/dist/common/commonHelp.js +13 -13
- package/dist/common/commonHelp.js.map +1 -0
- package/dist/common/errorHandling.js +49 -63
- package/dist/common/errorHandling.js.map +1 -0
- package/dist/common/fail.js +6 -12
- package/dist/common/fail.js.map +1 -0
- package/dist/common/stringManipulations.js +8 -0
- package/dist/common/stringManipulations.js.map +1 -0
- package/dist/common/versionChecker.js +16 -19
- package/dist/common/versionChecker.js.map +1 -0
- package/dist/constants/constants.js +46 -65
- package/dist/constants/constants.js.map +1 -0
- package/dist/constants/lambda.js +8 -5
- package/dist/constants/lambda.js.map +1 -0
- package/dist/constants/locales.js +14 -10
- package/dist/constants/locales.js.map +1 -0
- package/dist/github/fingerprintConfig.js +10 -0
- package/dist/github/fingerprintConfig.js.map +1 -0
- package/dist/github/processFingerprint.js +25 -0
- package/dist/github/processFingerprint.js.map +1 -0
- package/dist/github/projectGroup.js +225 -0
- package/dist/github/projectGroup.js.map +1 -0
- package/dist/github/repoServices.js +91 -0
- package/dist/github/repoServices.js.map +1 -0
- package/dist/index.js +42 -39
- package/dist/index.js.map +1 -0
- package/dist/lambda/analytics.js +6 -9
- package/dist/lambda/analytics.js.map +1 -0
- package/dist/lambda/arn.js +6 -9
- package/dist/lambda/arn.js.map +1 -0
- package/dist/lambda/aws.js +29 -34
- package/dist/lambda/aws.js.map +1 -0
- package/dist/lambda/cliError.js +13 -41
- package/dist/lambda/cliError.js.map +1 -0
- package/dist/lambda/constants.js +3 -4
- package/dist/lambda/constants.js.map +1 -0
- package/dist/lambda/help.js +39 -44
- package/dist/lambda/help.js.map +1 -0
- package/dist/lambda/lambda.js +61 -65
- package/dist/lambda/lambda.js.map +1 -0
- package/dist/lambda/lambdaUtils.js +38 -32
- package/dist/lambda/lambdaUtils.js.map +1 -0
- package/dist/lambda/logUtils.js +21 -17
- package/dist/lambda/logUtils.js.map +1 -0
- package/dist/lambda/scanDetailCompletion.js +19 -25
- package/dist/lambda/scanDetailCompletion.js.map +1 -0
- package/dist/lambda/scanRequest.js +34 -41
- package/dist/lambda/scanRequest.js.map +1 -0
- package/dist/lambda/scanResults.js +8 -10
- package/dist/lambda/scanResults.js.map +1 -0
- package/dist/lambda/types.js +5 -7
- package/dist/lambda/types.js.map +1 -0
- package/dist/lambda/utils.js +33 -35
- package/dist/lambda/utils.js.map +1 -0
- package/dist/sbom/generateSbom.js +6 -10
- package/dist/sbom/generateSbom.js.map +1 -0
- package/dist/scaAnalysis/common/auditReport.js +8 -12
- package/dist/scaAnalysis/common/auditReport.js.map +1 -0
- package/dist/scaAnalysis/common/commonReportingFunctionsSca.js +26 -32
- package/dist/scaAnalysis/common/commonReportingFunctionsSca.js.map +1 -0
- package/dist/scaAnalysis/common/formatMessage.js +8 -17
- package/dist/scaAnalysis/common/formatMessage.js.map +1 -0
- package/dist/scaAnalysis/common/models/ScaReportModel.js +4 -9
- package/dist/scaAnalysis/common/models/ScaReportModel.js.map +1 -0
- package/dist/scaAnalysis/common/scaParserForGoAndJava.js +10 -9
- package/dist/scaAnalysis/common/scaParserForGoAndJava.js.map +1 -0
- package/dist/scaAnalysis/common/scaServicesUpload.js +59 -90
- package/dist/scaAnalysis/common/scaServicesUpload.js.map +1 -0
- package/dist/scaAnalysis/common/treeUpload.js +15 -25
- package/dist/scaAnalysis/common/treeUpload.js.map +1 -0
- package/dist/scaAnalysis/common/utils/reportUtilsSca.js +21 -29
- package/dist/scaAnalysis/common/utils/reportUtilsSca.js.map +1 -0
- package/dist/scaAnalysis/dotnet/analysis.js +12 -18
- package/dist/scaAnalysis/dotnet/analysis.js.map +1 -0
- package/dist/scaAnalysis/dotnet/index.js +4 -7
- package/dist/scaAnalysis/dotnet/index.js.map +1 -0
- package/dist/scaAnalysis/go/goAnalysis.js +8 -11
- package/dist/scaAnalysis/go/goAnalysis.js.map +1 -0
- package/dist/scaAnalysis/go/goParseDeps.js +9 -7
- package/dist/scaAnalysis/go/goParseDeps.js.map +1 -0
- package/dist/scaAnalysis/go/goReadDepFile.js +10 -8
- package/dist/scaAnalysis/go/goReadDepFile.js.map +1 -0
- package/dist/scaAnalysis/java/analysis.js +23 -20
- package/dist/scaAnalysis/java/analysis.js.map +1 -0
- package/dist/scaAnalysis/java/index.js +7 -10
- package/dist/scaAnalysis/java/index.js.map +1 -0
- package/dist/scaAnalysis/java/javaBuildDepsParser.js +43 -43
- package/dist/scaAnalysis/java/javaBuildDepsParser.js.map +1 -0
- package/dist/scaAnalysis/javascript/analysis.js +16 -20
- package/dist/scaAnalysis/javascript/analysis.js.map +1 -0
- package/dist/scaAnalysis/javascript/index.js +17 -19
- package/dist/scaAnalysis/javascript/index.js.map +1 -0
- package/dist/scaAnalysis/javascript/scaServiceParser.js +8 -15
- package/dist/scaAnalysis/javascript/scaServiceParser.js.map +1 -0
- package/dist/scaAnalysis/legacy/legacyFlow.js +13 -15
- package/dist/scaAnalysis/legacy/legacyFlow.js.map +1 -0
- package/dist/scaAnalysis/php/analysis.js +15 -16
- package/dist/scaAnalysis/php/analysis.js.map +1 -0
- package/dist/scaAnalysis/php/index.js +5 -8
- package/dist/scaAnalysis/php/index.js.map +1 -0
- package/dist/scaAnalysis/php/phpNewServicesMapper.js +9 -12
- package/dist/scaAnalysis/php/phpNewServicesMapper.js.map +1 -0
- package/dist/scaAnalysis/processServicesFlow.js +86 -32
- package/dist/scaAnalysis/processServicesFlow.js.map +1 -0
- package/dist/scaAnalysis/python/analysis.js +16 -23
- package/dist/scaAnalysis/python/analysis.js.map +1 -0
- package/dist/scaAnalysis/python/index.js +4 -7
- package/dist/scaAnalysis/python/index.js.map +1 -0
- package/dist/scaAnalysis/repoMode/gradleParser.js +7 -13
- package/dist/scaAnalysis/repoMode/gradleParser.js.map +1 -0
- package/dist/scaAnalysis/repoMode/index.js +9 -12
- package/dist/scaAnalysis/repoMode/index.js.map +1 -0
- package/dist/scaAnalysis/repoMode/mavenParser.js +109 -73
- package/dist/scaAnalysis/repoMode/mavenParser.js.map +1 -0
- package/dist/scaAnalysis/ruby/analysis.js +32 -46
- package/dist/scaAnalysis/ruby/analysis.js.map +1 -0
- package/dist/scaAnalysis/ruby/index.js +5 -8
- package/dist/scaAnalysis/ruby/index.js.map +1 -0
- package/dist/scaAnalysis/scaAnalysis.js +49 -51
- package/dist/scaAnalysis/scaAnalysis.js.map +1 -0
- package/dist/scan/fileUtils.js +36 -40
- package/dist/scan/fileUtils.js.map +1 -0
- package/dist/scan/formatScanOutput.js +47 -61
- package/dist/scan/formatScanOutput.js.map +1 -0
- package/dist/scan/help.js +8 -11
- package/dist/scan/help.js.map +1 -0
- package/dist/scan/models/groupedResultsModel.js +2 -5
- package/dist/scan/models/groupedResultsModel.js.map +1 -0
- package/dist/scan/models/resultContentModel.js +2 -2
- package/dist/scan/models/resultContentModel.js.map +1 -0
- package/dist/scan/models/scanResultsModel.js +2 -5
- package/dist/scan/models/scanResultsModel.js.map +1 -0
- package/dist/scan/populateProjectIdAndProjectName.js +22 -60
- package/dist/scan/populateProjectIdAndProjectName.js.map +1 -0
- package/dist/scan/processScan.js +28 -0
- package/dist/scan/processScan.js.map +1 -0
- package/dist/scan/saveResults.js +3 -6
- package/dist/scan/saveResults.js.map +1 -0
- package/dist/scan/scan.js +33 -53
- package/dist/scan/scan.js.map +1 -0
- package/dist/scan/scanConfig.js +14 -12
- package/dist/scan/scanConfig.js.map +1 -0
- package/dist/scan/scanController.js +19 -21
- package/dist/scan/scanController.js.map +1 -0
- package/dist/scan/scanRequests.js +86 -0
- package/dist/scan/scanRequests.js.map +1 -0
- package/dist/scan/scanResults.js +26 -72
- package/dist/scan/scanResults.js.map +1 -0
- package/dist/telemetry/telemetry.js +29 -59
- package/dist/telemetry/telemetry.js.map +1 -0
- package/dist/utils/capabilities.js +2 -1
- package/dist/utils/capabilities.js.map +1 -0
- package/dist/utils/commonApi.js +58 -50
- package/dist/utils/commonApi.js.map +1 -0
- package/dist/utils/filterProjectPath.js +2 -1
- package/dist/utils/filterProjectPath.js.map +1 -0
- package/dist/utils/generalAPI.js +11 -33
- package/dist/utils/generalAPI.js.map +1 -0
- package/dist/utils/getConfig.js +8 -13
- package/dist/utils/getConfig.js.map +1 -0
- package/dist/utils/oraWrapper.js +7 -14
- package/dist/utils/oraWrapper.js.map +1 -0
- package/dist/utils/paramsUtil/commandlineParams.js +2 -5
- package/dist/utils/paramsUtil/commandlineParams.js.map +1 -0
- package/dist/utils/paramsUtil/configStoreParams.js +9 -10
- package/dist/utils/paramsUtil/configStoreParams.js.map +1 -0
- package/dist/utils/paramsUtil/envVariableParams.js +2 -3
- package/dist/utils/paramsUtil/envVariableParams.js.map +1 -0
- package/dist/utils/paramsUtil/paramHandler.js +12 -13
- package/dist/utils/paramsUtil/paramHandler.js.map +1 -0
- package/dist/utils/parsedCLIOptions.js +4 -7
- package/dist/utils/parsedCLIOptions.js.map +1 -0
- package/dist/utils/requestUtils.js +7 -13
- package/dist/utils/requestUtils.js.map +1 -0
- package/dist/utils/saveFile.js +8 -11
- package/dist/utils/saveFile.js.map +1 -0
- package/dist/utils/validationCheck.js +5 -11
- package/dist/utils/validationCheck.js.map +1 -0
- package/package.json +40 -48
- package/.prettierignore +0 -1
- package/bin/contrast.js +0 -2
- package/dist/audit/languageAnalysisEngine/util/requestUtils.js +0 -14
- package/dist/commands/audit/auditConfig.js +0 -12
- package/dist/commands/audit/help.js +0 -70
- package/dist/commands/audit/processAudit.js +0 -24
- package/dist/commands/auth/auth.js +0 -120
- package/dist/commands/github/fingerprintConfig.js +0 -13
- package/dist/commands/github/processFingerprint.js +0 -28
- package/dist/commands/github/projectGroup.js +0 -254
- package/dist/commands/github/repoServices.js +0 -108
- package/dist/commands/scan/processScan.js +0 -31
- package/dist/lambda/__mocks__/aws.js +0 -21
- package/dist/lambda/__mocks__/lambdaConfig.json +0 -42
- package/src/audit/catalogueApplication/catalogueApplication.js +0 -51
- package/src/audit/languageAnalysisEngine/commonApi.js +0 -20
- package/src/audit/languageAnalysisEngine/filterProjectPath.js +0 -21
- package/src/audit/languageAnalysisEngine/getProjectRootFilenames.js +0 -36
- package/src/audit/languageAnalysisEngine/sendSnapshot.js +0 -57
- package/src/audit/languageAnalysisEngine/util/requestUtils.js +0 -17
- package/src/audit/nodeAnalysisEngine/parseYarn2LockFileContents.js +0 -63
- package/src/audit/report/commonReportingFunctions.js +0 -412
- package/src/audit/report/models/reportGuidanceModel.ts +0 -5
- package/src/audit/report/models/reportLibraryModel.ts +0 -30
- package/src/audit/report/models/reportListModel.ts +0 -49
- package/src/audit/report/models/reportOutputModel.ts +0 -29
- package/src/audit/report/models/reportSeverityModel.ts +0 -18
- package/src/audit/report/models/severityCountModel.ts +0 -22
- package/src/audit/report/reportingFeature.ts +0 -110
- package/src/audit/report/utils/reportUtils.ts +0 -165
- package/src/audit/save.js +0 -67
- package/src/cliConstants.js +0 -522
- package/src/commands/audit/auditConfig.js +0 -18
- package/src/commands/audit/auditController.js +0 -50
- package/src/commands/audit/help.js +0 -72
- package/src/commands/audit/processAudit.js +0 -34
- package/src/commands/audit/saveFile.js +0 -15
- package/src/commands/auth/auth.js +0 -146
- package/src/commands/config/config.js +0 -41
- package/src/commands/github/fingerprintConfig.js +0 -19
- package/src/commands/github/processFingerprint.js +0 -37
- package/src/commands/github/projectGroup.js +0 -294
- package/src/commands/github/repoServices.js +0 -122
- package/src/commands/learn/learn.js +0 -10
- package/src/commands/learn/processLearn.js +0 -13
- package/src/commands/scan/processScan.js +0 -42
- package/src/common/HTTPClient.js +0 -775
- package/src/common/baseRequest.ts +0 -83
- package/src/common/commonHelp.js +0 -53
- package/src/common/errorHandling.js +0 -157
- package/src/common/fail.js +0 -79
- package/src/common/versionChecker.js +0 -75
- package/src/constants/constants.js +0 -71
- package/src/constants/lambda.js +0 -85
- package/src/constants/locales.js +0 -365
- package/src/index.ts +0 -142
- package/src/lambda/__mocks__/aws.ts +0 -32
- package/src/lambda/__mocks__/lambdaConfig.json +0 -42
- package/src/lambda/analytics.ts +0 -9
- package/src/lambda/arn.ts +0 -33
- package/src/lambda/aws.ts +0 -248
- package/src/lambda/cliError.ts +0 -72
- package/src/lambda/constants.ts +0 -11
- package/src/lambda/help.ts +0 -92
- package/src/lambda/lambda.ts +0 -230
- package/src/lambda/lambdaUtils.ts +0 -111
- package/src/lambda/logUtils.ts +0 -64
- package/src/lambda/scanDetailCompletion.ts +0 -78
- package/src/lambda/scanRequest.ts +0 -169
- package/src/lambda/scanResults.ts +0 -29
- package/src/lambda/types.ts +0 -36
- package/src/lambda/utils.ts +0 -188
- package/src/sbom/generateSbom.ts +0 -45
- package/src/scaAnalysis/common/auditReport.js +0 -59
- package/src/scaAnalysis/common/commonReportingFunctionsSca.js +0 -276
- package/src/scaAnalysis/common/formatMessage.js +0 -67
- package/src/scaAnalysis/common/models/ScaReportModel.ts +0 -81
- package/src/scaAnalysis/common/scaParserForGoAndJava.js +0 -41
- package/src/scaAnalysis/common/scaServicesUpload.js +0 -155
- package/src/scaAnalysis/common/treeUpload.js +0 -51
- package/src/scaAnalysis/common/utils/reportUtilsSca.ts +0 -123
- package/src/scaAnalysis/dotnet/analysis.js +0 -72
- package/src/scaAnalysis/dotnet/index.js +0 -11
- package/src/scaAnalysis/go/goAnalysis.js +0 -26
- package/src/scaAnalysis/go/goParseDeps.js +0 -203
- package/src/scaAnalysis/go/goReadDepFile.js +0 -34
- package/src/scaAnalysis/java/analysis.js +0 -148
- package/src/scaAnalysis/java/index.js +0 -29
- package/src/scaAnalysis/java/javaBuildDepsParser.js +0 -439
- package/src/scaAnalysis/javascript/analysis.js +0 -111
- package/src/scaAnalysis/javascript/index.js +0 -104
- package/src/scaAnalysis/javascript/scaServiceParser.js +0 -151
- package/src/scaAnalysis/legacy/legacyFlow.js +0 -43
- package/src/scaAnalysis/php/analysis.js +0 -78
- package/src/scaAnalysis/php/index.js +0 -28
- package/src/scaAnalysis/php/phpNewServicesMapper.js +0 -77
- package/src/scaAnalysis/processServicesFlow.js +0 -119
- package/src/scaAnalysis/python/analysis.js +0 -93
- package/src/scaAnalysis/python/index.js +0 -16
- package/src/scaAnalysis/repoMode/gradleParser.js +0 -88
- package/src/scaAnalysis/repoMode/index.js +0 -21
- package/src/scaAnalysis/repoMode/mavenParser.js +0 -112
- package/src/scaAnalysis/ruby/analysis.js +0 -413
- package/src/scaAnalysis/ruby/index.js +0 -16
- package/src/scaAnalysis/scaAnalysis.js +0 -171
- package/src/scan/autoDetection.js +0 -175
- package/src/scan/fileUtils.js +0 -206
- package/src/scan/formatScanOutput.ts +0 -225
- package/src/scan/help.js +0 -56
- package/src/scan/models/groupedResultsModel.ts +0 -20
- package/src/scan/models/resultContentModel.ts +0 -86
- package/src/scan/models/scanResultsModel.ts +0 -55
- package/src/scan/populateProjectIdAndProjectName.js +0 -73
- package/src/scan/saveResults.js +0 -14
- package/src/scan/scan.ts +0 -68
- package/src/scan/scanConfig.js +0 -58
- package/src/scan/scanController.js +0 -98
- package/src/scan/scanResults.js +0 -171
- package/src/telemetry/telemetry.ts +0 -154
- package/src/utils/capabilities.js +0 -12
- package/src/utils/commonApi.js +0 -103
- package/src/utils/filterProjectPath.js +0 -25
- package/src/utils/generalAPI.js +0 -52
- package/src/utils/getConfig.ts +0 -34
- package/src/utils/oraWrapper.js +0 -29
- package/src/utils/paramsUtil/commandlineParams.js +0 -12
- package/src/utils/paramsUtil/configStoreParams.js +0 -19
- package/src/utils/paramsUtil/envVariableParams.js +0 -10
- package/src/utils/paramsUtil/paramHandler.js +0 -38
- package/src/utils/parsedCLIOptions.js +0 -32
- package/src/utils/requestUtils.js +0 -29
- package/src/utils/saveFile.js +0 -20
- package/src/utils/validationCheck.js +0 -39
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { HttpsProxyAgent } from 'hpagent'
|
|
2
|
-
import fs from 'fs'
|
|
3
|
-
import got, { Options } from 'got'
|
|
4
|
-
import { Agents, HTTPSOptions } from 'got/dist/source/core'
|
|
5
|
-
|
|
6
|
-
export function gotInstance(config: any) {
|
|
7
|
-
return got.extend({ retry: { limit: 0 }, ...buildBaseRequestOptions(config) })
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function buildBaseRequestOptions(config: any) {
|
|
11
|
-
const { apiKey, authorization } = config
|
|
12
|
-
const rejectUnauthorized = !config.certSelfSigned
|
|
13
|
-
|
|
14
|
-
const superApiKey = config.superApiKey
|
|
15
|
-
const superAuthToken = config.superAuthorization
|
|
16
|
-
|
|
17
|
-
const requestOptions = {
|
|
18
|
-
responseType: 'json',
|
|
19
|
-
forever: true,
|
|
20
|
-
uri: config.host,
|
|
21
|
-
followRedirect: false,
|
|
22
|
-
headers: {
|
|
23
|
-
'Content-Type': 'application/json; charset=utf-8',
|
|
24
|
-
Authorization: authorization,
|
|
25
|
-
'API-Key': apiKey,
|
|
26
|
-
SuperAuthorization: superAuthToken,
|
|
27
|
-
'Super-API-Key': superApiKey,
|
|
28
|
-
'User-Agent': 'contrast-cli-v2'
|
|
29
|
-
},
|
|
30
|
-
agent: getAgent(config)
|
|
31
|
-
} as Options
|
|
32
|
-
|
|
33
|
-
requestOptions.https = {
|
|
34
|
-
rejectUnauthorized: rejectUnauthorized
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
maybeAddCertsToRequest(config, requestOptions.https)
|
|
38
|
-
return requestOptions
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function getAgent(config: any) {
|
|
42
|
-
return config.proxy
|
|
43
|
-
? (new HttpsProxyAgent({ proxy: config.proxy }) as Agents)
|
|
44
|
-
: false
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function maybeAddCertsToRequest(config: any, https: HTTPSOptions) {
|
|
48
|
-
// cacert
|
|
49
|
-
const caCertFilePath = config.cacert
|
|
50
|
-
if (caCertFilePath) {
|
|
51
|
-
try {
|
|
52
|
-
https.certificateAuthority = fs.readFileSync(caCertFilePath)
|
|
53
|
-
} catch (error: any) {
|
|
54
|
-
throw new Error(
|
|
55
|
-
`Unable to read CA from ${caCertFilePath}, msg: ${error.message}`
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// cert
|
|
61
|
-
const certPath = config.cert
|
|
62
|
-
if (certPath) {
|
|
63
|
-
try {
|
|
64
|
-
https.certificate = fs.readFileSync(certPath)
|
|
65
|
-
} catch (error: any) {
|
|
66
|
-
throw new Error(
|
|
67
|
-
`Unable to read Certificate PEM file from config option contrast.api.certificate.cert_file='${certPath}', msg: ${error.message}`
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// key
|
|
73
|
-
const keyPath = config.key
|
|
74
|
-
if (keyPath) {
|
|
75
|
-
try {
|
|
76
|
-
https.key = fs.readFileSync(keyPath)
|
|
77
|
-
} catch (error: any) {
|
|
78
|
-
throw new Error(
|
|
79
|
-
`Unable to read Key PEM file from config option contrast.api.certificate.key_file='${keyPath}', msg: ${error.message}`
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
package/src/common/commonHelp.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const i18n = require('i18n')
|
|
2
|
-
const chalk = require('chalk')
|
|
3
|
-
|
|
4
|
-
const commonHelpLinks = () => {
|
|
5
|
-
return [
|
|
6
|
-
{
|
|
7
|
-
header: i18n.__('commonHelpHeader'),
|
|
8
|
-
content: [
|
|
9
|
-
i18n.__('commonHelpCheckOutHeader') + i18n.__('commonHelpCheckOutText'),
|
|
10
|
-
i18n.__('commonHelpLearnMoreHeader') +
|
|
11
|
-
i18n.__('commonHelpLearnMoreText'),
|
|
12
|
-
i18n.__('commonHelpJoinDiscussionHeader') +
|
|
13
|
-
i18n.__('commonHelpJoinDiscussionText')
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
header: i18n.__('commonHelpEnterpriseHeader'),
|
|
18
|
-
content: [
|
|
19
|
-
i18n.__('commonHelpLearnMoreEnterpriseHeader') +
|
|
20
|
-
i18n.__('commonHelpLearnMoreEnterpriseText')
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
content: [
|
|
25
|
-
i18n.__('commonHelpLearnHeader') + i18n.__('commonHelpLearnText')
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const postRunMessage = commandName => {
|
|
32
|
-
console.log('\n' + chalk.underline.bold('Other Features:'))
|
|
33
|
-
if (commandName !== 'scan')
|
|
34
|
-
console.log(
|
|
35
|
-
"'contrast scan' to run Contrast's industry leading SAST scanner"
|
|
36
|
-
)
|
|
37
|
-
if (commandName !== 'audit')
|
|
38
|
-
console.log(
|
|
39
|
-
"'contrast audit' to find vulnerabilities in your open source dependencies"
|
|
40
|
-
)
|
|
41
|
-
if (commandName !== 'lambda')
|
|
42
|
-
console.log("'contrast lambda' to secure your AWS serverless functions")
|
|
43
|
-
|
|
44
|
-
if (commandName !== 'learn')
|
|
45
|
-
console.log(
|
|
46
|
-
"'contrast learn' launches Contrast's Secure Code Learning Hub."
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
module.exports = {
|
|
51
|
-
commonHelpLinks,
|
|
52
|
-
postRunMessage
|
|
53
|
-
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
const i18n = require('i18n')
|
|
2
|
-
const chalk = require('chalk')
|
|
3
|
-
|
|
4
|
-
const libraryAnalysisError = () => {
|
|
5
|
-
console.log(i18n.__('libraryAnalysisError'))
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const snapshotFailureError = () => {
|
|
9
|
-
console.log(i18n.__('snapshotFailureMessage'))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const vulnerabilitiesFailureError = () => {
|
|
13
|
-
console.log(i18n.__('vulnerabilitiesFailureMessage'))
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const reportFailureError = () => {
|
|
17
|
-
console.log(i18n.__('auditReportFailureMessage'))
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const genericError = () => {
|
|
21
|
-
console.error(i18n.__('genericErrorMessage'))
|
|
22
|
-
process.exit(1)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const unauthenticatedError = () => {
|
|
26
|
-
generalError('unauthenticatedErrorHeader', 'unauthenticatedErrorMessage')
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const badRequestError = catalogue => {
|
|
30
|
-
catalogue === true
|
|
31
|
-
? generalError('badRequestErrorHeader', 'badRequestCatalogueErrorMessage')
|
|
32
|
-
: generalError('badRequestErrorHeader', 'badRequestErrorMessage')
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const forbiddenError = () => {
|
|
36
|
-
generalError('forbiddenRequestErrorHeader', 'forbiddenRequestErrorMessage')
|
|
37
|
-
process.exit(1)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const proxyError = () => {
|
|
41
|
-
generalError('proxyErrorHeader', 'proxyErrorMessage')
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const maxAppError = () => {
|
|
45
|
-
generalError(
|
|
46
|
-
'No applications remaining',
|
|
47
|
-
'You have reached the maximum number of application you can create.'
|
|
48
|
-
)
|
|
49
|
-
process.exit(1)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const parametersError = () => {
|
|
53
|
-
generalError(
|
|
54
|
-
`Credentials not recognized`,
|
|
55
|
-
'Check your command & keys again for hidden characters / verify that the credentials are correct.\nFor more information use contrast help.'
|
|
56
|
-
)
|
|
57
|
-
process.exit(1)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const invalidHostNameError = () => {
|
|
61
|
-
generalError(
|
|
62
|
-
`Invalid host`,
|
|
63
|
-
'Check that the host parameter does not include a trailing "/".'
|
|
64
|
-
)
|
|
65
|
-
process.exit(1)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const failOptionError = () => {
|
|
69
|
-
console.log(
|
|
70
|
-
'\n ******************************** ' +
|
|
71
|
-
i18n.__('snapshotFailureHeader') +
|
|
72
|
-
' ********************************\n' +
|
|
73
|
-
i18n.__('failOptionErrorMessage')
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* You don't have to pass `i18n` translation.
|
|
79
|
-
* String that didn't exists on translations will pass as regular string
|
|
80
|
-
* @param header title for the error
|
|
81
|
-
* @param message message for the error
|
|
82
|
-
* @returns error in general format
|
|
83
|
-
*/
|
|
84
|
-
const getErrorMessage = (header, message) => {
|
|
85
|
-
// prettier-ignore
|
|
86
|
-
const title = `******************************** ${i18n.__(header)} ********************************`
|
|
87
|
-
const multiLine = message?.includes('\n')
|
|
88
|
-
let finalMessage = ''
|
|
89
|
-
|
|
90
|
-
// i18n split the line if it includes '\n'
|
|
91
|
-
if (multiLine) {
|
|
92
|
-
finalMessage = `\n${message}`
|
|
93
|
-
} else if (message) {
|
|
94
|
-
finalMessage = `\n${i18n.__(message)}`
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return `${title}${finalMessage}`
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const generalError = (header, message) => {
|
|
101
|
-
const finalMessage = getErrorMessage(header, message)
|
|
102
|
-
console.log(finalMessage)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const findCommandOnError = unknownOptions => {
|
|
106
|
-
const commandKeywords = {
|
|
107
|
-
auth: 'auth',
|
|
108
|
-
audit: 'audit',
|
|
109
|
-
scan: 'scan',
|
|
110
|
-
lambda: 'lambda',
|
|
111
|
-
config: 'config'
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const containsCommandKeyword = unknownOptions.some(
|
|
115
|
-
command => commandKeywords[command]
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
if (containsCommandKeyword) {
|
|
119
|
-
const foundCommands = unknownOptions.filter(
|
|
120
|
-
command => commandKeywords[command]
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
//return the first command found
|
|
124
|
-
return foundCommands[0]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const commonMessageFormatter = (message, fail) => {
|
|
129
|
-
console.log(chalk.bold(i18n.__(message.title)))
|
|
130
|
-
console.log(i18n.__(message.body))
|
|
131
|
-
if (message.extra) {
|
|
132
|
-
console.log(i18n.__(message.extra))
|
|
133
|
-
}
|
|
134
|
-
if (fail) {
|
|
135
|
-
process.exit(1)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
module.exports = {
|
|
140
|
-
genericError,
|
|
141
|
-
unauthenticatedError,
|
|
142
|
-
badRequestError,
|
|
143
|
-
forbiddenError,
|
|
144
|
-
proxyError,
|
|
145
|
-
failOptionError,
|
|
146
|
-
generalError,
|
|
147
|
-
getErrorMessage,
|
|
148
|
-
libraryAnalysisError,
|
|
149
|
-
findCommandOnError,
|
|
150
|
-
snapshotFailureError,
|
|
151
|
-
vulnerabilitiesFailureError,
|
|
152
|
-
reportFailureError,
|
|
153
|
-
maxAppError,
|
|
154
|
-
parametersError,
|
|
155
|
-
invalidHostNameError,
|
|
156
|
-
commonMessageFormatter
|
|
157
|
-
}
|
package/src/common/fail.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
const i18n = require('i18n')
|
|
2
|
-
|
|
3
|
-
const processFail = (config, reportResults) => {
|
|
4
|
-
if (config.severity !== undefined) {
|
|
5
|
-
if (
|
|
6
|
-
reportResults[config.severity] !== undefined &&
|
|
7
|
-
isSeverityViolation(config.severity, reportResults)
|
|
8
|
-
) {
|
|
9
|
-
failPipeline('failSeverityOptionErrorMessage')
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (config.severity === undefined && reportResults.total > 0) {
|
|
14
|
-
failPipeline('failThresholdOptionErrorMessage')
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const isSeverityViolation = (severity, reportResults) => {
|
|
19
|
-
let count = 0
|
|
20
|
-
switch (severity) {
|
|
21
|
-
case 'critical':
|
|
22
|
-
count += reportResults.critical
|
|
23
|
-
break
|
|
24
|
-
case 'high':
|
|
25
|
-
count += reportResults.high + reportResults.critical
|
|
26
|
-
break
|
|
27
|
-
case 'medium':
|
|
28
|
-
count +=
|
|
29
|
-
reportResults.medium + reportResults.high + reportResults.critical
|
|
30
|
-
break
|
|
31
|
-
case 'low':
|
|
32
|
-
count +=
|
|
33
|
-
reportResults.high +
|
|
34
|
-
reportResults.critical +
|
|
35
|
-
reportResults.medium +
|
|
36
|
-
reportResults.low
|
|
37
|
-
break
|
|
38
|
-
case 'note':
|
|
39
|
-
if (reportResults.note == reportResults.total) {
|
|
40
|
-
count = 0
|
|
41
|
-
} else {
|
|
42
|
-
count = reportResults.total
|
|
43
|
-
}
|
|
44
|
-
break
|
|
45
|
-
default:
|
|
46
|
-
count = 0
|
|
47
|
-
}
|
|
48
|
-
return count > 0
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const failPipeline = (message = '') => {
|
|
52
|
-
console.log(
|
|
53
|
-
'\n ******************************** ' +
|
|
54
|
-
i18n.__('snapshotFailureHeader') +
|
|
55
|
-
' *********************************\n' +
|
|
56
|
-
i18n.__(message)
|
|
57
|
-
)
|
|
58
|
-
process.exit(2)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const parseSeverity = severity => {
|
|
62
|
-
const severities = ['NOTE', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL']
|
|
63
|
-
if (severities.includes(severity.toUpperCase())) {
|
|
64
|
-
return severity.toLowerCase()
|
|
65
|
-
} else {
|
|
66
|
-
console.log(
|
|
67
|
-
severity +
|
|
68
|
-
' Not recognised as a severity type please use LOW, MEDIUM, HIGH, CRITICAL, NOTE'
|
|
69
|
-
)
|
|
70
|
-
return undefined
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
module.exports = {
|
|
75
|
-
failPipeline,
|
|
76
|
-
processFail,
|
|
77
|
-
isSeverityViolation,
|
|
78
|
-
parseSeverity
|
|
79
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
const { APP_VERSION } = require('../constants/constants')
|
|
2
|
-
const boxen = require('boxen')
|
|
3
|
-
const chalk = require('chalk')
|
|
4
|
-
const semver = require('semver')
|
|
5
|
-
const commonApi = require('../utils/commonApi')
|
|
6
|
-
const { constants } = require('http2')
|
|
7
|
-
|
|
8
|
-
const getLatestVersion = async config => {
|
|
9
|
-
const client = commonApi.getHttpClient(config)
|
|
10
|
-
try {
|
|
11
|
-
const res = await client.getLatestVersion()
|
|
12
|
-
if (res.statusCode === constants.HTTP_STATUS_OK) {
|
|
13
|
-
return res.body
|
|
14
|
-
}
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return undefined
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const findLatestCLIVersion = async config => {
|
|
21
|
-
const isCI = process.env.CONTRAST_CODESEC_CI
|
|
22
|
-
? JSON.parse(process.env.CONTRAST_CODESEC_CI.toLowerCase())
|
|
23
|
-
: false
|
|
24
|
-
|
|
25
|
-
if (!isCI) {
|
|
26
|
-
let latestCLIVersion = await getLatestVersion(config)
|
|
27
|
-
|
|
28
|
-
if (latestCLIVersion === undefined) {
|
|
29
|
-
config.set('numOfRuns', 0)
|
|
30
|
-
console.log(
|
|
31
|
-
'Failed to retrieve latest version info. Continuing execution.'
|
|
32
|
-
)
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//strip key and remove new lines
|
|
37
|
-
latestCLIVersion = latestCLIVersion.substring(8).replace('\n', '')
|
|
38
|
-
|
|
39
|
-
if (semver.lt(APP_VERSION, latestCLIVersion)) {
|
|
40
|
-
const updateAvailableMessage = `Update available ${chalk.yellow(
|
|
41
|
-
APP_VERSION
|
|
42
|
-
)} → ${chalk.green(latestCLIVersion)}`
|
|
43
|
-
|
|
44
|
-
const npmUpdateAvailableCommand = `Run ${chalk.cyan(
|
|
45
|
-
'npm i @contrast/contrast -g'
|
|
46
|
-
)} to update via npm`
|
|
47
|
-
|
|
48
|
-
const homebrewUpdateAvailableCommand = `Run ${chalk.cyan(
|
|
49
|
-
'brew install contrastsecurity/tap/contrast'
|
|
50
|
-
)} to update via brew`
|
|
51
|
-
|
|
52
|
-
console.log(
|
|
53
|
-
boxen(
|
|
54
|
-
`${updateAvailableMessage}\n${npmUpdateAvailableCommand}\n\n${homebrewUpdateAvailableCommand}`,
|
|
55
|
-
{
|
|
56
|
-
titleAlignment: 'center',
|
|
57
|
-
margin: 1,
|
|
58
|
-
padding: 1,
|
|
59
|
-
align: 'center'
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const isCorrectNodeVersion = async currentVersion => {
|
|
68
|
-
return semver.satisfies(currentVersion, '>=16')
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
module.exports = {
|
|
72
|
-
getLatestVersion,
|
|
73
|
-
findLatestCLIVersion,
|
|
74
|
-
isCorrectNodeVersion
|
|
75
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Language identifiers
|
|
2
|
-
const NODE = 'NODE'
|
|
3
|
-
const DOTNET = 'DOTNET'
|
|
4
|
-
const JAVA = 'JAVA'
|
|
5
|
-
const RUBY = 'RUBY'
|
|
6
|
-
const PYTHON = 'PYTHON'
|
|
7
|
-
const GO = 'GO'
|
|
8
|
-
const PHP = 'PHP'
|
|
9
|
-
const JAVASCRIPT = 'JAVASCRIPT'
|
|
10
|
-
// Severity
|
|
11
|
-
const LOW = 'LOW'
|
|
12
|
-
const MEDIUM = 'MEDIUM'
|
|
13
|
-
const HIGH = 'HIGH'
|
|
14
|
-
const CRITICAL = 'CRITICAL'
|
|
15
|
-
// App
|
|
16
|
-
const APP_NAME = 'contrast'
|
|
17
|
-
const APP_VERSION = '2.0.2-beta.0'
|
|
18
|
-
const TIMEOUT = 120000
|
|
19
|
-
const HIGH_COLOUR = '#ff9900'
|
|
20
|
-
const CRITICAL_COLOUR = '#e35858'
|
|
21
|
-
const MEDIUM_COLOUR = '#f1c232'
|
|
22
|
-
const LOW_COLOUR = '#b7b7b7'
|
|
23
|
-
const NOTE_COLOUR = '#999999'
|
|
24
|
-
const CRITICAL_PRIORITY = 1
|
|
25
|
-
const HIGH_PRIORITY = 2
|
|
26
|
-
const MEDIUM_PRIORITY = 3
|
|
27
|
-
const LOW_PRIORITY = 4
|
|
28
|
-
const NOTE_PRIORITY = 5
|
|
29
|
-
|
|
30
|
-
const AUTH_UI_URL = 'https://cli-auth.contrastsecurity.com'
|
|
31
|
-
const AUTH_CALLBACK_URL = 'https://cli-auth-api.contrastsecurity.com'
|
|
32
|
-
const SARIF_FILE = 'SARIF'
|
|
33
|
-
const SBOM_CYCLONE_DX_FILE = 'CYCLONEDX'
|
|
34
|
-
const SBOM_SPDX_FILE = 'SPDX'
|
|
35
|
-
const CE_URL = 'https://ce.contrastsecurity.com'
|
|
36
|
-
|
|
37
|
-
//configuration
|
|
38
|
-
const SAAS = 'SAAS'
|
|
39
|
-
const EOP = 'EOP'
|
|
40
|
-
const MODE_REPO = 'REPO'
|
|
41
|
-
|
|
42
|
-
module.exports = {
|
|
43
|
-
supportedLanguages: { NODE, DOTNET, JAVA, RUBY, PYTHON, GO, PHP, JAVASCRIPT },
|
|
44
|
-
supportedLanguagesScan: { JAVASCRIPT, DOTNET, JAVA },
|
|
45
|
-
LOW,
|
|
46
|
-
MEDIUM,
|
|
47
|
-
HIGH,
|
|
48
|
-
CRITICAL,
|
|
49
|
-
APP_VERSION,
|
|
50
|
-
APP_NAME,
|
|
51
|
-
TIMEOUT,
|
|
52
|
-
AUTH_UI_URL,
|
|
53
|
-
AUTH_CALLBACK_URL,
|
|
54
|
-
SARIF_FILE,
|
|
55
|
-
HIGH_COLOUR,
|
|
56
|
-
CRITICAL_COLOUR,
|
|
57
|
-
MEDIUM_COLOUR,
|
|
58
|
-
LOW_COLOUR,
|
|
59
|
-
NOTE_COLOUR,
|
|
60
|
-
CE_URL,
|
|
61
|
-
CRITICAL_PRIORITY,
|
|
62
|
-
HIGH_PRIORITY,
|
|
63
|
-
MEDIUM_PRIORITY,
|
|
64
|
-
LOW_PRIORITY,
|
|
65
|
-
NOTE_PRIORITY,
|
|
66
|
-
SBOM_CYCLONE_DX_FILE,
|
|
67
|
-
SBOM_SPDX_FILE,
|
|
68
|
-
SAAS,
|
|
69
|
-
EOP,
|
|
70
|
-
MODE_REPO
|
|
71
|
-
}
|
package/src/constants/lambda.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const lambda = {
|
|
2
|
-
failedToStartScan: 'Failed to start scan',
|
|
3
|
-
failedToParseArn: 'Failed to parse ARN',
|
|
4
|
-
failedToGetScan: 'Failed to get scan',
|
|
5
|
-
missingLambdaConfig: 'Missing Lambda Configuration',
|
|
6
|
-
missingLambdaArn: 'Missing Lambda ARN',
|
|
7
|
-
validationFailed: 'Request validation failed',
|
|
8
|
-
missingFunctionName:
|
|
9
|
-
'Required parameter --function-name is missing.\nRun command with --help to see usage',
|
|
10
|
-
failedToGetResults: 'Failed to get results',
|
|
11
|
-
missingResults: 'Missing vulnerabilities',
|
|
12
|
-
awsError: 'AWS error',
|
|
13
|
-
missingFlagArguments:
|
|
14
|
-
'The following flags are missing an arguments:\n{{flags}}',
|
|
15
|
-
notSupportedFlags:
|
|
16
|
-
'The following flags are not supported:\n{{flags}}\nRun command with --help to see usage',
|
|
17
|
-
layerNotFound:
|
|
18
|
-
'The layer {{layerArn}} could not be found. The scan will continue without it',
|
|
19
|
-
|
|
20
|
-
// ====== general ===== //
|
|
21
|
-
noVulnerabilitiesFound: '👏 No vulnerabilities found',
|
|
22
|
-
scanCompleted: '----- Scan completed {{time}}s -----',
|
|
23
|
-
sendingScanRequest:
|
|
24
|
-
'{{icon}} Sending Lambda Function scan request to Contrast',
|
|
25
|
-
scanRequestedSuccessfully: '{{icon}} Scan requested successfully',
|
|
26
|
-
fetchingConfiguration:
|
|
27
|
-
'{{icon}} Fetching configuration and policies for Lambda Function {{functionName}}',
|
|
28
|
-
fetchedConfiguration: '{{icon}} Fetched configuration from AWS',
|
|
29
|
-
|
|
30
|
-
// ====== scan polling ===== //
|
|
31
|
-
scanStarted: 'Scan Started',
|
|
32
|
-
scanFailed: 'Scan Failed',
|
|
33
|
-
scanTimedOut: 'Scan timed out',
|
|
34
|
-
|
|
35
|
-
// ====== lambda utils ===== //
|
|
36
|
-
loadingFunctionList: 'Loading lambda function list',
|
|
37
|
-
functionsFound: '{{count}} functions found',
|
|
38
|
-
noFunctionsFound: 'No functions found',
|
|
39
|
-
failedToLoadFunctions: 'Failed to load lambda functions',
|
|
40
|
-
availableForScan: '{{icon}} {{count}} available for scan',
|
|
41
|
-
runtimeCount: '----- {{runtime}} ({{count}}) -----',
|
|
42
|
-
|
|
43
|
-
// ====== print vulnerabilities ===== //
|
|
44
|
-
gatherResults: 'Gathering results...',
|
|
45
|
-
doneGatherResults: 'Done gathering results',
|
|
46
|
-
whatHappenedTitle: 'What happened:',
|
|
47
|
-
whatHappenedItem: '{{policy}} have:\n{{comments}}\n',
|
|
48
|
-
recommendation: 'Recommendation:',
|
|
49
|
-
vulnerableDependency: 'Vulnerable dependency',
|
|
50
|
-
dependenciesCount: {
|
|
51
|
-
one: '1 Dependency',
|
|
52
|
-
other: '%s Dependencies'
|
|
53
|
-
},
|
|
54
|
-
foundVulnerabilities: {
|
|
55
|
-
one: 'Found 1 vulnerability',
|
|
56
|
-
other: 'Found %s vulnerabilities'
|
|
57
|
-
},
|
|
58
|
-
vulnerableDependencyDescriptions:
|
|
59
|
-
'{packageName} (v{version}) has {NUM} known {NUM, plural,one{CVE}other{CVEs}}\n {cves}',
|
|
60
|
-
|
|
61
|
-
// ====== errorCodes ===== //
|
|
62
|
-
something_went_wrong: 'Something went wrong',
|
|
63
|
-
not_found_404: '404 error - Not found',
|
|
64
|
-
internal_error: 'Internal error',
|
|
65
|
-
inactive_account:
|
|
66
|
-
'Scanning a function of an inactive account is not supported',
|
|
67
|
-
not_supported_runtime:
|
|
68
|
-
'Scanning resource of runtime "{{runtime}}" is not supported.\nSupported runtimes: {{supportedRuntimes}}',
|
|
69
|
-
not_supported_lambda: 'This function cannot be scanned',
|
|
70
|
-
not_supported_onboard_account:
|
|
71
|
-
'Scanning a function of onboard account is not supported',
|
|
72
|
-
scan_lock:
|
|
73
|
-
'Other scan is still running. Please wait until the previous scan finishes',
|
|
74
|
-
|
|
75
|
-
// ====== statuses ===== //
|
|
76
|
-
unsupported: 'unsupported',
|
|
77
|
-
excluded: 'excluded',
|
|
78
|
-
canceled: 'canceled',
|
|
79
|
-
failed: 'failed',
|
|
80
|
-
dismissed: 'dismissed'
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
module.exports = {
|
|
84
|
-
lambda
|
|
85
|
-
}
|