aboutsummaryrefslogtreecommitdiff
path: root/cpematch/cpematch.go
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-04 00:35:31 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-04 00:35:31 -0500
commit9c17b97cd0f83be3fff9fa4e87fd1d29052ea616 (patch)
tree0d97030a0d0c3ad983be281ce89f80571338887f /cpematch/cpematch.go
parent92400d731546557d110c9c3cc3906d700f83dda8 (diff)
downloadcvez-9c17b97cd0f83be3fff9fa4e87fd1d29052ea616.tar.bz2
cvez-9c17b97cd0f83be3fff9fa4e87fd1d29052ea616.zip
rename to github.com/pablotron/cvez, remove internal libs
Diffstat (limited to 'cpematch/cpematch.go')
-rw-r--r--cpematch/cpematch.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/cpematch/cpematch.go b/cpematch/cpematch.go
new file mode 100644
index 0000000..0bae622
--- /dev/null
+++ b/cpematch/cpematch.go
@@ -0,0 +1,31 @@
+// CPE match feed 1.0 parser.
+//
+// Latest CPE match feed available from here:
+// https://nvd.nist.gov/vuln/data-feeds#cpeMatch
+//
+// JSON schema available here:
+// https://csrc.nist.gov/schema/cpematch/feed/1.0/nvd_cpematch_feed_json_1.0.schema
+package cpematch
+
+// CPE name
+type Name struct {
+ Cpe22Uri string `json:"cpe22Uri"`
+ Cpe23Uri string `json:"cpe23Uri"`
+}
+
+// CPE match string or range
+type Match struct {
+ Vulnerable *bool `json:"vulnerable"`
+ Cpe22Uri string `json:"cpe22Uri"`
+ Cpe23Uri string `json:"cpe23Uri"`
+ VersionStartExcluding string `json:"versionStartExcluding"`
+ VersionStartIncluding string `json:"versionStartIncluding"`
+ VersionEndExcluding string `json:"versionEndExcluding"`
+ VersionEndIncluding string `json:"versionEndIncluding"`
+ Names []Name `json:"cpe_name"` // CPE match strings
+}
+
+// CPE matches
+type Matches struct {
+ Matches []Match `json:"matches"` // Array of CPE matches
+}