Skip to content

Commit 25c0b1b

Browse files
fraxkentony-go
andauthored
chore: version 0.9.0 (#89)
* chore: start impleting new NodeSecure back-end * refactor: complete revamp of CLI commands * chore: update NodeSecure dependencies * refactor(lang): use new i18n.getLanguages method * chore: setup scanner Logger and old tree walker Spinners * chore: update @nodesecure/scanner (1.3.0 to 1.4.0) * chore: update @nodesecure/flags (1.0.0 to 1.1.0) * test: make it work with ESM * fix: front-end build * fix(httpServer): always open link when the server is listening * fix: Emojis legend menu * chore: update dependencies * chore: debug on CLIUI * ci: remove Node.js v12 and v15 * docs: update README * refactor(startHTTPServer): add options object & add openLink option * test: utils.js * test(commands): add summary test * refactor(test): use tape instead of jest * fix: eslint V7+ issue * chore: update dependencies * chore: update @nodesecure/scanner (1.5.0 to 2.0.0) * refactor: use @nodesecure/utils & enhance author management * chore: update @nodesecure/flags (1.2.0 to 2.0.0) * chore: update @nodesecure/scanner (2.0.1 to 2.1.0) * chore: use flags v2 and new scanner flags * refactor: use @nodesecure/vis-network * refactor(http): clean code - split controllers / middleware (#90) * chore(http): use http-server folder * chore(http): move root route * test(http): add first test * chore: add updated package.json * chore(http): finish root tests * chore: create context (AsyncLocalStorage) * feat(http): split data endpoint * chore(http): port middleware in split file * chore(http): remove useless spec test * chore(http): fix naming for root import * chore(http): add flags * revert: remove sinon deps * chore: add missing import comment * fix: move bundlephobia call in the backend (#92) * feat: add new routes and handle error * fix: pass httpie error to polka * feat: replace request * fix: delete forgotten console.log * revert: port context * fix(bundle): support for org namespace * chore: update dependencies * chore(cli): fix few minor issues Co-authored-by: Tony Gorez <[email protected]>
1 parent 4e0c536 commit 25c0b1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+10401
-8826
lines changed

.editorconfig

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
# Editor configuration, see https://editorconfig.org
12
root = true
23

34
[*]
4-
indent_size = 4
5-
indent_style = space
6-
end_of_line = lf
75
charset = utf-8
8-
trim_trailing_whitespace = true
6+
indent_style = space
7+
indent_size = 2
98
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
end_of_line = lf
11+
12+
[*.md]
13+
max_line_length = off
14+
trim_trailing_whitespace = false

.eslintrc

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
2-
"extends": "@slimio/eslint-config",
3-
"rules": {
4-
"jsdoc/require-jsdoc": "off",
5-
"require-atomic-updates": "off",
6-
"arrow-body-style": "off",
7-
"new-cap": "off",
8-
"no-invalid-this": "off"
2+
"extends": "@nodesecure/eslint-config",
3+
"parserOptions": {
4+
"sourceType": "module",
5+
"requireConfigFile": false
96
}
107
}

.github/workflows/nodejs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
node-version: [12.x, 14.x, 15.x]
24+
node-version: [14.x, 16.x]
2525
fail-fast: false
2626
steps:
2727
- uses: actions/checkout@v2

FLAGS.md

-231
This file was deleted.

README.md

+8-37
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<a href="https://www.npmjs.com/package/nsecure"><img src="https://img.shields.io/github/license/ES-Community/nsecure?style=flat-square" alt="license"></a>
1212
<a href="https://github.com/ES-Community/nsecure/actions?query=workflow%3A%22Node.js+CI%22"><img src="https://img.shields.io/github/workflow/status/ES-Community/nsecure/Node.js%20CI/master?style=flat-square" alt="github ci workflow"></a>
1313
<a href="https://codecov.io/github/ES-Community/nsecure"><img src="https://img.shields.io/codecov/c/github/ES-Community/nsecure.svg?style=flat-square" alt="codecov"></a>
14-
<a href="https://www.npmjs.com/package/nsecure"><img src="https://img.shields.io/david/ES-Community/nsecure?style=flat-square" alt="dependencies"></a>
1514
<a href="./SECURITY.md"><img src="https://img.shields.io/badge/Security-Responsible%20Disclosure-yellow.svg?style=flat-square" alt="Responsible Disclosure Policy" /></a>
1615
<a href="https://www.npmjs.com/package/nsecure"><img src="https://img.shields.io/npm/dw/nsecure?style=flat-square" alt="downloads"></a>
1716
</p>
@@ -21,15 +20,15 @@
2120
<img src="https://i.imgur.com/3xnTGBl.png">
2221
</p>
2322

24-
## About
23+
## 📢 About
2524

2625
[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).
2726

2827
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:
2928

3029
- [NodeSecure G.Drive Design document](https://docs.google.com/document/d/1853Uwup9mityAYqAOnen1KSqSA6hlBgpKU0u0ygGY4Y/edit?usp=sharing)
3130

32-
## Features
31+
## 📜 Features
3332

3433
- 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.).
3534
- 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
3938
- Add flags to each packages versions to identify well known patterns and potential security threats easily.
4039
- Analyze npm packages and local Node.js projects.
4140

42-
## Requirements
41+
## 🚧 Requirements
4342

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
4544

46-
## Getting Started
45+
## 💃 Getting Started
4746

4847
```bash
4948
$ npm install nsecure -g
@@ -66,7 +65,7 @@ $ nsecure auto express
6665

6766
> ⚠️ 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.
6867
69-
## Usage example
68+
## 👀 Usage example
7069

7170
To show the complete list of commands
7271
```bash
@@ -136,35 +135,11 @@ $ npm config set "http://your-registry/"
136135
```
137136

138137
## 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-
async function main() {
146-
const toFetch = ["mocha", "cacache", "is-wsl"];
147-
const options = { verbose: false }; // disable verbose to not show the spinners
148-
149-
const payloads = await Promise.all(
150-
toFetch.map((name) => from(name, options))
151-
);
152-
153-
const toWritePromise = [];
154-
for (let i = 0; i < toFetch.length; i++) {
155-
const data = JSON.stringify(payloads[i], null, 2);
156-
toWritePromise.push(writeFile(`${toFetch[i]}.json`, data));
157-
}
158-
await Promise.allSettled(toWritePromise);
159-
}
160-
main().catch(console.error);
161-
```
162-
163-
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).
164139

165140
## Flags legends
166141

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).
168143

169144
## Searchbar filters
170145

@@ -220,9 +195,5 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
220195

221196
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
222197

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!
226-
227198
## License
228199
MIT

0 commit comments

Comments
 (0)