@nodesecure/scanner 5.3.0 → 6.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/README.md +6 -116
- package/dist/class/logger.class.d.ts +27 -0
- package/dist/class/logger.class.d.ts.map +1 -0
- package/dist/class/logger.class.js +52 -0
- package/dist/class/logger.class.js.map +1 -0
- package/dist/comparePayloads.d.ts +66 -0
- package/dist/comparePayloads.d.ts.map +1 -0
- package/dist/comparePayloads.js +147 -0
- package/dist/comparePayloads.js.map +1 -0
- package/dist/depWalker.d.ts +10 -0
- package/dist/depWalker.d.ts.map +1 -0
- package/dist/depWalker.js +205 -0
- package/dist/depWalker.js.map +1 -0
- package/dist/i18n/english.d.ts +9 -0
- package/dist/i18n/english.d.ts.map +1 -0
- package/dist/i18n/english.js +6 -0
- package/dist/i18n/english.js.map +1 -0
- package/dist/i18n/french.d.ts +9 -0
- package/dist/i18n/french.d.ts.map +1 -0
- package/dist/i18n/french.js +6 -0
- package/dist/i18n/french.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/npmRegistry.d.ts +9 -0
- package/dist/npmRegistry.d.ts.map +1 -0
- package/dist/npmRegistry.js +125 -0
- package/dist/npmRegistry.js.map +1 -0
- package/dist/types.d.ts +216 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/addMissingVersionFlags.d.ts +3 -0
- package/dist/utils/addMissingVersionFlags.d.ts.map +1 -0
- package/dist/utils/addMissingVersionFlags.js +21 -0
- package/dist/utils/addMissingVersionFlags.js.map +1 -0
- package/dist/utils/dirname.d.ts +2 -0
- package/dist/utils/dirname.d.ts.map +1 -0
- package/dist/utils/dirname.js +8 -0
- package/dist/utils/dirname.js.map +1 -0
- package/dist/utils/getLinks.d.ts +7 -0
- package/dist/utils/getLinks.d.ts.map +1 -0
- package/dist/utils/getLinks.js +32 -0
- package/dist/utils/getLinks.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/urlToString.d.ts +2 -0
- package/dist/utils/urlToString.d.ts.map +1 -0
- package/dist/utils/urlToString.js +6 -0
- package/dist/utils/urlToString.js.map +1 -0
- package/dist/utils/warnings.d.ts +9 -0
- package/dist/utils/warnings.d.ts.map +1 -0
- package/dist/utils/warnings.js +49 -0
- package/dist/utils/warnings.js.map +1 -0
- package/package.json +23 -42
- package/LICENSE +0 -21
- package/i18n/english.js +0 -6
- package/i18n/french.js +0 -7
- package/index.d.ts +0 -14
- package/index.js +0 -74
- package/src/class/dependency.class.js +0 -113
- package/src/class/logger.class.js +0 -54
- package/src/constants.js +0 -13
- package/src/depWalker.js +0 -388
- package/src/manifest.js +0 -94
- package/src/npmRegistry.js +0 -168
- package/src/tarball.js +0 -210
- package/src/utils/addMissingVersionFlags.js +0 -24
- package/src/utils/analyzeDependencies.js +0 -71
- package/src/utils/booleanToFlags.js +0 -12
- package/src/utils/dirname.js +0 -9
- package/src/utils/filterDependencyKind.js +0 -44
- package/src/utils/getLinks.js +0 -36
- package/src/utils/getPackageName.js +0 -21
- package/src/utils/getTarballComposition.js +0 -38
- package/src/utils/index.js +0 -18
- package/src/utils/isGitDependency.js +0 -11
- package/src/utils/isSensitiveFile.js +0 -17
- package/src/utils/mergeDependencies.js +0 -30
- package/src/utils/parseManifestAuthor.js +0 -45
- package/src/utils/semver.js +0 -62
- package/src/utils/warnings.js +0 -44
- package/types/api.d.ts +0 -15
- package/types/logger.d.ts +0 -38
- package/types/scanner.d.ts +0 -251
- package/types/tarball.d.ts +0 -63
- package/types/walker.d.ts +0 -8
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import * as JSXRay from "@nodesecure/js-x-ray";
|
|
2
|
+
import * as Vulnera from "@nodesecure/vuln";
|
|
3
|
+
import type { SpdxFileLicenseConformance } from "@nodesecure/conformance";
|
|
4
|
+
import type { IlluminatedContact } from "@nodesecure/contact";
|
|
5
|
+
import type { Contact } from "@nodesecure/npm-types";
|
|
6
|
+
export type Maintainer = Contact & {
|
|
7
|
+
/**
|
|
8
|
+
* Path to publisher's avatar on "https://www.npmjs.com"
|
|
9
|
+
* @example /npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.LwimMJA3puF3ioGeS-tfczR3370GXBZMIL-bdpu4hOU
|
|
10
|
+
*/
|
|
11
|
+
npmAvatar?: string;
|
|
12
|
+
};
|
|
13
|
+
export type Publisher = Omit<Maintainer, "url"> & {
|
|
14
|
+
/**
|
|
15
|
+
* First version published.
|
|
16
|
+
*/
|
|
17
|
+
version: string;
|
|
18
|
+
/**
|
|
19
|
+
* Date of the first publication
|
|
20
|
+
* @example 2021-08-10T20:45:08.342Z
|
|
21
|
+
*/
|
|
22
|
+
at: string;
|
|
23
|
+
};
|
|
24
|
+
export interface DependencyLinks {
|
|
25
|
+
/** NPM Registry page */
|
|
26
|
+
npm: string;
|
|
27
|
+
/** Homepage URL */
|
|
28
|
+
homepage?: string;
|
|
29
|
+
/** VCS repository URL */
|
|
30
|
+
repository?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface Engines {
|
|
33
|
+
node?: string;
|
|
34
|
+
npm?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface Repository {
|
|
37
|
+
type: string;
|
|
38
|
+
url: string;
|
|
39
|
+
}
|
|
40
|
+
export interface DependencyVersion {
|
|
41
|
+
/** Id of the package (useful for usedBy relation) */
|
|
42
|
+
id: number;
|
|
43
|
+
isDevDependency: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Tell if the given package exist on the configured remote registry (npm by default)
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
existOnRemoteRegistry: boolean;
|
|
49
|
+
/** By whom (id) is used the package */
|
|
50
|
+
usedBy: Record<string, string>;
|
|
51
|
+
/** Size on disk of the extracted tarball (in bytes) */
|
|
52
|
+
size: number;
|
|
53
|
+
/** Count of dependencies */
|
|
54
|
+
dependencyCount: number;
|
|
55
|
+
/** Package description */
|
|
56
|
+
description: string;
|
|
57
|
+
/** Author of the package. This information is not trustable and can be empty. */
|
|
58
|
+
author: Maintainer | null;
|
|
59
|
+
engines: Engines;
|
|
60
|
+
repository?: Repository;
|
|
61
|
+
scripts: Record<string, string>;
|
|
62
|
+
/**
|
|
63
|
+
* JS-X-Ray warnings
|
|
64
|
+
*
|
|
65
|
+
* @see https://github.com/NodeSecure/js-x-ray/blob/master/WARNINGS.md
|
|
66
|
+
*/
|
|
67
|
+
warnings: JSXRay.Warning<JSXRay.WarningDefault>[];
|
|
68
|
+
alias: Record<string, string>;
|
|
69
|
+
/** Tarball composition (files and dependencies) */
|
|
70
|
+
composition: {
|
|
71
|
+
/** Files extensions (.js, .md, .exe etc..) */
|
|
72
|
+
extensions: string[];
|
|
73
|
+
files: string[];
|
|
74
|
+
/** Minified files (foo.min.js etc..) */
|
|
75
|
+
minified: string[];
|
|
76
|
+
required_files: string[];
|
|
77
|
+
required_thirdparty: string[];
|
|
78
|
+
required_nodejs: string[];
|
|
79
|
+
required_subpath: string[];
|
|
80
|
+
unused: string[];
|
|
81
|
+
missing: string[];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* All Licenses with their SPDX conformance
|
|
85
|
+
*/
|
|
86
|
+
licenses: SpdxFileLicenseConformance[];
|
|
87
|
+
uniqueLicenseIds: string[];
|
|
88
|
+
/**
|
|
89
|
+
* Flags (Array of string)
|
|
90
|
+
*
|
|
91
|
+
* @see https://github.com/NodeSecure/flags/blob/main/FLAGS.md
|
|
92
|
+
*/
|
|
93
|
+
flags: string[];
|
|
94
|
+
/**
|
|
95
|
+
* If the dependency is a GIT repository
|
|
96
|
+
*/
|
|
97
|
+
gitUrl: null | string;
|
|
98
|
+
/**
|
|
99
|
+
* Version MD5 integrity hash
|
|
100
|
+
* Generated by the scanner to verify manifest/tarball confusion
|
|
101
|
+
*
|
|
102
|
+
* (Not supported on GIT dependency)
|
|
103
|
+
*/
|
|
104
|
+
integrity?: string;
|
|
105
|
+
links?: DependencyLinks;
|
|
106
|
+
}
|
|
107
|
+
export interface Dependency {
|
|
108
|
+
/** NPM Registry metadata */
|
|
109
|
+
metadata: {
|
|
110
|
+
/** Number of releases published on npm */
|
|
111
|
+
publishedCount: number;
|
|
112
|
+
lastUpdateAt: Date;
|
|
113
|
+
/** Last version SemVer */
|
|
114
|
+
lastVersion: string;
|
|
115
|
+
hasChangedAuthor: boolean;
|
|
116
|
+
hasManyPublishers: boolean;
|
|
117
|
+
hasReceivedUpdateInOneYear: boolean;
|
|
118
|
+
/** Author of the package. This information is not trustable and can be empty. */
|
|
119
|
+
author: Maintainer | null;
|
|
120
|
+
/** Package home page */
|
|
121
|
+
homepage: string | null;
|
|
122
|
+
/**
|
|
123
|
+
* List of maintainers (list of people in the organization related to the package)
|
|
124
|
+
*/
|
|
125
|
+
maintainers: Maintainer[];
|
|
126
|
+
/**
|
|
127
|
+
* List of people who published this package
|
|
128
|
+
*/
|
|
129
|
+
publishers: Publisher[];
|
|
130
|
+
/**
|
|
131
|
+
* Version MD5 integrity hash
|
|
132
|
+
* Generated by the scanner to verify manifest/tarball confusion
|
|
133
|
+
*/
|
|
134
|
+
integrity: Record<string, string>;
|
|
135
|
+
};
|
|
136
|
+
/** List of versions of this package available in the dependency tree (In the payload) */
|
|
137
|
+
versions: Record<string, DependencyVersion>;
|
|
138
|
+
/**
|
|
139
|
+
* Vulnerabilities fetched dependending on the selected vulnerabilityStrategy
|
|
140
|
+
*
|
|
141
|
+
* @see https://github.com/NodeSecure/vuln
|
|
142
|
+
*/
|
|
143
|
+
vulnerabilities: Vulnera.Strategy.StandardVulnerability[];
|
|
144
|
+
}
|
|
145
|
+
export type Dependencies = Record<string, Dependency>;
|
|
146
|
+
export interface Payload {
|
|
147
|
+
/** Payload unique id */
|
|
148
|
+
id: string;
|
|
149
|
+
/** Name of the analyzed package */
|
|
150
|
+
rootDependencyName: string;
|
|
151
|
+
/** Global warnings list */
|
|
152
|
+
warnings: string[];
|
|
153
|
+
highlighted: {
|
|
154
|
+
contacts: IlluminatedContact[];
|
|
155
|
+
};
|
|
156
|
+
/** All the dependencies of the package (flattened) */
|
|
157
|
+
dependencies: Dependencies;
|
|
158
|
+
/** Version of the scanner used to generate the result */
|
|
159
|
+
scannerVersion: string;
|
|
160
|
+
/** Vulnerability strategy name (npm, snyk, node) */
|
|
161
|
+
vulnerabilityStrategy: Vulnera.Strategy.Kind;
|
|
162
|
+
}
|
|
163
|
+
export interface Options {
|
|
164
|
+
/**
|
|
165
|
+
* Maximum tree depth
|
|
166
|
+
*
|
|
167
|
+
* @default 4
|
|
168
|
+
*/
|
|
169
|
+
readonly maxDepth?: number;
|
|
170
|
+
readonly registry?: string | URL;
|
|
171
|
+
/**
|
|
172
|
+
* Enables the use of Arborist for rapidly walking over the dependency tree.
|
|
173
|
+
* When enabled, it triggers different methods based on the presence of `node_modules`:
|
|
174
|
+
* - `loadActual()` if `node_modules` is available.
|
|
175
|
+
* - `loadVirtual()` otherwise.
|
|
176
|
+
*
|
|
177
|
+
* When disabled, it will iterate on all dependencies by using pacote
|
|
178
|
+
*/
|
|
179
|
+
packageLock?: {
|
|
180
|
+
/**
|
|
181
|
+
* Fetches all manifests for additional metadata.
|
|
182
|
+
* This option is useful only when `usePackageLock` is enabled.
|
|
183
|
+
*
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
fetchManifest?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Specifies the location of the manifest file for Arborist.
|
|
189
|
+
* This is typically the path to the `package.json` file.
|
|
190
|
+
*/
|
|
191
|
+
location: string;
|
|
192
|
+
};
|
|
193
|
+
highlight?: {
|
|
194
|
+
contacts: Contact[];
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Include project devDependencies (only available for cwd command)
|
|
198
|
+
*
|
|
199
|
+
* @default false
|
|
200
|
+
*/
|
|
201
|
+
readonly includeDevDeps?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Vulnerability strategy name (npm, snyk, node)
|
|
204
|
+
*
|
|
205
|
+
* @default NONE
|
|
206
|
+
*/
|
|
207
|
+
readonly vulnerabilityStrategy?: Vulnera.Strategy.Kind;
|
|
208
|
+
/**
|
|
209
|
+
* Analyze root package.
|
|
210
|
+
*
|
|
211
|
+
* @default false for from() API
|
|
212
|
+
* @default true for cwd() API
|
|
213
|
+
*/
|
|
214
|
+
readonly scanRootNode?: boolean;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,GAAG;IAChD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;I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":3,"file":"addMissingVersionFlags.d.ts","sourceRoot":"","sources":["../../src/utils/addMissingVersionFlags.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,wBAAiB,sBAAsB,CACrC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,GAAG,EAAE,UAAU,GACd,gBAAgB,CAAC,MAAM,CAAC,CAmB1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// TODO: add strict flags type
|
|
2
|
+
export function* addMissingVersionFlags(flags, dep) {
|
|
3
|
+
const { metadata, vulnerabilities = [], versions } = dep;
|
|
4
|
+
const semverVersions = Object.keys(versions);
|
|
5
|
+
if (!metadata.hasReceivedUpdateInOneYear && flags.has("hasOutdatedDependency") && !flags.has("isDead")) {
|
|
6
|
+
yield "isDead";
|
|
7
|
+
}
|
|
8
|
+
if (metadata.hasManyPublishers && !flags.has("hasManyPublishers")) {
|
|
9
|
+
yield "hasManyPublishers";
|
|
10
|
+
}
|
|
11
|
+
if (metadata.hasChangedAuthor && !flags.has("hasChangedAuthor")) {
|
|
12
|
+
yield "hasChangedAuthor";
|
|
13
|
+
}
|
|
14
|
+
if (vulnerabilities.length > 0 && !flags.has("hasVulnerabilities")) {
|
|
15
|
+
yield "hasVulnerabilities";
|
|
16
|
+
}
|
|
17
|
+
if (semverVersions.length > 1 && !flags.has("hasDuplicate")) {
|
|
18
|
+
yield "hasDuplicate";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=addMissingVersionFlags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addMissingVersionFlags.js","sourceRoot":"","sources":["../../src/utils/addMissingVersionFlags.ts"],"names":[],"mappings":"AAGA,8BAA8B;AAC9B,MAAM,SAAS,CAAC,CAAC,sBAAsB,CACrC,KAAkB,EAClB,GAAe;IAEf,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;IACzD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE7C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,IAAI,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvG,MAAM,QAAQ,CAAC;IACjB,CAAC;IACD,IAAI,QAAQ,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAClE,MAAM,mBAAmB,CAAC;IAC5B,CAAC;IACD,IAAI,QAAQ,CAAC,gBAAgB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAChE,MAAM,kBAAkB,CAAC;IAC3B,CAAC;IACD,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACnE,MAAM,oBAAoB,CAAC;IAC7B,CAAC;IACD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;QAC5D,MAAM,cAAc,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirname.d.ts","sourceRoot":"","sources":["../../src/utils/dirname.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAI3D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Import Node.js Dependencies
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname } from "node:path";
|
|
4
|
+
export function getDirNameFromUrl(url) {
|
|
5
|
+
const __filename = fileURLToPath(url);
|
|
6
|
+
return dirname(__filename);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=dirname.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirname.js","sourceRoot":"","sources":["../../src/utils/dirname.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,iBAAiB,CAAC,GAAiB;IACjD,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IAEtC,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLinks.d.ts","sourceRoot":"","sources":["../../src/utils/getLinks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA6B9D,wBAAgB,QAAQ,CACtB,gBAAgB,EAAE,gBAAgB;;;;EAcnC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// CONSTANTS
|
|
2
|
+
const kVCSHosts = new Set(["github.com", "gitlab.com"]);
|
|
3
|
+
function getVCSRepositoryURL(link) {
|
|
4
|
+
if (!link) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
const url = new URL(link);
|
|
9
|
+
const { hostname, pathname } = url;
|
|
10
|
+
if (kVCSHosts.has(hostname) === false) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const [owner, repo] = pathname.split("/").filter(Boolean).map((curr) => curr.replace(".git", ""));
|
|
14
|
+
return `https://${hostname}/${owner}/${repo}`;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function getLinks(packumentVersion) {
|
|
21
|
+
const homepage = packumentVersion.homepage || null;
|
|
22
|
+
const repositoryUrl = typeof packumentVersion.repository === "string" ?
|
|
23
|
+
packumentVersion.repository :
|
|
24
|
+
packumentVersion.repository?.url ?? null;
|
|
25
|
+
return {
|
|
26
|
+
npm: `https://www.npmjs.com/package/${packumentVersion.name}/v/${packumentVersion.version}`,
|
|
27
|
+
homepage,
|
|
28
|
+
repository: getVCSRepositoryURL(homepage) ??
|
|
29
|
+
getVCSRepositoryURL(repositoryUrl)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=getLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLinks.js","sourceRoot":"","sources":["../../src/utils/getLinks.ts"],"names":[],"mappings":"AAGA,YAAY;AACZ,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;AAExD,SAAS,mBAAmB,CAC1B,IAAmB;IAEnB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;QAEnC,IAAI,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;QAElG,OAAO,WAAW,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;IAChD,CAAC;IACD,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CACtB,gBAAkC;IAElC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,IAAI,IAAI,CAAC;IACnD,MAAM,aAAa,GAAG,OAAO,gBAAgB,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC;QACrE,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC7B,gBAAgB,CAAC,UAAU,EAAE,GAAG,IAAI,IAAI,CAAC;IAE3C,OAAO;QACL,GAAG,EAAE,iCAAiC,gBAAgB,CAAC,IAAI,MAAM,gBAAgB,CAAC,OAAO,EAAE;QAC3F,QAAQ;QACR,UAAU,EACR,mBAAmB,CAAC,QAAQ,CAAC;YAC7B,mBAAmB,CAAC,aAAa,CAAC;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./dirname.js";
|
|
2
|
+
export * from "./warnings.js";
|
|
3
|
+
export * from "./addMissingVersionFlags.js";
|
|
4
|
+
export * from "./getLinks.js";
|
|
5
|
+
export * from "./urlToString.js";
|
|
6
|
+
export declare const NPM_TOKEN: {
|
|
7
|
+
token: string;
|
|
8
|
+
} | {
|
|
9
|
+
token?: undefined;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AAEjC,eAAO,MAAM,SAAS;;;;CAElB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./dirname.js";
|
|
2
|
+
export * from "./warnings.js";
|
|
3
|
+
export * from "./addMissingVersionFlags.js";
|
|
4
|
+
export * from "./getLinks.js";
|
|
5
|
+
export * from "./urlToString.js";
|
|
6
|
+
export const NPM_TOKEN = typeof process.env.NODE_SECURE_TOKEN === "string" ?
|
|
7
|
+
{ token: process.env.NODE_SECURE_TOKEN } :
|
|
8
|
+
{};
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AAEjC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,QAAQ,CAAC,CAAC;IAC1E,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC1C,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlToString.d.ts","sourceRoot":"","sources":["../../src/utils/urlToString.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,GAAG,GAAG,GAChB,MAAM,CAIR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlToString.js","sourceRoot":"","sources":["../../src/utils/urlToString.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CACzB,GAAiB;IAEjB,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC;QAC9B,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzB,GAAG,CAAC,QAAQ,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IlluminatedContact } from "@nodesecure/contact";
|
|
2
|
+
import type { Contact } from "@nodesecure/npm-types";
|
|
3
|
+
import type { Dependency } from "../types.js";
|
|
4
|
+
export interface GetWarningsResult {
|
|
5
|
+
warnings: string[];
|
|
6
|
+
illuminated: IlluminatedContact[];
|
|
7
|
+
}
|
|
8
|
+
export declare function getDependenciesWarnings(dependenciesMap: Map<string, Dependency>, highlightContacts?: Contact[]): Promise<GetWarningsResult>;
|
|
9
|
+
//# sourceMappingURL=warnings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../src/utils/warnings.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAoB9C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAED,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACxC,iBAAiB,GAAE,OAAO,EAAO,GAChC,OAAO,CAAC,iBAAiB,CAAC,CAoC5B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Import Node.js Dependencies
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
// Import Third-party Dependencies
|
|
4
|
+
import * as i18n from "@nodesecure/i18n";
|
|
5
|
+
import * as RC from "@nodesecure/rc";
|
|
6
|
+
import { ContactExtractor } from "@nodesecure/contact";
|
|
7
|
+
// Import Internal Dependencies
|
|
8
|
+
import { getDirNameFromUrl } from "./dirname.js";
|
|
9
|
+
await i18n.extendFromSystemPath(path.join(getDirNameFromUrl(import.meta.url), "..", "i18n"));
|
|
10
|
+
// CONSTANTS
|
|
11
|
+
const kDetectedDep = i18n.taggedString `The dependency '${0}' has been detected in the dependency Tree.`;
|
|
12
|
+
const kDefaultIlluminatedContacts = [
|
|
13
|
+
{
|
|
14
|
+
name: "marak",
|
|
15
|
+
email: "marak.squires@gmail.com"
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
const kDependencyWarnMessage = {
|
|
19
|
+
"@scarf/scarf": await i18n.getToken("scanner.disable_scarf"),
|
|
20
|
+
iohook: await i18n.getToken("scanner.keylogging")
|
|
21
|
+
};
|
|
22
|
+
export async function getDependenciesWarnings(dependenciesMap, highlightContacts = []) {
|
|
23
|
+
const vulnerableDependencyNames = Object.keys(kDependencyWarnMessage);
|
|
24
|
+
const warnings = vulnerableDependencyNames
|
|
25
|
+
.flatMap((name) => (dependenciesMap.has(name) ? `${kDetectedDep(name)} ${kDependencyWarnMessage[name]}` : []));
|
|
26
|
+
const dependencies = Object.create(null);
|
|
27
|
+
for (const [packageName, dependency] of dependenciesMap) {
|
|
28
|
+
const { author, maintainers } = dependency.metadata;
|
|
29
|
+
dependencies[packageName] = {
|
|
30
|
+
maintainers,
|
|
31
|
+
...(author === null ? {} : { author })
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const memoizedConfig = RC.memoized();
|
|
35
|
+
const extractor = new ContactExtractor({
|
|
36
|
+
highlight: [
|
|
37
|
+
...highlightContacts,
|
|
38
|
+
...(memoizedConfig === null ?
|
|
39
|
+
[] : (memoizedConfig.scanner?.highlight?.contacts ?? [])),
|
|
40
|
+
...kDefaultIlluminatedContacts
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
const illuminated = extractor.fromDependencies(dependencies);
|
|
44
|
+
return {
|
|
45
|
+
warnings,
|
|
46
|
+
illuminated
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=warnings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../src/utils/warnings.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,kCAAkC;AAClC,OAA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,IAAI,eAAe,EAAE,CAAC;QACxD,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC;QAEpD,YAAY,CAAC,WAAW,CAAC,GAAG;YAC1B,WAAW;YACX,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;SACvC,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC;QACrC,SAAS,EAAE;YACT,GAAG,iBAAiB;YACpB,GAAG,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC;gBAC3B,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,EAAE,CAAC,CACzD;YACD,GAAG,2BAA2B;SAC/B;KACF,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,SAAS,CAAC,gBAAgB,CAC5C,YAAY,CACb,CAAC;IAEF,OAAO;QACL,QAAQ;QACR,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodesecure/scanner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "A package API to run a static analysis of your module's dependencies.",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
6
8
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
9
|
+
"node": ">=20"
|
|
8
10
|
},
|
|
9
11
|
"scripts": {
|
|
12
|
+
"build": "tsc -b",
|
|
10
13
|
"lint": "eslint src test",
|
|
11
|
-
"prepublishOnly": "pkg-ok",
|
|
12
|
-
"test": "npm run
|
|
13
|
-
"test
|
|
14
|
-
"test-only": "glob -c \"node --test-reporter=spec --test\" \"./test/**/*.spec.js\"",
|
|
14
|
+
"prepublishOnly": "npm run build && pkg-ok",
|
|
15
|
+
"test": "npm run test-only",
|
|
16
|
+
"test-only": "glob -c \"tsx --test\" \"./test/**/*.spec.ts\"",
|
|
15
17
|
"coverage": "c8 -r html npm run test-only"
|
|
16
18
|
},
|
|
17
19
|
"files": [
|
|
18
|
-
"
|
|
19
|
-
"i18n",
|
|
20
|
-
"types",
|
|
21
|
-
"index.js",
|
|
22
|
-
"index.d.ts"
|
|
20
|
+
"dist"
|
|
23
21
|
],
|
|
24
22
|
"repository": {
|
|
25
23
|
"type": "git",
|
|
@@ -48,38 +46,21 @@
|
|
|
48
46
|
"bugs": {
|
|
49
47
|
"url": "https://github.com/NodeSecure/scanner/issues"
|
|
50
48
|
},
|
|
51
|
-
"homepage": "https://github.com/NodeSecure/scanner#readme",
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"@nodesecure/eslint-config": "^1.8.0",
|
|
54
|
-
"@slimio/is": "^2.0.0",
|
|
55
|
-
"@types/node": "^20.10.0",
|
|
56
|
-
"c8": "^8.0.1",
|
|
57
|
-
"dotenv": "^16.3.1",
|
|
58
|
-
"eslint": "8.37.0",
|
|
59
|
-
"get-folder-size": "^4.0.0",
|
|
60
|
-
"glob": "^10.3.10",
|
|
61
|
-
"pkg-ok": "^3.0.0",
|
|
62
|
-
"sinon": "^17.0.1",
|
|
63
|
-
"snap-shot-core": "^10.2.4"
|
|
64
|
-
},
|
|
49
|
+
"homepage": "https://github.com/NodeSecure/tree/master/workspaces/scanner#readme",
|
|
65
50
|
"dependencies": {
|
|
66
|
-
"@nodesecure/
|
|
51
|
+
"@nodesecure/conformance": "^1.0.0",
|
|
67
52
|
"@nodesecure/flags": "^2.4.0",
|
|
68
|
-
"@nodesecure/
|
|
69
|
-
"@nodesecure/
|
|
70
|
-
"@nodesecure/
|
|
71
|
-
"@nodesecure/npm-registry-sdk": "^
|
|
72
|
-
"@nodesecure/
|
|
53
|
+
"@nodesecure/i18n": "^4.0.1",
|
|
54
|
+
"@nodesecure/js-x-ray": "^7.3.0",
|
|
55
|
+
"@nodesecure/mama": "^1.0.0",
|
|
56
|
+
"@nodesecure/npm-registry-sdk": "^3.0.0",
|
|
57
|
+
"@nodesecure/npm-types": "^1.1.0",
|
|
58
|
+
"@nodesecure/rc": "^3.0.0",
|
|
59
|
+
"@nodesecure/tarball": "^1.0.0",
|
|
60
|
+
"@nodesecure/tree-walker": "^1.0.0",
|
|
73
61
|
"@nodesecure/vuln": "^1.7.0",
|
|
74
|
-
"@
|
|
75
|
-
"
|
|
76
|
-
"@slimio/lock": "^1.0.0",
|
|
77
|
-
"builtins": "^5.0.1",
|
|
78
|
-
"combine-async-iterators": "^2.1.0",
|
|
79
|
-
"itertools": "^2.1.2",
|
|
80
|
-
"lodash.difference": "^4.5.0",
|
|
81
|
-
"pacote": "^17.0.4",
|
|
62
|
+
"@openally/mutex": "^1.0.0",
|
|
63
|
+
"pacote": "^18.0.6",
|
|
82
64
|
"semver": "^7.5.4"
|
|
83
|
-
}
|
|
84
|
-
"type": "module"
|
|
65
|
+
}
|
|
85
66
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 NodeSecure
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/i18n/english.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const scanner = {
|
|
2
|
-
disable_scarf: "This dependency could collect data against your consent so think to disable it with the env var: SCARF_ANALYTICS",
|
|
3
|
-
keylogging: "This dependency can retrieve your keyboard and mouse inputs. It can be used for 'keylogging' attacks/malwares."
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export default { scanner };
|
package/i18n/french.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const scanner = {
|
|
2
|
-
disable_scarf: "Cette dépendance peut récolter des données contre votre volonté, pensez donc à la désactiver en fournissant la variable d'environnement SCARF_ANALYTICS",
|
|
3
|
-
keylogging: "Cette dépendance peut obtenir vos entrées clavier ou de souris. Cette dépendance peut être utilisée en tant que 'keylogging' attacks/malwares."
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export default { scanner };
|
|
7
|
-
|
package/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Scanner from "./types/scanner.js";
|
|
2
|
-
import { cwd, from, verify, ScannerLoggerEvents } from "./types/api.js";
|
|
3
|
-
import { depWalker } from "./types/walker.js";
|
|
4
|
-
import { Logger, LoggerEventData } from "./types/logger.js";
|
|
5
|
-
import tarball from "./types/tarball.js";
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
cwd, from, verify, ScannerLoggerEvents,
|
|
9
|
-
Scanner,
|
|
10
|
-
Logger,
|
|
11
|
-
LoggerEventData,
|
|
12
|
-
tarball,
|
|
13
|
-
depWalker
|
|
14
|
-
}
|