You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Node.js](https://nodejs.org/en/) security Command Line Interface. The goal of the project is to a design a CLI/API that will fetch and deeply analyze the dependency tree of a given **npm** package (Or a local project with a **package.json**) and output a **.json file** that will contains all metadata and flags about each packages. All this data will allow to quickly identify different issues across projects and packages (related to security and quality).
27
26
28
27
The CLI allow to load the JSON into a Webpage with the **open** command. The page will draw a Network of all dependencies with [vis.js](https://visjs.org/) (example in the screenshot above). We also wrote a little Google drive document a while ago that summarizes some of these points:
- Run an AST analysis on each .js/.mjs file in the packages tarball and sort out warnings (unsafe-regex, unsafe-import etc) and the complete list of required expr and statements (files, node.js module, etc.).
35
34
- Return complete composition for each packages (extensions, files, tarball size, etc).
@@ -39,11 +38,11 @@ The CLI allow to load the JSON into a Webpage with the **open** command. The pag
39
38
- Add flags to each packages versions to identify well known patterns and potential security threats easily.
40
39
- Analyze npm packages and local Node.js projects.
41
40
42
-
## Requirements
41
+
## 🚧 Requirements
43
42
44
-
-[Node.js](https://nodejs.org/en/)version 12.12.0 or higher
43
+
-[Node.js](https://nodejs.org/en/)LTS 16.x or higher
45
44
46
-
## Getting Started
45
+
## 💃 Getting Started
47
46
48
47
```bash
49
48
$ npm install nsecure -g
@@ -66,7 +65,7 @@ $ nsecure auto express
66
65
67
66
> ⚠️ Setup an [npm token](https://github.com/ES-Community/nsecure#private-packages--registry) to avoid hiting the maximum request limit of the npm registry API.
68
67
69
-
## Usage example
68
+
## 👀 Usage example
70
69
71
70
To show the complete list of commands
72
71
```bash
@@ -136,35 +135,11 @@ $ npm config set "http://your-registry/"
136
135
```
137
136
138
137
## API
139
-
Use nsecure as an API package to fetch and work with the generated JSON. The following example demonstrates how to retrieve the Payload for mocha, cacache and is-wsl packages. It's possible to use the **cwd** method if you want to achieve similar work on a local project.
140
-
141
-
```js
142
-
const { from } =require("nsecure");
143
-
const { writeFile } =require("fs").promises;
144
-
145
-
asyncfunctionmain() {
146
-
consttoFetch= ["mocha", "cacache", "is-wsl"];
147
-
constoptions= { verbose:false }; // disable verbose to not show the spinners
The SlimIO [Security project](https://github.com/SlimIO/Security) use nsecure with the API to analyze packages and repositories of a given github organization (or user).
138
+
Our back-end scanner package is available [here](https://github.com/NodeSecure/scanner).
164
139
165
140
## Flags legends
166
141
167
-
Flags and emojis legends are documented [here](./FLAGS.md).
142
+
Flags and emojis legends are documented [here](https://github.com/NodeSecure/flags/blob/main/FLAGS.md).
168
143
169
144
## Searchbar filters
170
145
@@ -220,9 +195,5 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
220
195
221
196
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
222
197
223
-
## Roadmap
224
-
225
-
We have created [a trello](https://trello.com/b/IY6lQ1A1/node-secure) so that we can plan long-term tasks. Do not hesitate to come participate and exchange your ideas!
0 commit comments