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
{{ message }}
This repository was archived by the owner on Nov 26, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+28-5Lines changed: 28 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,19 @@
1
1
# Gobinsec
2
2
3
-
This tool parses Go binary dependencies, calls NVD database to produce a vulnerability report for this binary.
3
+
This tool parses Go binary dependencies and calls [NVD database](https://nvd.nist.gov/) to produce a vulnerability report.
4
4
5
-
## Install
5
+
## Table of Contents
6
+
7
+
1.[Installation](#installation)
8
+
2.[Usage](#usage)
9
+
3.[Configuration](#configuration)
10
+
4.[Cache](#cache)
11
+
5.[Version](#versions)
12
+
6.[How to Fix Vulnerabilities](#how-to-fix-vulnerabilities)
13
+
7.[Data Source](#data-source)
14
+
8.[License](#license)
15
+
16
+
## Installation
6
17
7
18
Download binary for your platform in [latest release](https://github.com/intercloud/gobinsec/releases). Rename it *gobinsec*, make it executable with `chmod +x gobinsec` and move it somewhere in your *PATH*.
8
19
@@ -30,13 +41,15 @@ dependencies:
30
41
- '?'
31
42
```
32
43
33
-
Exit code is *1* if binary is vulnerable, *2* if there was an error analyzing binary and *0* otherwise. If binary is vulnerable, exposed vulnerabilities are printed in report.
44
+
You can pass more than one binary to check on command line.
45
+
46
+
Exit code is *1* if exposed vulnerabilities were found, *2* if there was an error analyzing a binary and *0* otherwise. If a binary is vulnerable, exposed vulnerabilities are printed in report.
34
47
35
48
You can pass *-verbose* option on command line to print vulnerability report, even if binary is not vulnerable and for all vulnerabilities, even if they are ignored or not exposed.
36
49
37
50
You can set *-strict* flag on command line so that vulnerabilities without version are considered matching vulnerability. In this case, you should check vulnerability manually and disable it in configuration file if necessary.
38
51
39
-
You can pass more than one binary on command line. In this case, there will be cache on calls to NVD database.
52
+
You can pass configuration file with *-config config.yml*, see configuration section below.
40
53
41
54
## Configuration
42
55
@@ -51,20 +64,30 @@ Configuration file is in YAML format as follows:
51
64
```yaml
52
65
api-key: "28c6112c-a7bc-4a4e-9b14-75be6da02211"
53
66
strict: false
67
+
memcached:
68
+
address: 127.0.0.1:11211
69
+
expiration: 86400
54
70
ignore:
55
71
- "CVE-2020-14040"
56
72
```
57
73
58
-
It has two entries:
74
+
Configuration fields are the following:
59
75
60
76
-**api-key**: this is your NVD API key
61
77
-**strict**: tells if we should consider vulnerability matches without version as matching dependency
78
+
-**memcached** is the configuration for *memcached*, with **address** and **expiration** time in seconds
62
79
-**ignore**: a list of CVE vulnerabilities to ignore
63
80
64
81
You can also set NVD API Key in your environment with variable *NVD_API_KEY*. This key may be overwritten with value in configuration file. Your API key must be set in environment to be able to run integration tests (with target *integ*).
65
82
66
83
Note that without API key, you will be limited to *10* requests in a rolling *60* second window while this limit is *100* with an API key.
67
84
85
+
## Cache
86
+
87
+
If you define the *memcached* configuration in your configuration file, *memcached* will be used to cache calls to NVD database. This is useful because if you perform more call that allowed, your calls will significantly slow down. An sample [docker-compose.yml](https://github.com/intercloud/gobinsec/blob/main/docker-compose.yml) to start a *memcached* instance is proposed in this project.
88
+
89
+
If you don't define the *memcached* configuration, the program will use a memory cache when you pass more than one binary to analyse on command line.
90
+
68
91
## Versions
69
92
70
93
Dependencies and vulnerabilities have versions. There are three types of them:
0 commit comments