mirror of
https://github.com/Vyntral/god-eye.git
synced 2026-05-25 08:54:08 +02:00
3a4c230aa7
Complete architectural overhaul. Replaces the v0.1 monolithic scanner with an event-driven pipeline of auto-registered modules. Foundation (internal/): - eventbus: typed pub/sub, 20 event types, race-safe, drop counter - module: registry with phase-based selection - store: thread-safe host store with per-host locks + deep-copy reads - pipeline: coordinator with phase barriers + panic recovery - config: 5 scan profiles + 3 AI tiers + YAML loader + auto-discovery Modules (26 auto-registered across 6 phases): - Discovery: passive (26 sources), bruteforce, recursive, AXFR, GitHub dorks, CT streaming, permutation, reverse DNS, vhost, ASN, supply chain (npm + PyPI) - Enrichment: HTTP probe + tech fingerprint + TLS appliance ID, ports - Analysis: security checks, takeover (110+ sigs), cloud, JavaScript, GraphQL, JWT, headers (OWASP), HTTP smuggling, AI cascade, Nuclei - Reporting: TXT/JSON/CSV writer + AI scan brief AI layer (internal/ai/ + internal/modules/ai/): - Three profiles: lean (16 GB), balanced (32 GB MoE), heavy (64 GB) - Six event-driven handlers: CVE, JS file, HTTP response, secret filter, multi-agent vuln enrichment, anomaly + executive report - Content-hash cache dedups Ollama calls across hosts - Auto-pull of missing models via /api/pull with streaming progress - End-of-scan AI SCAN BRIEF in terminal with top chains + next actions Nuclei compat layer (internal/nucleitpl/): - Executes ~13k community templates (HTTP subset) - Auto-download of nuclei-templates ZIP to ~/.god-eye/nuclei-templates - Scope filter rejects off-host templates (eliminates OSINT FPs) Operations: - Interactive wizard (internal/wizard/) — zero-flag launch - LivePrinter (internal/tui/) — colorized event stream - Diff engine + scheduler (internal/diff, internal/scheduler) for continuous ASM monitoring with webhook alerts - Proxy support (internal/proxyconf/): http / https / socks5 / socks5h + basic auth Fixes #1 — native SOCKS5 / Tor compatibility via --proxy flag. 185 unit tests across 15 packages, all race-detector clean.
102 lines
3.0 KiB
Go
102 lines
3.0 KiB
Go
package config
|
|
|
|
// AIProfile bundles the triage + deep models for a named AI tier. Unlike
|
|
// the scan-level Profile (bugbounty/pentest/…), an AIProfile only touches
|
|
// model selection — it doesn't flip stealth, recursion, or module enables.
|
|
type AIProfile struct {
|
|
Name string
|
|
Description string
|
|
FastModel string
|
|
DeepModel string
|
|
// MinRAMGB is an advisory (not enforced) hint about the memory footprint
|
|
// of both models loaded simultaneously. Printed in the profile help
|
|
// banner so users can pick the right tier for their machine.
|
|
MinRAMGB int
|
|
}
|
|
|
|
// Built-in AI profiles. The lean tier matches the repository defaults so
|
|
// `--ai-profile lean` is always equivalent to "use whatever the defaults
|
|
// say". balanced and heavy upgrade deep model to Qwen3-Coder MoE which
|
|
// activates only 3.3B parameters per token despite its 30B total.
|
|
var (
|
|
AIProfileLean = AIProfile{
|
|
Name: "lean",
|
|
Description: "Runs on 16GB RAM; default. qwen3:1.7b triage + qwen2.5-coder:14b deep.",
|
|
FastModel: "qwen3:1.7b",
|
|
DeepModel: "qwen2.5-coder:14b",
|
|
MinRAMGB: 16,
|
|
}
|
|
|
|
AIProfileBalanced = AIProfile{
|
|
Name: "balanced",
|
|
Description: "32GB RAM / 24GB VRAM. Upgrades deep to qwen3-coder:30b MoE (3.3B active, 256K ctx).",
|
|
FastModel: "qwen3:4b",
|
|
DeepModel: "qwen3-coder:30b",
|
|
MinRAMGB: 32,
|
|
}
|
|
|
|
AIProfileHeavy = AIProfile{
|
|
Name: "heavy",
|
|
Description: "64GB+ RAM. Best-quality triage + deep. Slowest; ideal for final analysis passes.",
|
|
FastModel: "qwen3:8b",
|
|
DeepModel: "qwen3-coder:30b",
|
|
MinRAMGB: 64,
|
|
}
|
|
)
|
|
|
|
// BuiltinAIProfiles lists every AIProfile in CLI help order.
|
|
var BuiltinAIProfiles = []AIProfile{
|
|
AIProfileLean,
|
|
AIProfileBalanced,
|
|
AIProfileHeavy,
|
|
}
|
|
|
|
// AIProfileByName resolves a named profile. Lookup is case-insensitive
|
|
// and tolerates the common alias "max" → heavy.
|
|
func AIProfileByName(name string) (AIProfile, bool) {
|
|
switch normaliseAIProfileName(name) {
|
|
case "lean":
|
|
return AIProfileLean, true
|
|
case "balanced", "balance", "mid":
|
|
return AIProfileBalanced, true
|
|
case "heavy", "max", "power":
|
|
return AIProfileHeavy, true
|
|
}
|
|
return AIProfile{}, false
|
|
}
|
|
|
|
func normaliseAIProfileName(s string) string {
|
|
out := make([]byte, 0, len(s))
|
|
for i := 0; i < len(s); i++ {
|
|
c := s[i]
|
|
if c >= 'A' && c <= 'Z' {
|
|
c += 'a' - 'A'
|
|
}
|
|
if c == ' ' || c == '_' || c == '-' {
|
|
continue
|
|
}
|
|
out = append(out, c)
|
|
}
|
|
return string(out)
|
|
}
|
|
|
|
// ApplyAIProfile merges p's models into cfg. If cfg.AIFastModel /
|
|
// cfg.AIDeepModel were explicitly set by the user (overrideFast /
|
|
// overrideDeep true) the profile is ignored for that field. The caller
|
|
// is responsible for detecting explicit flags; in practice this comes
|
|
// from cobra's cmd.Flags().Changed("ai-fast-model").
|
|
func ApplyAIProfile(cfg *Config, p AIProfile, overrideFast, overrideDeep bool) {
|
|
if cfg == nil {
|
|
return
|
|
}
|
|
if !overrideFast && p.FastModel != "" {
|
|
cfg.AIFastModel = p.FastModel
|
|
}
|
|
if !overrideDeep && p.DeepModel != "" {
|
|
cfg.AIDeepModel = p.DeepModel
|
|
}
|
|
if cfg.AIProfile == "" {
|
|
cfg.AIProfile = p.Name
|
|
}
|
|
}
|