cve

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CVEExports = map[string]interface{}{
	"Download":      cvequeryops.DownLoad,
	"LoadCVE":       cvequeryops.LoadCVE,
	"QueryEx":       queryEx,
	"Query":         cvequeryops.QueryCVEYields,
	"GetCVE":        getCVE,
	"NewStatistics": NewStatistics,

	"cwe":        cvequeryops.CWE,
	"cve":        cvequeryops.CVE,
	"after":      cvequeryops.After,
	"before":     cvequeryops.Before,
	"score":      cvequeryops.Score,
	"severity":   cvequeryops.Severity,
	"vendor":     cvequeryops.Vendor,
	"product":    cvequeryops.ProductWithVersion,
	"cpe":        cvequeryops.CPE,
	"parseToCpe": webfingerprint.ParseToCPE,
}
View Source
var CWEExports = map[string]interface{}{
	"Get": getCWE,
}

Functions

func InitializeCVEDescription

func InitializeCVEDescription()

func MakeOpenAITranslateCWE

func MakeOpenAITranslateCWE(cwe *cveresources.CWE, apiKey string, proxies ...string) (*cveresources.CWE, error)

func MakeOpenAIWorking

func MakeOpenAIWorking(src *cveresources.CVE, cveDescription string, apiKey string, proxy ...string) error

func Translating

func Translating(apiKeyFile string, noCritical bool, concurrent int, cveResourceDb string) error

func TranslatingCWE

func TranslatingCWE(apiKeyFile string, concurrent int, cveResourceDb string) error

func YieldCVEDescriptions

func YieldCVEDescriptions(db *gorm.DB, ctx context.Context) chan *CVEDescription

Types

type CVEDescription

type CVEDescription struct {
	CVE                string `json:"cve" gorm:"unique_index"`
	Title              string
	ChineseTitle       string
	Description        string
	ChineseDescription string
	OpenAISolution     string
}

type Graph

type Graph struct {
	Name        string    `json:"name"`
	NameVerbose string    `json:"name_verbose"`
	Type        string    `json:"type"`
	TypeVerbose string    `json:"type_verbose"`
	Data        []*KVPair `json:"data"`
	Reason      string    `json:"reason"` // 如果数据为空的时候,展示原因
}

type KVPair

type KVPair struct {
	Key        string `json:"key"`
	Value      int    `json:"value"`
	ShowValue  int    `json:"show_value"`
	KeyVerbose string `json:"key_verbose"`
	Detail     string `json:"detail"`
}

type Statistics

type Statistics struct {
	Source    string
	BySources map[string]*Statistics

	Total int

	// 环形分析器,从内圈到外圈
	NoAuthNetworkHighExploitableCount int
	NoAuthNetworkCount                int
	NetworkCount                      int

	// NETWORK/LOCAL/ADJACENT_NETWORK/PHYSICAL
	CWECounter               map[string]int /* 探明漏洞类型 */
	AccessVectorCounter      map[string]int /* 总体攻击路径的统计 */
	ComplexityCounter        map[string]int /* 攻击复杂度判定 */
	NetworkComplexityCounter map[string]int /* 网络攻击复杂度 */
	LocalComplexityCounter   map[string]int /* 本地攻击复杂度 */
	YearsCounter             map[string]int /* 按年度统计 */
	SeverityCounter          map[string]int /* 按危险程度统计 */
}

func NewStatistics

func NewStatistics(source string) *Statistics

func (*Statistics) Feed

func (s *Statistics) Feed(c *cveresources.CVE)

func (*Statistics) FeedSource

func (s *Statistics) FeedSource(source string, c *cveresources.CVE)

func (*Statistics) ToGraphs

func (s *Statistics) ToGraphs() []*Graph

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL