@@ -6,10 +6,10 @@ Go library for generating, consuming, and operating on VEX documents
6
6
[ ![ PkgGoDev] ( https://pkg.go.dev/badge/github.com/openvex/go-vex )] ( https://pkg.go.dev/github.com/openvex/go-vex )
7
7
[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/openvex/go-vex )] ( https://goreportcard.com/report/github.com/openvex/go-vex )
8
8
9
- This repository contains the OpenVEX Go source code. This module lets
9
+ This repository contains the OpenVEX Go source code. This module lets
10
10
authors create, modify and manage VEX documents.
11
11
12
- The full documentation for this module can be found at
12
+ The full documentation for this module can be found at
13
13
https://pkg.go.dev/github.com/openvex/go-vex .
14
14
15
15
For more information about the OpenVEX specification implemented by this module, check out the
@@ -48,25 +48,40 @@ func main() {
48
48
// that our git image is not affected by CVE-2023-12345 and why:
49
49
doc.Statements = append (doc.Statements , vex.Statement {
50
50
// ... define the vulnerability:
51
- Vulnerability: " CVE-2023-12345" ,
52
-
53
- // ... add an image as product:
54
- Products: []string {
55
- " pkg:oci/git@sha256:23a264e6e429852221a963e9f17338ba3f5796dc7086e46439a6f4482cf6e0cb" ,
51
+ Vulnerability: vex.Vulnerability {
52
+ ID: " https://nvd.nist.gov/vuln/detail/CVE-2021-44228" ,
53
+ Name: " CVE-2021-44228" ,
54
+ Description: " Remote code injection in Log4j" ,
55
+ Aliases: []vex.VulnerabilityID {
56
+ vex.VulnerabilityID (" GHSA-jfh8-c2jp-5v3q" ),
57
+ },
56
58
},
57
59
58
- // ... specify optional subcomponents:
59
- Subcomponents: []string {
60
- " pkg:apk/alpine/[email protected] ?arch=x86_64" ,
61
- " pkg:apk/alpine/[email protected] ?arch=ppc64le" ,
60
+ // ... add an image as product:
61
+ Products : []vex.Product {
62
+ {
63
+ Component: vex.Component {
64
+ ID:
" pkg:maven/org.springframework.boot/[email protected] " ,
65
+ Identifiers: map [vex.IdentifierType ]string {
66
+ vex.
PURL :
" pkg:maven/org.springframework.boot/[email protected] " ,
67
+ },
68
+ Hashes: map [vex.Algorithm ]vex.Hash {
69
+ vex.SHA256 : vex.Hash (" e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ),
70
+ },
71
+ },
72
+
73
+ // ... specify optional subcomponents:
74
+ // Subcomponents: []vex.Subcomponent{},
75
+ },
76
+ // "pkg:oci/git@sha256:23a264e6e429852221a963e9f17338ba3f5796dc7086e46439a6f4482cf6e0cb",
62
77
},
63
78
64
79
// ... choose one of the VEX status labels:
65
80
Status : vex.StatusNotAffected ,
66
81
67
82
// ... finally, a machine-readable justification and optional statement:
68
- Justification: vex.InlineMitigationsAlreadyExist ,
69
- ImpactStatement: " Included git is mitigated against CVE-2023-12345 ! " ,
83
+ Justification : vex.VulnerableCodeNotInExecutePath ,
84
+ ImpactStatement : " Spring Boot users are only affected by this vulnerability if they ... " ,
70
85
})
71
86
72
87
// Generate a canonical identifier for the VEX document:
@@ -81,27 +96,37 @@ Running this example renders the following simple VEX document:
81
96
82
97
``` json
83
98
{
84
- "@context" : " https://openvex.dev/ns" ,
85
- "@id" : " https://openvex.dev/docs/public/vex-a06f9de1ad1b1e555a33b2d0c1e7e6ecc4dc1800ff457c61ea09d8e97670d2a3 " ,
99
+ "@context" : " https://openvex.dev/ns/v0.2.0 " ,
100
+ "@id" : " https://openvex.dev/docs/public/vex-6ccf08fbf67f1489f201bb2b79a024b55d2ce07763098c78822f2f25283703d8 " ,
86
101
"author" : " Wolfi J. Inkinson" ,
87
102
"role" : " Senior VEXing Engineer" ,
88
- "timestamp" : " 2023-01-09T21:23:03.579712389-06 :00" ,
89
- "version" : " 1 " ,
103
+ "timestamp" : " 2023-09-21T15:32:30.728569-05 :00" ,
104
+ "version" : 1 ,
90
105
"statements" : [
91
106
{
92
- "vulnerability" : " CVE-2023-12345" ,
107
+ "vulnerability" : {
108
+ "@id" : " https://nvd.nist.gov/vuln/detail/CVE-2021-44228" ,
109
+ "name" : " CVE-2021-44228" ,
110
+ "description" : " Remote code injection in Log4j" ,
111
+ "aliases" : [
112
+ " GHSA-jfh8-c2jp-5v3q"
113
+ ]
114
+ },
93
115
"products" : [
94
- " pkg:oci/git@sha256:23a264e6e429852221a963e9f17338ba3f5796dc7086e46439a6f4482cf6e0cb"
95
- ],
96
- "subcomponents" : [
97
- " pkg:apk/alpine/[email protected] ?arch=x86_64" ,
98
- " pkg:apk/alpine/[email protected] ?arch=ppc64le"
116
+ {
117
+ "@id" :
" pkg:maven/org.springframework.boot/[email protected] " ,
118
+ "hashes" : {
119
+ "sha-256" : " e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
120
+ },
121
+ "identifiers" : {
122
+ "purl" :
" pkg:maven/org.springframework.boot/[email protected] "
123
+ }
124
+ }
99
125
],
100
126
"status" : " not_affected" ,
101
- "justification" : " inline_mitigations_already_exist " ,
102
- "impact_statement" : " Included git is mitigated against CVE-2023-12345 ! "
127
+ "justification" : " vulnerable_code_not_in_execute_path " ,
128
+ "impact_statement" : " Spring Boot users are only affected by this vulnerability if they ... "
103
129
}
104
130
]
105
131
}
106
-
107
132
```
0 commit comments