cve

package
v1.3.4-beta6 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CVEDescriptionTables = []any{
	&CVEDescription{},
}
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 MakeOpenAITranslateCWE

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

func MakeOpenAIWorking

func MakeOpenAIWorking(src *cveresources.CVE, gateway aispec.AIClient) error

func Translating

func Translating(aiGatewayType string, noCritical bool, concurrent int, cveResourceDb string, opts ...aispec.AIConfigOption) 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"` // 如果数据为空的时候,展示原因
	ComplexityGroup string    `json:"complexity_group"`
	AccessVector    string    `json:"access_vector"`
}

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"`
	JumpLink   string      `json:"jump_link"`
	Data       interface{} `json:"data"`
}

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            /* 按危险程度统计 */
	YearsSeverityCounter     map[string]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