From 55c07615c624e3b55bb659ce43d372b938361dad Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 18 Mar 2022 20:29:31 -0400 Subject: nvdmirror: add CweListUrl --- nvdmirror/syncconfig.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'nvdmirror/syncconfig.go') 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 -- cgit v1.2.3