aboutsummaryrefslogtreecommitdiff
path: root/nvdmirror/syncconfig.go
diff options
context:
space:
mode:
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