Documentation ¶
Index ¶
- Constants
- Variables
- func DownLoad(dir string) error
- func DownloadCWE() (string, error)
- func LoadCVE(fileDir, DbPath string, years ...int)
- func LoadCVEByFileName(fileName string, manager *cveresources.SqliteManager) (shouldExit bool, err error)
- func LoadCWE(cweXMLPath string) ([]*cveresources.CWE, error)
- func MakeSqlSentence(info *CVEQueryInfo) (string, []interface{})
- func QueryCVEYields(db *gorm.DB, opts ...CVEOption) chan *cveresources.CVE
- func SaveCWE(db *gorm.DB, cwes []*cveresources.CWE)
- type CVEOption
- func After(year int, data ...int) CVEOption
- func AfterByTimeStamp(timeStamp int64) CVEOption
- func Before(year int, data ...int) CVEOption
- func BeforeByTimeStamp(timeStamp int64) CVEOption
- func CPE(c string) CVEOption
- func CVE(id string) CVEOption
- func CWE(cwe string) CVEOption
- func Desc(flag bool) CVEOption
- func Limit(quantity int) CVEOption
- func Offset(start int) CVEOption
- func OrderBy(name string) CVEOption
- func Product(p string) CVEOption
- func ProductWithVersion(p string, v ...string) CVEOption
- func Score(score float64) CVEOption
- func Severity(level string) CVEOption
- func Strict(flag bool) CVEOption
- func Vendor(v string) CVEOption
- type CVEQueryInfo
Constants ¶
View Source
const ( // https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-modified.json.gz LatestCveModifiedDataFeed = "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-modified.json.gz" // https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-recent.json.gz LatestCveRecentDataFeed = "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-recent.json.gz" )
Variables ¶
View Source
var CveDataFeed = map[string]string{
"CVE-2002.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2002.json.gz",
"CVE-2003.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2003.json.gz",
"CVE-2004.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2004.json.gz",
"CVE-2005.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2005.json.gz",
"CVE-2006.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2006.json.gz",
"CVE-2007.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2007.json.gz",
"CVE-2008.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2008.json.gz",
"CVE-2009.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2009.json.gz",
"CVE-2010.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2010.json.gz",
"CVE-2011.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2011.json.gz",
"CVE-2012.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2012.json.gz",
"CVE-2013.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2013.json.gz",
"CVE-2014.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2014.json.gz",
"CVE-2015.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2015.json.gz",
"CVE-2016.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2016.json.gz",
"CVE-2017.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2017.json.gz",
"CVE-2018.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2018.json.gz",
"CVE-2019.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2019.json.gz",
"CVE-2020.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2020.json.gz",
"CVE-2021.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2021.json.gz",
"CVE-2022.json": "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2022.json.gz",
}
Functions ¶
func DownloadCWE ¶
func LoadCVEByFileName ¶
func LoadCVEByFileName(fileName string, manager *cveresources.SqliteManager) (shouldExit bool, err error)
func MakeSqlSentence ¶
func MakeSqlSentence(info *CVEQueryInfo) (string, []interface{})
func QueryCVEYields ¶
func QueryCVEYields(db *gorm.DB, opts ...CVEOption) chan *cveresources.CVE
Types ¶
type CVEOption ¶
type CVEOption func(info *CVEQueryInfo)
func AfterByTimeStamp ¶
func BeforeByTimeStamp ¶
func ProductWithVersion ¶
type CVEQueryInfo ¶
type CVEQueryInfo struct { CVE string CPE []cveresources.CPE CWE []string Vendors []string Products []string Severity []string ExploitScore float64 After time.Time Before time.Time Start int Quantity int OrderBy string Desc bool Strict bool }
func FixCVEProduct ¶ added in v1.2.3
func FixCVEProduct(cveQuery *CVEQueryInfo, db *gorm.DB) *CVEQueryInfo
Click to show internal directories.
Click to hide internal directories.