vulstruct

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0, BSD-3-Clause, MIT, + 2 more Imports: 6 Imported by: 0

Documentation

Overview

Package vulstruct 漏洞结构体

Package vulstruct 漏洞扫描

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvisoryEngine

type AdvisoryEngine struct {
	// contains filtered or unexported fields
}

AdvisoryEngine 漏洞建议引擎结构体,用于管理版本漏洞信息

func NewAdvisoryEngine

func NewAdvisoryEngine(dir string) (*AdvisoryEngine, error)

NewAdvisoryEngine 创建一个新的漏洞建议引擎 dir: 包含漏洞建议yaml文件的目录路径 返回: 漏洞建议引擎实例和可能的错误

func (*AdvisoryEngine) GetAdvisories

func (ae *AdvisoryEngine) GetAdvisories(packageName, version string, isInternal bool) ([]VersionVul, error)

GetAdvisories 根据包名和版本获取相关的漏洞建议 PackageName: 需要检查的包名 version: 需要检查的版本号 返回: 匹配的漏洞建议列表和可能的错误

func (*AdvisoryEngine) GetCount

func (ae *AdvisoryEngine) GetCount() int

GetCount 获取当前加载的漏洞建议总数 返回: 漏洞建议数量

type Info

type Info struct {
	FingerPrintName string `yaml:"name"`                      // Name of the fingerprint
	CVEName         string `yaml:"cve"`                       // CVE identifier
	Summary         string `yaml:"summary"`                   // Brief summary of the vulnerability
	Details         string `yaml:"details"`                   // Detailed description
	CVSS            string `yaml:"cvss"`                      // CVSS score
	Severity        string `yaml:"severity"`                  // Severity level
	SecurityAdvise  string `yaml:"security_advise,omitempty"` // Security advisory
}

Info represents vulnerability information structure 存储漏洞信息的结构体

type VersionVul

type VersionVul struct {
	Info        Info         `yaml:"info"`       // Basic vulnerability information
	Rule        string       `yaml:"rule"`       // Rule expression in string format
	RuleCompile *parser.Rule `yaml:"-"`          // Compiled rule for evaluation
	References  []string     `yaml:"references"` // Reference links
}

VersionVul represents a version-based vulnerability 版本相关的漏洞结构体

func ReadVersionVulSingFile

func ReadVersionVulSingFile(filename string) (*VersionVul, error)

ReadVersionVulSingFile reads and parses a single vulnerability file 读取并解析单个漏洞文件

Jump to

Keyboard shortcuts

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