@contrast/contrast 1.0.15 → 1.0.17
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/audit/catalogueApplication/catalogueApplication.js +1 -1
- package/dist/audit/languageAnalysisEngine/sendSnapshot.js +2 -2
- package/dist/audit/report/commonReportingFunctions.js +1 -19
- package/dist/{constants.js → cliConstants.js} +47 -32
- package/dist/commands/audit/auditConfig.js +10 -12
- package/dist/commands/audit/auditController.js +12 -16
- package/dist/commands/audit/help.js +24 -26
- package/dist/commands/audit/processAudit.js +16 -22
- package/dist/commands/audit/saveFile.js +3 -9
- package/dist/commands/auth/auth.js +1 -1
- package/dist/commands/config/config.js +1 -1
- package/dist/commands/scan/processScan.js +5 -7
- package/dist/commands/scan/sca/scaAnalysis.js +118 -89
- package/dist/common/HTTPClient.js +4 -2
- package/dist/common/commonHelp.js +35 -17
- package/dist/common/errorHandling.js +28 -57
- package/dist/common/versionChecker.js +24 -27
- package/dist/constants/constants.js +1 -1
- package/dist/constants/locales.js +11 -33
- package/dist/index.js +5 -5
- package/dist/lambda/help.js +2 -1
- package/dist/lambda/lambda.js +2 -7
- package/dist/scaAnalysis/common/auditReport.js +3 -2
- package/dist/scaAnalysis/common/scaParserForGoAndJava.js +1 -1
- package/dist/scaAnalysis/java/analysis.js +40 -5
- package/dist/scaAnalysis/java/index.js +15 -2
- package/dist/scaAnalysis/javascript/scaServiceParser.js +2 -2
- package/dist/scaAnalysis/php/phpNewServicesMapper.js +3 -3
- package/dist/scaAnalysis/python/analysis.js +1 -1
- package/dist/scaAnalysis/repoMode/gradleParser.js +75 -0
- package/dist/scaAnalysis/repoMode/index.js +21 -0
- package/dist/scaAnalysis/repoMode/mavenParser.js +76 -0
- package/dist/scaAnalysis/ruby/analysis.js +4 -4
- package/dist/scan/autoDetection.js +12 -3
- package/dist/scan/fileUtils.js +24 -1
- package/dist/scan/help.js +3 -2
- package/dist/scan/saveResults.js +1 -1
- package/dist/scan/scanConfig.js +1 -1
- package/dist/utils/commonApi.js +10 -1
- package/dist/utils/generalAPI.js +1 -2
- package/dist/utils/paramsUtil/configStoreParams.js +12 -1
- package/dist/utils/paramsUtil/paramHandler.js +7 -1
- package/dist/utils/saveFile.js +2 -1
- package/package.json +3 -1
- package/src/audit/catalogueApplication/catalogueApplication.js +1 -1
- package/src/audit/languageAnalysisEngine/sendSnapshot.js +2 -6
- package/src/audit/report/commonReportingFunctions.js +1 -23
- package/src/{constants.js → cliConstants.js} +53 -36
- package/src/commands/audit/auditConfig.js +19 -0
- package/src/commands/audit/{auditController.ts → auditController.js} +17 -12
- package/src/commands/audit/{help.ts → help.js} +10 -7
- package/src/commands/audit/processAudit.js +37 -0
- package/src/commands/audit/{saveFile.ts → saveFile.js} +2 -2
- package/src/commands/auth/auth.js +1 -1
- package/src/commands/config/config.js +1 -1
- package/src/commands/scan/processScan.js +4 -10
- package/src/commands/scan/sca/scaAnalysis.js +146 -118
- package/src/common/HTTPClient.js +4 -2
- package/src/common/commonHelp.js +43 -0
- package/src/common/{errorHandling.ts → errorHandling.js} +6 -31
- package/src/common/{versionChecker.ts → versionChecker.js} +15 -10
- package/src/constants/constants.js +1 -1
- package/src/constants/locales.js +13 -47
- package/src/index.ts +1 -1
- package/src/lambda/help.ts +2 -1
- package/src/lambda/lambda.ts +2 -10
- package/src/scaAnalysis/common/auditReport.js +3 -4
- package/src/scaAnalysis/common/scaParserForGoAndJava.js +1 -1
- package/src/scaAnalysis/java/analysis.js +43 -10
- package/src/scaAnalysis/java/index.js +19 -2
- package/src/scaAnalysis/javascript/scaServiceParser.js +8 -2
- package/src/scaAnalysis/php/phpNewServicesMapper.js +3 -3
- package/src/scaAnalysis/python/analysis.js +1 -1
- package/src/scaAnalysis/repoMode/gradleParser.js +88 -0
- package/src/scaAnalysis/repoMode/index.js +21 -0
- package/src/scaAnalysis/repoMode/mavenParser.js +89 -0
- package/src/scaAnalysis/ruby/analysis.js +4 -4
- package/src/scan/autoDetection.js +14 -3
- package/src/scan/fileUtils.js +29 -1
- package/src/scan/help.js +3 -2
- package/src/scan/saveResults.js +1 -1
- package/src/scan/scanConfig.js +1 -1
- package/src/utils/commonApi.js +13 -1
- package/src/utils/generalAPI.js +1 -2
- package/src/utils/getConfig.ts +1 -0
- package/src/utils/paramsUtil/configStoreParams.js +14 -1
- package/src/utils/paramsUtil/paramHandler.js +9 -1
- package/src/utils/saveFile.js +2 -1
- package/src/commands/audit/auditConfig.ts +0 -21
- package/src/commands/audit/processAudit.ts +0 -40
- package/src/common/commonHelp.ts +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/contrast",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Contrast Security's command line tool",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -54,8 +54,10 @@
|
|
|
54
54
|
"command-line-args": "^5.2.1",
|
|
55
55
|
"command-line-usage": "^6.1.3",
|
|
56
56
|
"conf": "^10.1.2",
|
|
57
|
+
"cross-spawn": "^7.0.3",
|
|
57
58
|
"dotenv": "^16.0.0",
|
|
58
59
|
"fast-glob": "^3.2.11",
|
|
60
|
+
"gradle-to-js": "^2.0.1",
|
|
59
61
|
"i18n": "^0.14.2",
|
|
60
62
|
"js-yaml": "^4.1.0",
|
|
61
63
|
"lodash": "^4.17.21",
|
|
@@ -29,11 +29,7 @@ const getTimeout = config => {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
config,
|
|
34
|
-
snapshotId,
|
|
35
|
-
reportSpinner
|
|
36
|
-
) => {
|
|
32
|
+
const pollForSnapshotCompletion = async (config, snapshotId, reportSpinner) => {
|
|
37
33
|
const client = commonApi.getHttpClient(config)
|
|
38
34
|
const startTime = performance.now()
|
|
39
35
|
const timeout = getTimeout(config)
|
|
@@ -76,5 +72,5 @@ const pollForSnapshotCompletition = async (
|
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
module.exports = {
|
|
79
|
-
|
|
75
|
+
pollForSnapshotCompletion
|
|
80
76
|
}
|
|
@@ -256,13 +256,7 @@ function buildBody(cveArray, advice) {
|
|
|
256
256
|
function getIssueRow(cveArray) {
|
|
257
257
|
orderByHighestPriority(cveArray)
|
|
258
258
|
const cveMessagesList = getIssueCveMsgList(cveArray)
|
|
259
|
-
|
|
260
|
-
const numAndSeverityTypeDesc = getNumOfAndSeverityType(cveNumbers)
|
|
261
|
-
return [
|
|
262
|
-
chalk.bold('Issue'),
|
|
263
|
-
':',
|
|
264
|
-
`${numAndSeverityTypeDesc} ${cveMessagesList.join(', ')}`
|
|
265
|
-
]
|
|
259
|
+
return [chalk.bold('Issue'), ':', `${cveMessagesList.join(', ')}`]
|
|
266
260
|
}
|
|
267
261
|
|
|
268
262
|
function gatherRemediationAdvice(guidance, libraryName, libraryVersion) {
|
|
@@ -282,21 +276,6 @@ function buildFormattedHeaderNum(contrastHeaderNum) {
|
|
|
282
276
|
return `CONTRAST-${contrastHeaderNum.toString().padStart(3, '0')}`
|
|
283
277
|
}
|
|
284
278
|
|
|
285
|
-
function getNumOfAndSeverityType(cveNumbers) {
|
|
286
|
-
const { critical, high, medium, low, note } = cveNumbers
|
|
287
|
-
|
|
288
|
-
const criticalMsg = critical > 0 ? `${critical} Critical | ` : ''
|
|
289
|
-
const highMsg = high > 0 ? `${high} High | ` : ''
|
|
290
|
-
const mediumMsg = medium > 0 ? `${medium} Medium | ` : ''
|
|
291
|
-
const lowMsg = low > 0 ? `${low} Low | ` : ''
|
|
292
|
-
const noteMsg = note > 0 ? `${note} Note` : ''
|
|
293
|
-
|
|
294
|
-
//removes/trims whitespace to single spaces
|
|
295
|
-
return `${criticalMsg} ${highMsg} ${mediumMsg} ${lowMsg} ${noteMsg}`
|
|
296
|
-
.replace(/\s+/g, ' ')
|
|
297
|
-
.trim()
|
|
298
|
-
}
|
|
299
|
-
|
|
300
279
|
const buildFooter = reportModelStructure => {
|
|
301
280
|
const { critical, high, medium, low, note } =
|
|
302
281
|
countVulnerableLibrariesBySeverity(reportModelStructure)
|
|
@@ -424,7 +403,6 @@ module.exports = {
|
|
|
424
403
|
getIssueRow,
|
|
425
404
|
gatherRemediationAdvice,
|
|
426
405
|
buildFormattedHeaderNum,
|
|
427
|
-
getNumOfAndSeverityType,
|
|
428
406
|
getIssueCveMsgList,
|
|
429
407
|
getSeverityCounts,
|
|
430
408
|
printNoVulnFoundMsg,
|
|
@@ -11,8 +11,53 @@ i18n.configure({
|
|
|
11
11
|
defaultLocale: 'en'
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
+
const sharedOptionDefinitions = [
|
|
15
|
+
{
|
|
16
|
+
name: 'proxy',
|
|
17
|
+
description:
|
|
18
|
+
'{bold ' +
|
|
19
|
+
i18n.__('constantsOptional') +
|
|
20
|
+
'}: ' +
|
|
21
|
+
i18n.__('constantsProxyServer')
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'key',
|
|
25
|
+
description:
|
|
26
|
+
'{bold ' +
|
|
27
|
+
i18n.__('constantsOptional') +
|
|
28
|
+
'}: ' +
|
|
29
|
+
i18n.__('constantsProxyKey')
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'cacert',
|
|
33
|
+
description:
|
|
34
|
+
'{bold ' +
|
|
35
|
+
i18n.__('constantsOptional') +
|
|
36
|
+
'}: ' +
|
|
37
|
+
i18n.__('constantsProxyCaCert')
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'cert',
|
|
41
|
+
description:
|
|
42
|
+
'{bold ' +
|
|
43
|
+
i18n.__('constantsOptional') +
|
|
44
|
+
'}: ' +
|
|
45
|
+
i18n.__('constantsProxyCert')
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'ignore-cert-errors',
|
|
49
|
+
type: Boolean,
|
|
50
|
+
description:
|
|
51
|
+
'{bold ' +
|
|
52
|
+
i18n.__('constantsOptional') +
|
|
53
|
+
'}:' +
|
|
54
|
+
i18n.__('constantsIgnoreCertErrors')
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
|
|
14
58
|
// CLI options that we will allow and handle
|
|
15
59
|
const scanOptionDefinitions = [
|
|
60
|
+
...sharedOptionDefinitions,
|
|
16
61
|
{
|
|
17
62
|
name: 'name',
|
|
18
63
|
alias: 'n',
|
|
@@ -100,14 +145,6 @@ const scanOptionDefinitions = [
|
|
|
100
145
|
'}: ' +
|
|
101
146
|
i18n.__('constantsHostId')
|
|
102
147
|
},
|
|
103
|
-
{
|
|
104
|
-
name: 'proxy',
|
|
105
|
-
description:
|
|
106
|
-
'{bold ' +
|
|
107
|
-
i18n.__('constantsOptional') +
|
|
108
|
-
'}: ' +
|
|
109
|
-
i18n.__('constantsProxyServer')
|
|
110
|
-
},
|
|
111
148
|
{
|
|
112
149
|
name: 'fail',
|
|
113
150
|
type: Boolean,
|
|
@@ -133,16 +170,7 @@ const scanOptionDefinitions = [
|
|
|
133
170
|
'{bold ' +
|
|
134
171
|
i18n.__('constantsOptional') +
|
|
135
172
|
'}: ' +
|
|
136
|
-
i18n.__('
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: 'ignore-cert-errors',
|
|
140
|
-
type: Boolean,
|
|
141
|
-
description:
|
|
142
|
-
'{bold ' +
|
|
143
|
-
i18n.__('constantsOptional') +
|
|
144
|
-
'}:' +
|
|
145
|
-
i18n.__('constantsIgnoreCertErrors')
|
|
173
|
+
i18n.__('constantsDoNotWaitForScan')
|
|
146
174
|
},
|
|
147
175
|
{
|
|
148
176
|
name: 'verbose',
|
|
@@ -214,6 +242,7 @@ const configOptionDefinitions = [
|
|
|
214
242
|
]
|
|
215
243
|
|
|
216
244
|
const auditOptionDefinitions = [
|
|
245
|
+
...sharedOptionDefinitions,
|
|
217
246
|
{
|
|
218
247
|
name: 'application-id',
|
|
219
248
|
description:
|
|
@@ -305,6 +334,10 @@ const auditOptionDefinitions = [
|
|
|
305
334
|
{
|
|
306
335
|
name: 'maven-settings-path'
|
|
307
336
|
},
|
|
337
|
+
{
|
|
338
|
+
name: 'fingerprint',
|
|
339
|
+
type: Boolean
|
|
340
|
+
},
|
|
308
341
|
{
|
|
309
342
|
name: 'organization-id',
|
|
310
343
|
alias: 'o',
|
|
@@ -338,23 +371,6 @@ const auditOptionDefinitions = [
|
|
|
338
371
|
'}: ' +
|
|
339
372
|
i18n.__('constantsHostId')
|
|
340
373
|
},
|
|
341
|
-
{
|
|
342
|
-
name: 'proxy',
|
|
343
|
-
description:
|
|
344
|
-
'{bold ' +
|
|
345
|
-
i18n.__('constantsOptional') +
|
|
346
|
-
'}: ' +
|
|
347
|
-
i18n.__('constantsProxyServer')
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
name: 'ignore-cert-errors',
|
|
351
|
-
type: Boolean,
|
|
352
|
-
description:
|
|
353
|
-
'{bold ' +
|
|
354
|
-
i18n.__('constantsOptional') +
|
|
355
|
-
'}:' +
|
|
356
|
-
i18n.__('constantsIgnoreCertErrors')
|
|
357
|
-
},
|
|
358
374
|
{
|
|
359
375
|
name: 'save',
|
|
360
376
|
alias: 's',
|
|
@@ -449,7 +465,8 @@ const mainUsageGuide = commandLineUsage([
|
|
|
449
465
|
{ name: i18n.__('clearHeader'), summary: i18n.__('clearContent') }
|
|
450
466
|
]
|
|
451
467
|
},
|
|
452
|
-
commonHelpLinks()
|
|
468
|
+
commonHelpLinks()[0],
|
|
469
|
+
commonHelpLinks()[1]
|
|
453
470
|
])
|
|
454
471
|
|
|
455
472
|
const mainDefinition = [{ name: 'command', defaultOption: true }]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { getCommandLineArgsCustom } = require('../../utils/parsedCLIOptions')
|
|
2
|
+
const constants = require('../../cliConstants')
|
|
3
|
+
const paramHandler = require('../../utils/paramsUtil/paramHandler')
|
|
4
|
+
|
|
5
|
+
const getAuditConfig = async (contrastConf, command, argv) => {
|
|
6
|
+
const auditParameters = await getCommandLineArgsCustom(
|
|
7
|
+
contrastConf,
|
|
8
|
+
command,
|
|
9
|
+
argv,
|
|
10
|
+
constants.commandLineDefinitions.auditOptionDefinitions
|
|
11
|
+
)
|
|
12
|
+
const paramsAuth = paramHandler.getAuth(auditParameters)
|
|
13
|
+
const javaAgreement = paramHandler.getAgreement()
|
|
14
|
+
return { ...paramsAuth, ...auditParameters, ...javaAgreement }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
getAuditConfig
|
|
19
|
+
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const catalogue = require('../../audit/catalogueApplication/catalogueApplication')
|
|
2
|
+
const commonApi = require('../../audit/languageAnalysisEngine/commonApi')
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
let appID
|
|
4
|
+
const dealWithNoAppId = async config => {
|
|
5
|
+
let appID
|
|
6
6
|
try {
|
|
7
|
-
// @ts-ignore
|
|
8
7
|
appID = await commonApi.returnAppId(config)
|
|
8
|
+
|
|
9
9
|
if (!appID && config.applicationName) {
|
|
10
|
-
return await catalogueApplication(config)
|
|
10
|
+
return await catalogue.catalogueApplication(config)
|
|
11
11
|
}
|
|
12
|
+
|
|
12
13
|
if (!appID && !config.applicationName) {
|
|
13
|
-
config.applicationName = getAppName(config.file)
|
|
14
|
-
// @ts-ignore
|
|
14
|
+
config.applicationName = getAppName(config.file)
|
|
15
15
|
appID = await commonApi.returnAppId(config)
|
|
16
|
+
|
|
16
17
|
if (!appID) {
|
|
17
|
-
return await catalogueApplication(config)
|
|
18
|
+
return await catalogue.catalogueApplication(config)
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
} catch (e
|
|
21
|
+
} catch (e) {
|
|
21
22
|
if (e.toString().includes('tunneling socket could not be established')) {
|
|
22
23
|
console.log(e.message.toString())
|
|
23
24
|
console.log(
|
|
@@ -29,7 +30,7 @@ export const dealWithNoAppId = async (config: { [x: string]: string }) => {
|
|
|
29
30
|
return appID
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
const getAppName = file => {
|
|
33
34
|
const last = file.charAt(file.length - 1)
|
|
34
35
|
if (last !== '/') {
|
|
35
36
|
return file.split('/').pop()
|
|
@@ -39,6 +40,10 @@ export const getAppName = (file: string) => {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
const removeLastChar =
|
|
43
|
+
const removeLastChar = str => {
|
|
43
44
|
return str.substring(0, str.length - 1)
|
|
44
45
|
}
|
|
46
|
+
|
|
47
|
+
module.exports = {
|
|
48
|
+
dealWithNoAppId
|
|
49
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const commandLineUsage = require('command-line-usage')
|
|
2
|
+
const i18n = require('i18n')
|
|
3
|
+
const constants = require('../../cliConstants')
|
|
4
|
+
const { commonHelpLinks } = require('../../common/commonHelp')
|
|
5
5
|
|
|
6
6
|
const auditUsageGuide = commandLineUsage([
|
|
7
7
|
{
|
|
@@ -49,10 +49,13 @@ const auditUsageGuide = commandLineUsage([
|
|
|
49
49
|
'app-groups',
|
|
50
50
|
'metadata',
|
|
51
51
|
'track',
|
|
52
|
-
'
|
|
52
|
+
'fingerprint'
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
|
-
commonHelpLinks()
|
|
55
|
+
commonHelpLinks()[0],
|
|
56
|
+
commonHelpLinks()[1]
|
|
56
57
|
])
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
module.exports = {
|
|
60
|
+
auditUsageGuide
|
|
61
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const auditConfig = require('./auditConfig')
|
|
2
|
+
const { auditUsageGuide } = require('./help')
|
|
3
|
+
const scaController = require('../scan/sca/scaAnalysis')
|
|
4
|
+
const { sendTelemetryConfigAsObject } = require('../../telemetry/telemetry')
|
|
5
|
+
const { postRunMessage } = require('../../common/commonHelp')
|
|
6
|
+
|
|
7
|
+
const processAudit = async (contrastConf, argvMain) => {
|
|
8
|
+
if (argvMain.indexOf('--help') !== -1) {
|
|
9
|
+
printHelpMessage()
|
|
10
|
+
process.exit(0)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const config = await auditConfig.getAuditConfig(
|
|
14
|
+
contrastConf,
|
|
15
|
+
'audit',
|
|
16
|
+
argvMain
|
|
17
|
+
)
|
|
18
|
+
await scaController.processSca(config)
|
|
19
|
+
if (!config.fingerprint) {
|
|
20
|
+
postRunMessage('audit')
|
|
21
|
+
await sendTelemetryConfigAsObject(
|
|
22
|
+
config,
|
|
23
|
+
'audit',
|
|
24
|
+
argvMain,
|
|
25
|
+
'SUCCESS',
|
|
26
|
+
config.language
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const printHelpMessage = () => {
|
|
32
|
+
console.log(auditUsageGuide)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = {
|
|
36
|
+
processAudit
|
|
37
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const fs = require('fs')
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const saveFile = (config, type, rawResults) => {
|
|
4
4
|
const fileName = `${config.applicationId}-sbom-${type}.json`
|
|
5
5
|
fs.writeFileSync(fileName, JSON.stringify(rawResults))
|
|
6
6
|
}
|
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
} = require('../../utils/oraWrapper')
|
|
13
13
|
const { TIMEOUT, AUTH_UI_URL } = require('../../constants/constants')
|
|
14
14
|
const parsedCLIOptions = require('../../utils/parsedCLIOptions')
|
|
15
|
-
const constants = require('../../
|
|
15
|
+
const constants = require('../../cliConstants')
|
|
16
16
|
const commandLineUsage = require('command-line-usage')
|
|
17
17
|
|
|
18
18
|
const processAuth = async (argv, config) => {
|
|
@@ -5,7 +5,7 @@ const { ScanResultsModel } = require('../../scan/models/scanResultsModel')
|
|
|
5
5
|
const { formatScanOutput } = require('../../scan/formatScanOutput')
|
|
6
6
|
const common = require('../../common/fail')
|
|
7
7
|
const { sendTelemetryConfigAsObject } = require('../../telemetry/telemetry')
|
|
8
|
-
const
|
|
8
|
+
const { postRunMessage } = require('../../common/commonHelp')
|
|
9
9
|
|
|
10
10
|
const processScan = async (contrastConf, argv) => {
|
|
11
11
|
let config = await scanConfig.getScanConfig(contrastConf, 'scan', argv)
|
|
@@ -26,21 +26,15 @@ const processScan = async (contrastConf, argv) => {
|
|
|
26
26
|
|
|
27
27
|
if (config.save !== undefined) {
|
|
28
28
|
await saveScanFile(config, scanResults)
|
|
29
|
+
} else {
|
|
30
|
+
console.log('\nUse contrast scan --save to save results as a SARIF')
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
if (config.fail) {
|
|
32
34
|
common.processFail(config, output)
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
postRunMessage()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const postRunMessage = () => {
|
|
39
|
-
console.log('\n' + chalk.underline.bold('Other Codesec Features:'))
|
|
40
|
-
console.log(
|
|
41
|
-
"'contrast audit' to find vulnerabilities in your open source dependencies"
|
|
42
|
-
)
|
|
43
|
-
console.log("'contrast lambda' to secure your AWS serverless functions\n")
|
|
37
|
+
postRunMessage('scan')
|
|
44
38
|
}
|
|
45
39
|
|
|
46
40
|
module.exports = {
|