Skip to content

Commit b1f99f9

Browse files
committed
update rfc
Signed-off-by: Alessio Greggi <alessio.greggi@suse.com>
1 parent aaa616a commit b1f99f9

1 file changed

Lines changed: 40 additions & 7 deletions

File tree

docs/rfc/0006_multiscan.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,24 @@
1010

1111
[summary]: #summary
1212

13-
Support multiple scanning tools.
13+
Support grype as additional tool to scan for SBOMs.
1414

1515
# Motivation
1616

1717
[motivation]: #motivation
1818

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.
2020

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 |
2231

2332
## Examples / User Stories
2433

@@ -40,11 +49,9 @@ For the multiscan feature, we are going to double the following operations:
4049

4150
* sbom scan
4251

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.
4453

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:
4855

4956
```
5057
if trivy fails:
@@ -65,6 +72,32 @@ We already have defined our own `VulnerabilityReport` format [here](./0004_vulne
6572

6673
* `epss` is a list of Exploit Prediction Scoring System (EPSS) scores for the vulnerability.
6774

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:
88+
89+
```
90+
vuln_report
91+
for vuln in trivy.vulnerabilities:
92+
vuln_report add vuln
93+
if grype has vuln:
94+
vuln_report add grype.kev
95+
vuln_report add grype.epss
96+
...
97+
for vuln in grype.vulnerabilities:
98+
vuln_report add vuln
99+
```
100+
68101
# Drawbacks
69102

70103
[drawbacks]: #drawbacks

0 commit comments

Comments
 (0)