Documentation
¶
Index ¶
- func InitConfig(debug, offline bool, output string)
- func PrintResults(logger *zap.SugaredLogger, results []Result)
- func SaveResults(results []Result, format string) error
- type Coverage
- type EvidenceItem
- type GraphSnapshot
- type Plugin
- type Result
- type RuleBundleInfo
- type RuleSourceInfo
- type ScanConfig
- type ScanReport
- type ScanSession
- type SkippedModule
- type Summary
- type TimelineItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
func PrintResults ¶
func PrintResults(logger *zap.SugaredLogger, results []Result)
Types ¶
type EvidenceItem ¶
type GraphSnapshot ¶
type Plugin ¶
type Plugin interface {
Name() string
Run(ctx context.Context, config *ScanConfig) ([]Result, error)
}
Plugin 是所有扫描模块必须实现的接口
type Result ¶
type Result struct {
Plugin string `json:"plugin"` // 插件名称
Level string `json:"level"` // "INFO", "low", "medium", "high", "critical"
Description string `json:"description"` // 描述
Reference string `json:"reference"` // 引用 (文件路径, 进程ID 等)
Advice string `json:"advice"` // 建议
Score int `json:"score,omitempty"`
Confidence int `json:"confidence,omitempty"`
Evidence []string `json:"evidence,omitempty"`
RuleSource string `json:"rule_source,omitempty"`
RuleName string `json:"rule_name,omitempty"`
MITRE []string `json:"mitre,omitempty"`
}
Result 代表扫描器的一个发现结果
type RuleBundleInfo ¶
type RuleSourceInfo ¶
type ScanConfig ¶
type ScanConfig struct {
Debug bool
Offline bool
NoNetwork bool
Output string
OutputDir string
ReportPath string
CaseID string
Profile string
RulesDir string
JSONL bool
ExplicitModules map[string]bool
SkippedModules []SkippedModule
Coverage Coverage
RuleBundle *RuleBundleInfo
}
ScanConfig 保存扫描会话的全局配置
var GlobalConfig *ScanConfig
type ScanReport ¶
type ScanReport struct {
ScanSession ScanSession `json:"scan_session"`
RuleBundle *RuleBundleInfo `json:"rule_bundle,omitempty"`
Profile string `json:"profile"`
Coverage Coverage `json:"coverage"`
Summary Summary `json:"summary"`
Findings []Result `json:"findings"`
Evidence []EvidenceItem `json:"evidence"`
Timeline []TimelineItem `json:"timeline"`
SkippedModules []SkippedModule `json:"skipped_modules"`
AttackGraph *GraphSnapshot `json:"attack_graph,omitempty"`
}
type ScanSession ¶
type ScanSession struct {
CaseID string `json:"case_id,omitempty"`
Hostname string `json:"hostname"`
User string `json:"user,omitempty"`
OS string `json:"os"`
Arch string `json:"arch"`
StartedAt string `json:"started_at"`
EndedAt string `json:"ended_at"`
Duration string `json:"duration"`
Offline bool `json:"offline"`
NoNetwork bool `json:"no_network"`
NetworkPolicyText string `json:"network_policy_text,omitempty"`
}
type SkippedModule ¶
Click to show internal directories.
Click to hide internal directories.