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" json:"-"` // Name of the fingerprint
CVEName string `yaml:"cve" json:"cve"` // CVE identifier
Summary string `yaml:"summary" json:"summary"` // Brief summary of the vulnerability
Details string `yaml:"details" json:"details"` // Detailed description
CVSS string `yaml:"cvss" json:"cvss"` // CVSS score
Severity string `yaml:"severity" json:"severity"` // Severity level
SecurityAdvise string `yaml:"security_advise,omitempty" json:"security_advise"` // Security advisory
References []string `yaml:"references" json:"references"`
}
Info represents vulnerability information structure 存储漏洞信息的结构体
type VersionVul ¶
type VersionVul struct {
Info Info `yaml:"info" json:"info"` // Basic vulnerability information
Rule string `yaml:"rule" json:"rule"` // Rule expression in string format
RuleCompile *parser.Rule `yaml:"-" json:"-"` // Compiled rule for evaluation
References []string `yaml:"references" json:"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 读取并解析单个漏洞文件
func (*VersionVul) UnmarshalYAML ¶ added in v0.0.9
func (v *VersionVul) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.