snyk-cpp-plugin 1.4.1 → 2.0.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/display.d.ts +2 -2
- package/dist/display.js +76 -46
- package/dist/display.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/scan.d.ts +2 -2
- package/dist/scan.js +8 -7
- package/dist/scan.js.map +1 -1
- package/dist/types.d.ts +33 -29
- package/package.json +2 -1
package/dist/display.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ScanResult, TestResult } from './types';
|
|
2
|
-
export declare function display(scanResults: ScanResult[], testResults: TestResult[], errors: string[]): Promise<string>;
|
|
1
|
+
import { ScanResult, TestResult, Options } from './types';
|
|
2
|
+
export declare function display(scanResults: ScanResult[], testResults: TestResult[], errors: string[], options?: Options): Promise<string>;
|
package/dist/display.js
CHANGED
|
@@ -1,86 +1,116 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.display = void 0;
|
|
4
|
+
const chalk = require("chalk");
|
|
4
5
|
const dep_graph_1 = require("@snyk/dep-graph");
|
|
5
6
|
const debug_1 = require("debug");
|
|
6
7
|
const debug = debug_1.default('snyk-cpp-plugin');
|
|
7
8
|
function displayFingerprints(scanResults) {
|
|
8
9
|
const result = [];
|
|
9
|
-
for (const {
|
|
10
|
-
for (const { data = [] } of
|
|
10
|
+
for (const { facts = [] } of scanResults) {
|
|
11
|
+
for (const { data = [] } of facts) {
|
|
11
12
|
for (const { filePath, hash } of data) {
|
|
12
13
|
if (filePath && hash) {
|
|
13
14
|
if (!result.length) {
|
|
14
|
-
result.push('
|
|
15
|
-
result.push('-----------------------');
|
|
15
|
+
result.push(chalk.whiteBright('Fingerprints'));
|
|
16
16
|
}
|
|
17
17
|
result.push(`${hash} ${filePath}`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
if (result.length) {
|
|
23
|
+
result.push('');
|
|
24
|
+
}
|
|
22
25
|
return result;
|
|
23
26
|
}
|
|
24
|
-
function
|
|
27
|
+
function displayDependencies(depGraph) {
|
|
25
28
|
var _a;
|
|
26
29
|
const result = [];
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
30
|
+
const depCount = ((_a = depGraph === null || depGraph === void 0 ? void 0 : depGraph.getDepPkgs()) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
31
|
+
if (depCount > 0) {
|
|
32
|
+
result.push(chalk.whiteBright('Dependencies'));
|
|
33
|
+
}
|
|
34
|
+
for (const pkg of (depGraph === null || depGraph === void 0 ? void 0 : depGraph.getDepPkgs()) || []) {
|
|
35
|
+
result.push(`${pkg.name}@${pkg.version}`);
|
|
36
|
+
}
|
|
37
|
+
if (result.length) {
|
|
38
|
+
result.push('');
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
function displayIssues(depGraph, issues, issuesData) {
|
|
43
|
+
var _a;
|
|
44
|
+
const result = [];
|
|
45
|
+
const pkgCount = ((_a = depGraph === null || depGraph === void 0 ? void 0 : depGraph.getDepPkgs()) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
46
|
+
const depCount = pkgCount == 1 ? '1 dependency' : `${pkgCount} dependencies`;
|
|
47
|
+
const issuesCount = issues.length == 1 ? '1 issue' : `${issues.length} issues`;
|
|
48
|
+
result.push(chalk.whiteBright('Issues'));
|
|
49
|
+
for (const { pkgName, pkgVersion, issueId, fixInfo } of issues) {
|
|
50
|
+
const { title, severity } = issuesData[issueId];
|
|
51
|
+
const fix = fixInfo.nearestFixedInVersion
|
|
52
|
+
? `fix version ${fixInfo.nearestFixedInVersion}`
|
|
53
|
+
: 'no fix available';
|
|
54
|
+
let color;
|
|
55
|
+
switch (severity) {
|
|
56
|
+
case 'low':
|
|
57
|
+
color = chalk.blueBright;
|
|
58
|
+
break;
|
|
59
|
+
case 'medium':
|
|
60
|
+
color = chalk.yellowBright;
|
|
61
|
+
break;
|
|
62
|
+
case 'high':
|
|
63
|
+
color = chalk.redBright;
|
|
64
|
+
break;
|
|
65
|
+
default:
|
|
66
|
+
color = chalk.whiteBright;
|
|
67
|
+
break;
|
|
55
68
|
}
|
|
69
|
+
const issueUrl = `https://snyk.io/vuln/${issueId}`;
|
|
70
|
+
const issueText = color(`✗ ${title} [${severity}]`);
|
|
71
|
+
result.push(issueText);
|
|
72
|
+
result.push(` ${issueUrl}`);
|
|
73
|
+
result.push(` in ${pkgName}@${pkgVersion}`);
|
|
74
|
+
result.push(` ${fix}`);
|
|
75
|
+
}
|
|
76
|
+
if (issues.length) {
|
|
77
|
+
result.push('');
|
|
56
78
|
}
|
|
79
|
+
const issuesFound = issues.length > 0
|
|
80
|
+
? chalk.redBright(issuesCount)
|
|
81
|
+
: chalk.greenBright(issuesCount);
|
|
82
|
+
result.push(`Tested ${depCount} for known issues, found ${issuesFound}.\n`);
|
|
57
83
|
return result;
|
|
58
84
|
}
|
|
59
85
|
function displayErrors(errors) {
|
|
60
86
|
const result = [];
|
|
61
87
|
if (errors.length) {
|
|
62
|
-
result.push('Errors');
|
|
63
|
-
result.push('------');
|
|
88
|
+
result.push(chalk.redBright('Errors'));
|
|
64
89
|
}
|
|
65
90
|
for (const error of errors) {
|
|
66
91
|
result.push(error);
|
|
67
92
|
}
|
|
93
|
+
if (result.length) {
|
|
94
|
+
result.push('');
|
|
95
|
+
}
|
|
68
96
|
return result;
|
|
69
97
|
}
|
|
70
|
-
async function display(scanResults, testResults, errors) {
|
|
98
|
+
async function display(scanResults, testResults, errors, options) {
|
|
71
99
|
try {
|
|
72
|
-
const result =
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
result.push(...displayTestResults(testResults));
|
|
77
|
-
if (errors.length && result.length) {
|
|
78
|
-
result.push('');
|
|
100
|
+
const result = [];
|
|
101
|
+
if (options === null || options === void 0 ? void 0 : options.debug) {
|
|
102
|
+
const fingerprintLines = displayFingerprints(scanResults);
|
|
103
|
+
result.push(...fingerprintLines);
|
|
79
104
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
105
|
+
for (const testResult of testResults) {
|
|
106
|
+
const depGraph = dep_graph_1.createFromJSON(testResult.depGraphData);
|
|
107
|
+
const dependencyLines = displayDependencies(depGraph);
|
|
108
|
+
result.push(...dependencyLines);
|
|
109
|
+
const issueLines = displayIssues(depGraph, testResult.issues, testResult.issuesData);
|
|
110
|
+
result.push(...issueLines);
|
|
83
111
|
}
|
|
112
|
+
const errorLines = displayErrors(errors);
|
|
113
|
+
result.push(...errorLines);
|
|
84
114
|
return result.join('\n');
|
|
85
115
|
}
|
|
86
116
|
catch (error) {
|
package/dist/display.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../lib/display.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../lib/display.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+CAA2D;AAC3D,iCAA0B;AAG1B,MAAM,KAAK,GAAG,eAAK,CAAC,iBAAiB,CAAC,CAAC;AAEvC,SAAS,mBAAmB,CAAC,WAAyB;IACpD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,WAAW,EAAE;QACxC,KAAK,MAAM,EAAE,IAAI,G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,MAAM,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC;SAClC;QACD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YACpC,MAAM,QAAQ,GAAG,0BAAc,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YACzD,MAAM,eAAe,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YACtD,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;YAChC,MAAM,UAAU,GAAG,aAAa,CAC9B,QAAQ,EACR,UAAU,CAAC,MAAM,EACjB,UAAU,CAAC,UAAU,CACtB,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;SAC5B;QACD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC1B;IAAC,OAAO,KAAK,EAAE;QACd,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,4BAA4B,GAAG,KAAK,CAAC,CAAC;QAC7D,OAAO,2BAA2B,CAAC;KACpC;AACH,CAAC;AA9BD,0BA8BC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { display } from './display';
|
|
2
2
|
import { scan } from './scan';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
3
|
+
import { PluginResponse, Fingerprint, Options, TestResult, ScanResult, SupportFileExtensions } from './types';
|
|
4
|
+
export { PluginResponse, Fingerprint, Options, TestResult, ScanResult, SupportFileExtensions, display, scan, };
|
package/dist/scan.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function scan(options: Options): Promise<
|
|
1
|
+
import { Options, PluginResponse } from './types';
|
|
2
|
+
export declare function scan(options: Options): Promise<PluginResponse>;
|
package/dist/scan.js
CHANGED
|
@@ -21,17 +21,18 @@ async function scan(options) {
|
|
|
21
21
|
hash: md5,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
{ type: 'cpp-fingerprints', data: fingerprints, meta: {} },
|
|
26
|
-
];
|
|
24
|
+
const facts = [{ type: 'cpp-fingerprints', data: fingerprints }];
|
|
27
25
|
const scanResults = [
|
|
28
26
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
facts,
|
|
28
|
+
identity: {
|
|
29
|
+
type: 'cpp',
|
|
30
|
+
},
|
|
32
31
|
},
|
|
33
32
|
];
|
|
34
|
-
return
|
|
33
|
+
return {
|
|
34
|
+
scanResults,
|
|
35
|
+
};
|
|
35
36
|
}
|
|
36
37
|
catch (error) {
|
|
37
38
|
throw new Error(`Could not scan C/C++ project, ${error}`);
|
package/dist/scan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../lib/scan.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,iCAA8B;AAC9B,iCAA8B;
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../lib/scan.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,iCAA8B;AAC9B,iCAA8B;AASvB,KAAK,UAAU,IAAI,CAAC,OAAgB;IACzC,IAAI;QACF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACjB,MAAM,mCAAmC,CAAC;SAC3C;QACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAChC,MAAM,IAAI,OAAO,CAAC,IAAI,mBAAmB,CAAC;SAC3C;QACD,MAAM,SAAS,GAAG,MAAM,WAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,YAAY,GAAkB,EAAE,CAAC;QACvC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAChC,MAAM,GAAG,GAAG,MAAM,WAAI,CAAC,QAAQ,CAAC,CAAC;YACjC,YAAY,CAAC,IAAI,CAAC;gBAChB,QAAQ;gBACR,IAAI,EAAE,GAAG;aACV,CAAC,CAAC;SACJ;QACD,MAAM,KAAK,GAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QAC1E,MAAM,WAAW,GAAiB;YAChC;gBACE,KAAK;gBACL,QAAQ,EAAE;oBACR,IAAI,EAAE,KAAK;iBACZ;aACF;SACF,CAAC;QACF,OAAO;YACL,WAAW;SACZ,CAAC;KACH;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;KAC3D;AACH,CAAC;AAhCD,oBAgCC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
import { DepGraphData } from '@snyk/dep-graph';
|
|
2
2
|
export declare const SupportFileExtensions: string[];
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
data: any;
|
|
6
|
-
meta: {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
};
|
|
3
|
+
export interface PluginResponse {
|
|
4
|
+
scanResults: ScanResult[];
|
|
9
5
|
}
|
|
10
6
|
export interface ScanResult {
|
|
7
|
+
identity: Identity;
|
|
8
|
+
facts: Facts[];
|
|
9
|
+
name?: string;
|
|
10
|
+
policy?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Identity {
|
|
11
13
|
type: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
[key: string]:
|
|
14
|
+
targetFile?: string;
|
|
15
|
+
args?: {
|
|
16
|
+
[key: string]: string;
|
|
15
17
|
};
|
|
16
18
|
}
|
|
19
|
+
export interface Facts {
|
|
20
|
+
type: string;
|
|
21
|
+
data: any;
|
|
22
|
+
}
|
|
17
23
|
export interface Fingerprint {
|
|
18
24
|
filePath: string;
|
|
19
25
|
hash: string;
|
|
20
26
|
}
|
|
21
27
|
export interface Options {
|
|
22
28
|
path: string;
|
|
29
|
+
debug?: boolean;
|
|
23
30
|
}
|
|
24
|
-
export interface
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
version: string;
|
|
31
|
-
};
|
|
32
|
-
issues: {
|
|
33
|
-
[issueId: string]: {
|
|
34
|
-
issueId: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|
|
31
|
+
export interface Issue {
|
|
32
|
+
pkgName: string;
|
|
33
|
+
pkgVersion?: string;
|
|
34
|
+
issueId: string;
|
|
35
|
+
fixInfo: {
|
|
36
|
+
nearestFixedInVersion?: string;
|
|
38
37
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
}
|
|
39
|
+
export interface IssuesData {
|
|
40
|
+
[issueId: string]: {
|
|
41
|
+
id: string;
|
|
42
|
+
severity: string;
|
|
43
|
+
title: string;
|
|
45
44
|
};
|
|
46
45
|
}
|
|
46
|
+
export interface TestResult {
|
|
47
|
+
issues: Issue[];
|
|
48
|
+
issuesData: IssuesData;
|
|
49
|
+
depGraphData: DepGraphData;
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@snyk/dep-graph": "^1.19.3",
|
|
33
|
+
"chalk": "^4.1.0",
|
|
33
34
|
"debug": "^4.1.1",
|
|
34
35
|
"tslib": "^2.0.0"
|
|
35
36
|
},
|
|
@@ -48,5 +49,5 @@
|
|
|
48
49
|
"tsc-watch": "^4.2.9",
|
|
49
50
|
"typescript": "^3.9.7"
|
|
50
51
|
},
|
|
51
|
-
"version": "
|
|
52
|
+
"version": "2.0.0"
|
|
52
53
|
}
|