Skip to content

Commit 546bc2a

Browse files
authored
Merge pull request #57 from micahhausler/readme-update
fix(readme): Fixed README example code and output
2 parents 23adb1b + 3be4c54 commit 546bc2a

File tree

1 file changed

+51
-26
lines changed

1 file changed

+51
-26
lines changed

README.md

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Go library for generating, consuming, and operating on VEX documents
66
[![PkgGoDev](https://pkg.go.dev/badge/github.com/openvex/go-vex)](https://pkg.go.dev/github.com/openvex/go-vex)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/openvex/go-vex)](https://goreportcard.com/report/github.com/openvex/go-vex)
88

9-
This repository contains the OpenVEX Go source code. This module lets
9+
This repository contains the OpenVEX Go source code. This module lets
1010
authors create, modify and manage VEX documents.
1111

12-
The full documentation for this module can be found at
12+
The full documentation for this module can be found at
1313
https://pkg.go.dev/github.com/openvex/go-vex.
1414

1515
For more information about the OpenVEX specification implemented by this module, check out the
@@ -48,25 +48,40 @@ func main() {
4848
// that our git image is not affected by CVE-2023-12345 and why:
4949
doc.Statements = append(doc.Statements, vex.Statement{
5050
// ... 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+
},
5658
},
5759

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",
6277
},
6378

6479
// ... choose one of the VEX status labels:
6580
Status: vex.StatusNotAffected,
6681

6782
// ... 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 ...",
7085
})
7186

7287
// Generate a canonical identifier for the VEX document:
@@ -81,27 +96,37 @@ Running this example renders the following simple VEX document:
8196

8297
```json
8398
{
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",
86101
"author": "Wolfi J. Inkinson",
87102
"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,
90105
"statements": [
91106
{
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+
},
93115
"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+
}
99125
],
100126
"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 ..."
103129
}
104130
]
105131
}
106-
107132
```

0 commit comments

Comments
 (0)