aboutsummaryrefslogtreecommitdiff
path: root/nvdmirror/syncconfig.go
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-03-18 20:29:31 -0400
committerPaul Duncan <pabs@pablotron.org>2022-03-18 20:29:31 -0400
commit55c07615c624e3b55bb659ce43d372b938361dad (patch)
tree837e5ffa06beae873cb2961ed4b09c659ea2f106 /nvdmirror/syncconfig.go
parent02463f370d3b1f29b3c991eb90abc53705d37f12 (diff)
downloadcvez-55c07615c624e3b55bb659ce43d372b938361dad.tar.bz2
cvez-55c07615c624e3b55bb659ce43d372b938361dad.zip
nvdmirror: add CweListUrl
Diffstat (limited to 'nvdmirror/syncconfig.go')
-rw-r--r--nvdmirror/syncconfig.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/nvdmirror/syncconfig.go b/nvdmirror/syncconfig.go
index 9cb5397..e80e12e 100644
--- a/nvdmirror/syncconfig.go
+++ b/nvdmirror/syncconfig.go
@@ -21,6 +21,9 @@ type SyncConfig struct {
// CISA known exploited vulnerabilities catalog (KEVC) URL.
CisaKevcUrl string
+ // Common Weakness Enumeration list URL.
+ CweListUrl string
+
// User agent string. Set to "" for default user agent string.
UserAgent string
@@ -37,6 +40,7 @@ var DefaultConfig = SyncConfig {
CpeMatch10BaseUrl: "https://nvd.nist.gov/feeds/json/cpematch/1.0",
Cpe23DictUrl: "https://nvd.nist.gov/feeds/xml/cpe/dictionary/official-cpe-dictionary_v2.3.xml.gz",
CisaKevcUrl: "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json",
+ CweListUrl: "https://cwe.mitre.org/data/xml/cwec_latest.xml.zip",
UserAgent: "cvez/0.1.0",
}
@@ -91,6 +95,15 @@ func (me SyncConfig) GetCisaKevcUrl() string {
}
}
+// Get CWE list URL.
+func (me SyncConfig) GetCweListUrl() string {
+ if len(me.CweListUrl) > 0 {
+ return me.CweListUrl
+ } else {
+ return DefaultConfig.CweListUrl
+ }
+}
+
// get meta URL map.
func (me SyncConfig) getMetaUrls() map[string]string {
// calculate total number of years