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
Copy file name to clipboardExpand all lines: docs/learn/audit.md
+50-38Lines changed: 50 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,6 @@
2
2
3
3
An attempt to make security reports easier.
4
4
5
-
!!! danger "Outdated"
6
-
**This section will not be updated until V3.3**. To prevent updates from taking ages, as we've recently planned a full rewrite of this feature, we will not waste our time on fixing a feature that is not considered stable for use anyway.
7
-
**Avoid using audit as of now.**
8
-
9
-
!!! danger "Work in Progress feature"
10
-
This is an **experimental** feature. It is subject to changes, full rewrites, or even removals.
11
-
12
5
## Abstract
13
6
14
7
We will explain this with a real life example - I, the creator of F\*ckingNode, have been working on a mobile React Native app, which once became affected by a `low` severity vulnerability, related to cookies. The thing is, fixing it implied breaking changes (as `expo-router` had a dependency that had a dependency that had a... until one that depended on the vulnerable version).
@@ -23,8 +16,6 @@ However, as a mobile app that never interacted with cookies and very rarely used
23
16
24
17
## How it works
25
18
26
-
> AGAIN, THIS IS AN UNFINISHED, NON-RELEASED FEATURE.
27
-
28
19
The process is as follows:
29
20
30
21
- We analyze your vulnerabilities
@@ -38,21 +29,27 @@ Due to where nowadays society is heading, it _is_ worth noting questions are not
B -->|Parse JSON output| C[Stores text in a SV_KEYWORDS object]
34
+
B -->|Parse JSON output| G[Stores severities separately]
35
+
C -->|Analyzed| D[Questions asked to the user]
36
+
D -->|Analyzed, too| E[RF computed]
37
+
E -->|RF pondered| H(Final RISK FACTOR)
38
+
G -->|Numeric associations made| J[SB and SDB computed]
39
+
J -->|Used to ponder RF| H
40
+
H -->|Basic equation done| K[Human readable percentage and text result given to the end user]
44
41
```
45
42
46
-
We regularly audit your project and rely on `https://api.osv.dev` to get more details onto what is it about. After that, a more detailed analysis is made where we obtain **key questions** based on vectors.
43
+
We perform a regular audit your project, and then we realize a keyword analysis from where we obtain **key questions** based on vectors.
47
44
48
45
```mermaid
49
46
graph TD
50
-
A[ParsedNpmReport] -->|For each vulnerability| B[Pass key data to analyzer function]
47
+
A[ParsedNodeReport] -->|For each vulnerability| B[Pass key data to analyzer function]
51
48
B -->|Search for attack vectors via keywords| C(Keyword / vector found?)
52
49
C -- Yes --> D[Return 'beginner question' based on attack vector] --> F
53
50
C -- No --> E[No return] --> F
54
51
F[Was that the last one?]
55
-
F -- Yes --> G[Audit complete]
52
+
F -- Yes --> G[Questions ready for auditing]
56
53
F -- No --> B
57
54
```
58
55
@@ -72,30 +69,44 @@ graph TD
72
69
F -->|NO| H[Audit results are ready by this point.]
73
70
```
74
71
75
-
### Step three: evaluation
76
-
77
-
Your questions are evaluated using a straightforward positive-negative system: responses indicating 'positive' information add +1 to the positive count, while those indicating 'negative' information add +1 to the negative count.
72
+
Each question returns either `+1` or `+2` to be added to either the positive count or the negative count, as described right below.
78
73
79
-
These counts are used to compute the RF, based on the following formula:
There is a `--strict` flag that can be passed to the audit command that adds an additional **risk bump**, based on the severity of the most-severe identified vulnerability, as follows:
86
-
87
-
$$
88
-
Strict R.F. = \frac{R.F. + (R.B. \times 100)}{2}
89
-
$$
90
-
91
-
RB values are as follows:
74
+
### Step three: evaluation
92
75
93
-
| Severity | RB |
94
-
| :------- | ---: |
95
-
| critical | 1 |
96
-
| high | 0.75 |
97
-
| moderate | 0.5 |
98
-
| low | 0.25 |
76
+
Your questions are evaluated using a straightforward positive-negative system: responses indicating 'positive' information add up to the positive count, while those indicating 'negative' information add up to the negative count.
77
+
78
+
These counts and the SB and SDB values are used to compute the RF, a risk percentage where 0 means _safe to ignore security updates_ and 100 means _absolutely necessary to perform security updates_. The RF is computed based on the following formula. It is worth noting that, because of the unreliability of a non-human scan, we take a more complex approach so that we can intentionally increase the RF by pure mathematic means, using the SB and SDB.
@@ -115,4 +126,5 @@ Where `EXP` indicates experimental, `CAVEAT` indicates partial support / support
115
126
| v2.1.0 | EXP | NO | NO | NO | NO | NO | NO |
116
127
117
128
*[RF]: Risk Factor; a percentage computed by us to estimate the joint impact of all vulnerabilities of a NodeJS project.
118
-
*[RB]: Risk Bump; a 0.25-1 number that's used to bump the RF based on the highest severity (as in low/moderate/high/critical) of a found vulnerability within a project.
129
+
*[SB]: Severity Bump; a 1.25-2 number that's used to bump the RF based on the highest severity (as in low/moderate/high/critical) of a found vulnerability within a project.
130
+
*[SDB]: Severity DeBump; a 0.25-1 number that's used to de-bump the negative count prior computing the RF based on the highest severity (as in low/moderate/high/critical) of a found vulnerability within a project.
The `audit` command is a command that automatically runs a security audit for a project you specify (or for all projects if no name is specified), and interrogates security vulnerabilities (if any) to determine if they're worth fixing.
6
+
7
+
This is better explained [here](../learn/audit.md).
0 commit comments