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/rfc/0006_multiscan.md
+40-7Lines changed: 40 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,24 @@
10
10
11
11
[summary]: #summary
12
12
13
-
Support multiple scanning tools.
13
+
Support grype as additional tool to scan for SBOMs.
14
14
15
15
# Motivation
16
16
17
17
[motivation]: #motivation
18
18
19
-
We want to add support for multiple scanning tools (such as grype) in order to enrich the vulnerability reports, making it more complete and accurate.
19
+
We want to add support for `grype` in order to enrich the vulnerability reports, making it more complete and accurate.
20
20
21
-
This will also allow us to be less vendor centric, since we are currently relying only on trivy to generate SBOMs and scan for vulnerabilities.
21
+
This will allow us to be vendor neutral, since we are currently relying only on `trivy` to generate SBOMs and scan for vulnerabilities.
22
+
23
+
Additionally, we discovered that `grype` is able to find more vulnerabilities than `trivy`. Below there's a recap about our research:
24
+
25
+
| image |`trivy`|`grype`|
26
+
|-------|---------|---------|
27
+
|`golang:1.12-alpine`| 45 | 210 |
28
+
|`nginx:1.21.0`| 396 | 522 |
29
+
|`redis:6.2.0-alpine`| 44 | 127 |
30
+
|`postgres:13.0-alpine`| 63 | 151 |
22
31
23
32
## Examples / User Stories
24
33
@@ -40,11 +49,9 @@ For the multiscan feature, we are going to double the following operations:
40
49
41
50
* sbom scan
42
51
43
-
This will let grype to generate its own report, so that we can then compare and merge with the one obtained with trivy.
52
+
This will let grype generate its own report, so that we can then compare and merge with the one obtained with trivy.
44
53
45
-
Since grype and trivy are different tools, we must to take care about their scan processes, synchronizing their flows, to be able to analyze and merge the results.
46
-
47
-
This will require a synchronization mechanism to allow both of them to generate and scan SBOMs. To achieve this, we must set a timeout for their execution and define a default tool from which to take the results. In this case, we can adopt the following logic to avoid starvation:
54
+
We can run the tools sequentially (1st trivy, 2nd grype) and then apply the following flow to decide what to return:
48
55
49
56
```
50
57
if trivy fails:
@@ -65,6 +72,32 @@ We already have defined our own `VulnerabilityReport` format [here](./0004_vulne
65
72
66
73
*`epss` is a list of Exploit Prediction Scoring System (EPSS) scores for the vulnerability.
67
74
75
+
*`risk` is the score of the risk.
76
+
77
+
*`licenses` is a list of the licenses used by all the components within the affected software.
78
+
79
+
In addition to that, we are going to optionally update/overwrite already existing fields retrivied from `trivy`, in case `grype` has better results:
80
+
81
+
*`cvss` version and scores.
82
+
83
+
*`references` with additional links.
84
+
85
+
*`description` if not provided by trivy.
86
+
87
+
We cannot be sure that both the tools will find the exact same results, for this reason we have to adopt the following merging strategy:
0 commit comments