Documentation
¶
Index ¶
- Variables
- type Anomaly
- type AttackPath
- type AttackStep
- type BasePlugin
- func (b BasePlugin) Author() string
- func (b BasePlugin) Category() string
- func (b BasePlugin) Consumes() []string
- func (b BasePlugin) Dependencies() []PluginDependency
- func (b BasePlugin) Description() string
- func (b BasePlugin) EstimatedDuration() time.Duration
- func (b BasePlugin) GetIntelligencePatterns() []Pattern
- func (b BasePlugin) IsPassive() bool
- func (b BasePlugin) MaxConcurrency() int
- func (b BasePlugin) Name() string
- func (b BasePlugin) Prepare(ctx context.Context, target *models.Target, cfg *config.Config, ...) error
- func (b BasePlugin) Priority() int
- func (b BasePlugin) ProcessDiscovery(ctx context.Context, discovery models.Discovery) error
- func (b BasePlugin) Provides() []string
- func (b BasePlugin) RequiredBinaries() []string
- func (b BasePlugin) RequiredEnvVars() []string
- func (b BasePlugin) RequiresConfirmation() bool
- func (b BasePlugin) ResourceRequirements() Resources
- func (b BasePlugin) Run(ctx context.Context, target *models.Target, results chan<- models.PluginResult, ...) error
- func (b BasePlugin) SupportedTargetTypes() []string
- func (b BasePlugin) Teardown(ctx context.Context) error
- func (b BasePlugin) Validate(ctx context.Context, cfg *config.Config) error
- func (b BasePlugin) Version() string
- type CacheInterface
- type Checkpoint
- type ContextEvent
- type Counter
- type DataFlowEdge
- type DependencyGraph
- func (dg *DependencyGraph) AddDependency(from, to string)
- func (dg *DependencyGraph) AddNode(name string, node *PluginNode)
- func (dg *DependencyGraph) DetectCycles() [][]string
- func (dg *DependencyGraph) GetAllDependencies(name string) []string
- func (dg *DependencyGraph) GetCriticalPath() []string
- func (dg *DependencyGraph) GetDataFlow() map[string][]DataFlowEdge
- func (dg *DependencyGraph) GetDependencies(name string) []string
- func (dg *DependencyGraph) GetDependents(name string) []string
- func (dg *DependencyGraph) GetExecutionOrder() [][]string
- func (dg *DependencyGraph) GetNode(name string) (*PluginNode, bool)
- func (dg *DependencyGraph) GetOptimalExecutionOrder() [][]string
- func (dg *DependencyGraph) GetParallelizationOpportunities() [][]string
- func (dg *DependencyGraph) TopologicalSort() []string
- func (dg *DependencyGraph) ValidateGraph() error
- type EventType
- type ExecutionMetadata
- type ExecutionOptimizer
- type ExecutionPhase
- type ExecutionPlan
- type ExecutionStatus
- type Gauge
- type Histogram
- type IntelligenceInterface
- type Logger
- type MetricsInterface
- type Mitigation
- type OptimizationStrategy
- type ParallelizationStrategy
- type Pattern
- type PatternCondition
- type PerformancePrediction
- type PerformancePredictor
- type PerformanceRecord
- type Pipeline
- func (p *Pipeline) GetErrors() <-chan error
- func (p *Pipeline) GetResults() <-chan models.PluginResult
- func (p *Pipeline) GetStages() []Stage
- func (p *Pipeline) GetStatus() PipelineStatus
- func (p *Pipeline) GetWorkspace() *Workspace
- func (p *Pipeline) InitStages()
- func (p *Pipeline) Resume(ctx context.Context, checkpointPath string) error
- func (p *Pipeline) RunAll(ctx context.Context, target *models.Target) error
- func (p *Pipeline) RunStep(ctx context.Context, stageCategory string, target *models.Target) error
- type PipelineStatus
- type Plugin
- type PluginDependency
- type PluginExecution
- type PluginManager
- func (pm *PluginManager) CancelPlugin(pluginName string) error
- func (pm *PluginManager) ExecutePlugin(ctx context.Context, pluginName string, target *models.Target) (*PluginExecution, error)
- func (pm *PluginManager) ExecutePlugins(ctx context.Context, target *models.Target, plugins []Plugin) (*ExecutionPlan, error)
- func (pm *PluginManager) GetAllExecutionStatuses() map[string]*PluginExecution
- func (pm *PluginManager) GetEnabledPlugins(target *models.Target) []Plugin
- func (pm *PluginManager) GetExecutionStatus(pluginName string) (*PluginExecution, error)
- func (pm *PluginManager) GetPlugin(name string) (Plugin, error)
- func (pm *PluginManager) GetPluginMetrics() map[string]PluginMetrics
- func (pm *PluginManager) GetPluginsByCategory(category string) []Plugin
- func (pm *PluginManager) ListPlugins() []Plugin
- func (pm *PluginManager) RegisterPlugin(plugin Plugin) error
- func (pm *PluginManager) UnregisterPlugin(name string) error
- func (pm *PluginManager) ValidatePluginDependencies(plugins []Plugin) error
- func (pm *PluginManager) WaitForCompletion(ctx context.Context) error
- type PluginMetadata
- type PluginMetrics
- type PluginNode
- type PluginRegistry
- func (pr *PluginRegistry) Get(name string) (Plugin, bool)
- func (pr *PluginRegistry) GetActivePlugins() []Plugin
- func (pr *PluginRegistry) GetAll() map[string]Plugin
- func (pr *PluginRegistry) GetAllMetadata() map[string]PluginMetadata
- func (pr *PluginRegistry) GetByCategory(category string) []Plugin
- func (pr *PluginRegistry) GetCategories() []string
- func (pr *PluginRegistry) GetCategoryCount(category string) int
- func (pr *PluginRegistry) GetMetadata(name string) (PluginMetadata, bool)
- func (pr *PluginRegistry) GetPassivePlugins() []Plugin
- func (pr *PluginRegistry) GetPluginCount() int
- func (pr *PluginRegistry) GetPluginDependencies(name string) []string
- func (pr *PluginRegistry) GetPluginDependents(name string) []string
- func (pr *PluginRegistry) GetPluginStats() RegistryStats
- func (pr *PluginRegistry) GetPluginsByConsumer(dataType string) []Plugin
- func (pr *PluginRegistry) GetPluginsByProvider(dataType string) []Plugin
- func (pr *PluginRegistry) GetPluginsRequiringConfirmation() []Plugin
- func (pr *PluginRegistry) IsRegistered(name string) bool
- func (pr *PluginRegistry) List() []string
- func (pr *PluginRegistry) Register(plugin Plugin)
- func (pr *PluginRegistry) Unregister(name string)
- func (pr *PluginRegistry) ValidatePlugin(plugin Plugin) error
- type PluginStatus
- type PriorityOptimizationStrategy
- type Queue
- func (q *Queue) Clear()
- func (q *Queue) FilterByType(itemType string) []QueueItem
- func (q *Queue) GetItems() []QueueItem
- func (q *Queue) IsEmpty() bool
- func (q *Queue) IsFull() bool
- func (q *Queue) Peek() (QueueItem, error)
- func (q *Queue) Pop() (QueueItem, error)
- func (q *Queue) Push(item QueueItem) error
- func (q *Queue) Size() int
- type QueueItem
- type QueueManager
- type QueueStats
- type RegistryStats
- type ResourceAllocation
- type ResourceManager
- type ResourceOptimizationStrategy
- type Resources
- type Scheduler
- type SharedContext
- func (sc *SharedContext) AddDiscovery(discovery models.Discovery)
- func (sc *SharedContext) GetCache() CacheInterface
- func (sc *SharedContext) GetDiscoveries(discoveryType string) []models.Discovery
- func (sc *SharedContext) GetDiscoveriesBySource(source string) []models.Discovery
- func (sc *SharedContext) GetIntelligence() IntelligenceInterface
- func (sc *SharedContext) GetLogger() Logger
- func (sc *SharedContext) GetMetrics() MetricsInterface
- func (sc *SharedContext) Subscribe() <-chan ContextEvent
- type Stage
- type StageStatus
- type SystemResources
- type TimelineEvent
- type Timer
- type Workspace
- func (w *Workspace) GetDirectory(dirType string) (string, error)
- func (w *Workspace) GetMetadata(key string) (interface{}, bool)
- func (w *Workspace) GetStats() WorkspaceStats
- func (w *Workspace) ListFiles(dirType string) ([]string, error)
- func (w *Workspace) ReadFile(dirType, filename string) ([]byte, error)
- func (w *Workspace) SaveFile(dirType, filename string, content []byte) error
- func (w *Workspace) SaveResult(result models.PluginResult) error
- func (w *Workspace) SetMetadata(key string, value interface{})
- type WorkspaceManager
- type WorkspaceStats
- type ZerologAdapter
- func (z *ZerologAdapter) Debug(msg string, fields ...interface{})
- func (z *ZerologAdapter) Error(msg string, err error, fields ...interface{})
- func (z *ZerologAdapter) Fatal(msg string, err error, fields ...interface{})
- func (z *ZerologAdapter) Info(msg string, fields ...interface{})
- func (z *ZerologAdapter) Warn(msg string, fields ...interface{})
- func (z *ZerologAdapter) WithField(key string, value interface{}) Logger
- func (z *ZerologAdapter) WithFields(fields map[string]interface{}) Logger
Constants ¶
This section is empty.
Variables ¶
var DefaultResources = Resources{ CPUCores: 1, MemoryMB: 256, DiskMB: 100, NetworkBandwidth: "1Mbps", MaxFileHandles: 100, MaxProcesses: 5, RequiresRoot: false, NetworkAccess: true, }
Default resource requirements for plugins
Functions ¶
This section is empty.
Types ¶
type Anomaly ¶
type Anomaly struct {
ID string `json:"id"`
Type string `json:"type"`
Severity string `json:"severity"`
Description string `json:"description"`
Evidence []models.PluginResult `json:"evidence"`
Confidence float64 `json:"confidence"`
Indicators []string `json:"indicators"`
Timestamp time.Time `json:"timestamp"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
Anomaly represents detected anomalous behavior
type AttackPath ¶
type AttackPath struct {
ID string `json:"id"`
Name string `json:"name"`
Entry models.PluginResult `json:"entry"`
Steps []AttackStep `json:"steps"`
Goal string `json:"goal"`
Likelihood float64 `json:"likelihood"`
Impact float64 `json:"impact"`
RiskScore float64 `json:"risk_score"`
Mitigations []Mitigation `json:"mitigations"`
Timeline []TimelineEvent `json:"timeline"`
}
AttackPath represents a potential attack chain
type AttackStep ¶
type AttackStep struct {
Finding models.PluginResult `json:"finding"`
Technique models.MITRETechnique `json:"technique"`
Requirement string `json:"requirement"`
Achieved bool `json:"achieved"`
Confidence float64 `json:"confidence"`
}
AttackStep represents a step in an attack path
type BasePlugin ¶
type BasePlugin struct {
// contains filtered or unexported fields
}
BasePlugin provides a default implementation for common plugin functionality
func NewBasePlugin ¶
func NewBasePlugin(name, category string, binaries []string) BasePlugin
NewBasePlugin creates a new base plugin with common defaults
func (BasePlugin) Author ¶
func (b BasePlugin) Author() string
func (BasePlugin) Category ¶
func (b BasePlugin) Category() string
func (BasePlugin) Consumes ¶
func (b BasePlugin) Consumes() []string
func (BasePlugin) Dependencies ¶
func (b BasePlugin) Dependencies() []PluginDependency
func (BasePlugin) Description ¶
func (b BasePlugin) Description() string
func (BasePlugin) EstimatedDuration ¶
func (b BasePlugin) EstimatedDuration() time.Duration
func (BasePlugin) GetIntelligencePatterns ¶
func (b BasePlugin) GetIntelligencePatterns() []Pattern
Intelligence methods
func (BasePlugin) MaxConcurrency ¶
func (b BasePlugin) MaxConcurrency() int
func (BasePlugin) Prepare ¶
func (b BasePlugin) Prepare(ctx context.Context, target *models.Target, cfg *config.Config, shared *SharedContext) error
func (BasePlugin) Priority ¶
func (b BasePlugin) Priority() int
func (BasePlugin) ProcessDiscovery ¶
func (BasePlugin) Provides ¶
func (b BasePlugin) Provides() []string
func (BasePlugin) RequiredBinaries ¶
func (b BasePlugin) RequiredBinaries() []string
Dependency methods
func (BasePlugin) RequiredEnvVars ¶
func (b BasePlugin) RequiredEnvVars() []string
func (BasePlugin) RequiresConfirmation ¶
func (b BasePlugin) RequiresConfirmation() bool
func (BasePlugin) ResourceRequirements ¶
func (b BasePlugin) ResourceRequirements() Resources
func (BasePlugin) Run ¶
func (b BasePlugin) Run(ctx context.Context, target *models.Target, results chan<- models.PluginResult, shared *SharedContext) error
func (BasePlugin) SupportedTargetTypes ¶
func (b BasePlugin) SupportedTargetTypes() []string
func (BasePlugin) Version ¶
func (b BasePlugin) Version() string
type CacheInterface ¶
type CacheInterface interface {
Get(ctx context.Context, key string) (interface{}, error)
Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
Delete(ctx context.Context, key string) error
Exists(ctx context.Context, key string) (bool, error)
Clear(ctx context.Context) error
}
CacheInterface defines cache operations
type Checkpoint ¶
type Checkpoint struct {
Target string `json:"target"`
CompletedStages []string `json:"completed_stages"`
CurrentStage string `json:"current_stage"`
Timestamp time.Time `json:"timestamp"`
Results []models.PluginResult `json:"results"`
Workspace string `json:"workspace"`
}
Checkpoint enables resuming interrupted scans
type ContextEvent ¶
type ContextEvent struct {
Type EventType `json:"type"`
Source string `json:"source"`
Data interface{} `json:"data"`
Timestamp time.Time `json:"timestamp"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
ContextEvent represents events in the shared context
type DataFlowEdge ¶
type DataFlowEdge struct {
From string `json:"from"`
To string `json:"to"`
DataType string `json:"data_type"`
}
DataFlowEdge represents data flow between plugins
type DependencyGraph ¶
type DependencyGraph struct {
// contains filtered or unexported fields
}
DependencyGraph manages plugin execution dependencies
func NewDependencyGraph ¶
func NewDependencyGraph() *DependencyGraph
NewDependencyGraph creates a new dependency graph
func (*DependencyGraph) AddDependency ¶
func (dg *DependencyGraph) AddDependency(from, to string)
AddDependency adds a dependency relationship
func (*DependencyGraph) AddNode ¶
func (dg *DependencyGraph) AddNode(name string, node *PluginNode)
AddNode adds a plugin node to the graph
func (*DependencyGraph) DetectCycles ¶
func (dg *DependencyGraph) DetectCycles() [][]string
DetectCycles detects circular dependencies in the graph
func (*DependencyGraph) GetAllDependencies ¶
func (dg *DependencyGraph) GetAllDependencies(name string) []string
GetAllDependencies returns all dependencies (recursive) of a plugin
func (*DependencyGraph) GetCriticalPath ¶
func (dg *DependencyGraph) GetCriticalPath() []string
GetCriticalPath finds the critical path in the dependency graph
func (*DependencyGraph) GetDataFlow ¶
func (dg *DependencyGraph) GetDataFlow() map[string][]DataFlowEdge
GetDataFlow analyzes data flow between plugins
func (*DependencyGraph) GetDependencies ¶
func (dg *DependencyGraph) GetDependencies(name string) []string
GetDependencies returns direct dependencies of a plugin
func (*DependencyGraph) GetDependents ¶
func (dg *DependencyGraph) GetDependents(name string) []string
GetDependents returns plugins that depend on the specified plugin
func (*DependencyGraph) GetExecutionOrder ¶
func (dg *DependencyGraph) GetExecutionOrder() [][]string
GetExecutionOrder returns plugins ordered by dependencies and priorities
func (*DependencyGraph) GetNode ¶
func (dg *DependencyGraph) GetNode(name string) (*PluginNode, bool)
GetNode returns a node by name
func (*DependencyGraph) GetOptimalExecutionOrder ¶
func (dg *DependencyGraph) GetOptimalExecutionOrder() [][]string
GetOptimalExecutionOrder returns an optimized execution order
func (*DependencyGraph) GetParallelizationOpportunities ¶
func (dg *DependencyGraph) GetParallelizationOpportunities() [][]string
GetParallelizationOpportunities identifies plugins that can run in parallel
func (*DependencyGraph) TopologicalSort ¶
func (dg *DependencyGraph) TopologicalSort() []string
TopologicalSort returns plugins in dependency order
func (*DependencyGraph) ValidateGraph ¶
func (dg *DependencyGraph) ValidateGraph() error
ValidateGraph checks the graph for consistency
type ExecutionMetadata ¶
type ExecutionMetadata struct {
CreatedAt time.Time
EstimatedDuration time.Duration
TotalPlugins int
ParallelPhases int
SequentialPhases int
ResourcesRequired Resources
CriticalPath []string
OptimizationLevel string
}
ExecutionMetadata contains metadata about the execution plan
type ExecutionOptimizer ¶
type ExecutionOptimizer struct {
// contains filtered or unexported fields
}
ExecutionOptimizer optimizes execution plans
func NewExecutionOptimizer ¶
func NewExecutionOptimizer() *ExecutionOptimizer
func (*ExecutionOptimizer) OptimizePhases ¶
func (eo *ExecutionOptimizer) OptimizePhases(phases []*ExecutionPhase, predictions map[string]PerformancePrediction) []*ExecutionPhase
type ExecutionPhase ¶
type ExecutionPhase struct {
ID string
Name string
Plugins []Plugin
Parallel bool
MaxWorkers int
Timeout time.Duration
Resources ResourceAllocation
Dependencies []string
Priority int
}
ExecutionPhase represents a phase of plugin execution
type ExecutionPlan ¶
type ExecutionPlan struct {
ID string
Target *models.Target
Phases []*ExecutionPhase
Order []Plugin
Allocations map[string]ResourceAllocation
Graph *DependencyGraph
Metadata ExecutionMetadata
ResultChan chan models.PluginResult
}
ExecutionPlan represents a complete plugin execution plan
type ExecutionStatus ¶
type ExecutionStatus string
ExecutionStatus represents the current status of plugin execution
const ( StatusPending ExecutionStatus = "pending" StatusRunning ExecutionStatus = "running" StatusCompleted ExecutionStatus = "completed" StatusFailed ExecutionStatus = "failed" StatusCancelled ExecutionStatus = "cancelled" )
type IntelligenceInterface ¶
type IntelligenceInterface interface {
Correlate(ctx context.Context, results []models.PluginResult) ([]models.Correlation, error)
DetectAnomalies(ctx context.Context, results []models.PluginResult) ([]Anomaly, error)
AnalyzeAttackPaths(ctx context.Context, results []models.PluginResult) ([]AttackPath, error)
ScoreRisk(ctx context.Context, result models.PluginResult) (float64, error)
}
IntelligenceInterface defines intelligence operations
type Logger ¶
type Logger interface {
Debug(msg string, fields ...interface{})
Info(msg string, fields ...interface{})
Warn(msg string, fields ...interface{})
Error(msg string, err error, fields ...interface{})
Fatal(msg string, err error, fields ...interface{})
WithField(key string, value interface{}) Logger
WithFields(fields map[string]interface{}) Logger
}
Logger interface for structured logging
type MetricsInterface ¶
type MetricsInterface interface {
Counter(name string) Counter
Histogram(name string) Histogram
Gauge(name string) Gauge
Timer(name string) Timer
}
MetricsInterface defines metrics collection
type Mitigation ¶
type Mitigation struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"` // preventive, detective, corrective
Effectiveness float64 `json:"effectiveness"` // 0-1
Cost string `json:"cost"` // low, medium, high
Complexity string `json:"complexity"` // low, medium, high
References []string `json:"references"`
}
Mitigation represents a security mitigation
type OptimizationStrategy ¶
type OptimizationStrategy interface {
Apply(phases []*ExecutionPhase, predictions map[string]PerformancePrediction) []*ExecutionPhase
Name() string
}
OptimizationStrategy defines optimization approaches
type ParallelizationStrategy ¶
type ParallelizationStrategy struct{}
ParallelizationStrategy maximizes parallel execution opportunities
func (*ParallelizationStrategy) Apply ¶
func (ps *ParallelizationStrategy) Apply(phases []*ExecutionPhase, predictions map[string]PerformancePrediction) []*ExecutionPhase
func (*ParallelizationStrategy) Name ¶
func (ps *ParallelizationStrategy) Name() string
type Pattern ¶
type Pattern struct {
Name string `json:"name"`
Type string `json:"type"`
Regex string `json:"regex,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Conditions []PatternCondition `json:"conditions,omitempty"`
Confidence float64 `json:"confidence"`
Description string `json:"description"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
Pattern defines intelligence patterns for correlation
type PatternCondition ¶
type PatternCondition struct {
Field string `json:"field"`
Operator string `json:"operator"` // equals, contains, regex, gt, lt
Value interface{} `json:"value"`
}
PatternCondition defines conditional logic for patterns
type PerformancePrediction ¶
type PerformancePredictor ¶
type PerformancePredictor struct {
// contains filtered or unexported fields
}
PerformancePredictor predicts plugin execution performance
func NewPerformancePredictor ¶
func NewPerformancePredictor() *PerformancePredictor
func (*PerformancePredictor) GetPredictions ¶
func (pp *PerformancePredictor) GetPredictions(plugins []Plugin) map[string]PerformancePrediction
type PerformanceRecord ¶
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline orchestrates penetration testing stages according to the security workflow
func NewPipeline ¶
NewPipeline creates a new penetration testing pipeline
func (*Pipeline) GetResults ¶
func (p *Pipeline) GetResults() <-chan models.PluginResult
GetResults returns the results channel
func (*Pipeline) GetStatus ¶
func (p *Pipeline) GetStatus() PipelineStatus
GetStatus returns the current pipeline status
func (*Pipeline) GetWorkspace ¶
GetWorkspace returns the current workspace
func (*Pipeline) InitStages ¶
func (p *Pipeline) InitStages()
InitStages initializes the standard penetration testing workflow stages
type PipelineStatus ¶
type PipelineStatus struct {
State string `json:"state"` // pending, running, completed, failed, paused
CurrentStage string `json:"current_stage"`
Progress float64 `json:"progress"`
StageStatus map[string]StageStatus `json:"stage_status"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
Error string `json:"error,omitempty"`
}
PipelineStatus represents the current pipeline execution status
type Plugin ¶
type Plugin interface {
// Metadata methods
Name() string
Category() string
Description() string
Version() string
Author() string
// Dependency methods
RequiredBinaries() []string
RequiredEnvVars() []string
SupportedTargetTypes() []string
Dependencies() []PluginDependency
Provides() []string
Consumes() []string
// Lifecycle methods
Validate(ctx context.Context, cfg *config.Config) error
Prepare(ctx context.Context, target *models.Target, cfg *config.Config, shared *SharedContext) error
Run(ctx context.Context, target *models.Target, results chan<- models.PluginResult, shared *SharedContext) error
Teardown(ctx context.Context) error
// Capability methods
IsPassive() bool
RequiresConfirmation() bool
EstimatedDuration() time.Duration
MaxConcurrency() int
Priority() int
ResourceRequirements() Resources
// Intelligence methods
ProcessDiscovery(ctx context.Context, discovery models.Discovery) error
GetIntelligencePatterns() []Pattern
}
Plugin defines the interface that all plugins must implement
type PluginDependency ¶
type PluginDependency struct {
Plugin string `json:"plugin"`
Required bool `json:"required"`
Reason string `json:"reason"`
}
PluginDependency defines plugin ordering requirements
type PluginExecution ¶
type PluginExecution struct {
Plugin Plugin
Target *models.Target
Status ExecutionStatus
StartTime time.Time
EndTime time.Time
Results []models.PluginResult
Error error
Context context.Context
CancelFunc context.CancelFunc
ResultChan chan models.PluginResult
// contains filtered or unexported fields
}
PluginExecution tracks the execution state of a plugin
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
PluginManager manages plugin lifecycle, dependencies, and execution
func NewPluginManager ¶
func NewPluginManager(config *config.Config, shared *SharedContext, logger Logger, metrics MetricsInterface) *PluginManager
NewPluginManager creates a new plugin manager
func (*PluginManager) CancelPlugin ¶
func (pm *PluginManager) CancelPlugin(pluginName string) error
CancelPlugin cancels a running plugin
func (*PluginManager) ExecutePlugin ¶
func (pm *PluginManager) ExecutePlugin(ctx context.Context, pluginName string, target *models.Target) (*PluginExecution, error)
ExecutePlugin executes a single plugin against a target
func (*PluginManager) ExecutePlugins ¶
func (pm *PluginManager) ExecutePlugins(ctx context.Context, target *models.Target, plugins []Plugin) (*ExecutionPlan, error)
ExecutePlugins executes a set of plugins against a target
func (*PluginManager) GetAllExecutionStatuses ¶
func (pm *PluginManager) GetAllExecutionStatuses() map[string]*PluginExecution
GetAllExecutionStatuses returns the status of all running plugins
func (*PluginManager) GetEnabledPlugins ¶
func (pm *PluginManager) GetEnabledPlugins(target *models.Target) []Plugin
GetEnabledPlugins returns plugins that are enabled in the configuration
func (*PluginManager) GetExecutionStatus ¶
func (pm *PluginManager) GetExecutionStatus(pluginName string) (*PluginExecution, error)
GetExecutionStatus returns the status of a plugin execution
func (*PluginManager) GetPlugin ¶
func (pm *PluginManager) GetPlugin(name string) (Plugin, error)
GetPlugin returns a registered plugin by name
func (*PluginManager) GetPluginMetrics ¶
func (pm *PluginManager) GetPluginMetrics() map[string]PluginMetrics
GetPluginMetrics returns execution metrics for plugins
func (*PluginManager) GetPluginsByCategory ¶
func (pm *PluginManager) GetPluginsByCategory(category string) []Plugin
GetPluginsByCategory returns plugins filtered by category
func (*PluginManager) ListPlugins ¶
func (pm *PluginManager) ListPlugins() []Plugin
ListPlugins returns all registered plugins
func (*PluginManager) RegisterPlugin ¶
func (pm *PluginManager) RegisterPlugin(plugin Plugin) error
RegisterPlugin registers a plugin with the manager
func (*PluginManager) UnregisterPlugin ¶
func (pm *PluginManager) UnregisterPlugin(name string) error
UnregisterPlugin removes a plugin from the manager
func (*PluginManager) ValidatePluginDependencies ¶
func (pm *PluginManager) ValidatePluginDependencies(plugins []Plugin) error
ValidatePluginDependencies validates that plugin dependencies are satisfied
func (*PluginManager) WaitForCompletion ¶
func (pm *PluginManager) WaitForCompletion(ctx context.Context) error
WaitForCompletion waits for all plugins to complete
type PluginMetadata ¶
type PluginMetadata struct {
Name string
Category string
Description string
Version string
Author string
Dependencies []PluginDependency
Provides []string
Consumes []string
Passive bool
Confirmed bool
Resources Resources
}
PluginMetadata contains additional metadata about plugins
type PluginMetrics ¶
type PluginMetrics struct {
Name string `json:"name"`
ExecutionTime time.Duration `json:"execution_time"`
ResultCount int `json:"result_count"`
ErrorCount int `json:"error_count"`
CPUUsage float64 `json:"cpu_usage"`
MemoryUsage int64 `json:"memory_usage"`
NetworkRequests int `json:"network_requests"`
CacheHits int `json:"cache_hits"`
CacheMisses int `json:"cache_misses"`
}
PluginMetrics represents metrics for a plugin execution
type PluginNode ¶
type PluginNode struct {
Plugin Plugin
Dependencies []string
Dependents []string
Provides []string
Requires []string
Weight int
Status ExecutionStatus
Results []models.PluginResult
}
PluginNode represents a plugin in the dependency graph
type PluginRegistry ¶
type PluginRegistry struct {
// contains filtered or unexported fields
}
PluginRegistry maintains a registry of available plugins
func NewPluginRegistry ¶
func NewPluginRegistry() *PluginRegistry
NewPluginRegistry creates a new plugin registry
func (*PluginRegistry) Get ¶
func (pr *PluginRegistry) Get(name string) (Plugin, bool)
Get returns a plugin by name
func (*PluginRegistry) GetActivePlugins ¶
func (pr *PluginRegistry) GetActivePlugins() []Plugin
GetActivePlugins returns all active (non-passive) plugins
func (*PluginRegistry) GetAll ¶
func (pr *PluginRegistry) GetAll() map[string]Plugin
GetAll returns all registered plugins
func (*PluginRegistry) GetAllMetadata ¶
func (pr *PluginRegistry) GetAllMetadata() map[string]PluginMetadata
GetAllMetadata returns metadata for all plugins
func (*PluginRegistry) GetByCategory ¶
func (pr *PluginRegistry) GetByCategory(category string) []Plugin
GetByCategory returns all plugins in a specific category
func (*PluginRegistry) GetCategories ¶
func (pr *PluginRegistry) GetCategories() []string
GetCategories returns all available categories
func (*PluginRegistry) GetCategoryCount ¶
func (pr *PluginRegistry) GetCategoryCount(category string) int
GetCategoryCount returns the number of plugins in a category
func (*PluginRegistry) GetMetadata ¶
func (pr *PluginRegistry) GetMetadata(name string) (PluginMetadata, bool)
GetMetadata returns metadata for a plugin
func (*PluginRegistry) GetPassivePlugins ¶
func (pr *PluginRegistry) GetPassivePlugins() []Plugin
GetPassivePlugins returns all passive plugins
func (*PluginRegistry) GetPluginCount ¶
func (pr *PluginRegistry) GetPluginCount() int
GetPluginCount returns the total number of registered plugins
func (*PluginRegistry) GetPluginDependencies ¶
func (pr *PluginRegistry) GetPluginDependencies(name string) []string
GetPluginDependencies returns the dependency chain for a plugin
func (*PluginRegistry) GetPluginDependents ¶
func (pr *PluginRegistry) GetPluginDependents(name string) []string
GetPluginDependents returns plugins that depend on the specified plugin
func (*PluginRegistry) GetPluginStats ¶
func (pr *PluginRegistry) GetPluginStats() RegistryStats
GetPluginStats returns statistics about registered plugins
func (*PluginRegistry) GetPluginsByConsumer ¶
func (pr *PluginRegistry) GetPluginsByConsumer(dataType string) []Plugin
GetPluginsByConsumer returns plugins that consume specific data types
func (*PluginRegistry) GetPluginsByProvider ¶
func (pr *PluginRegistry) GetPluginsByProvider(dataType string) []Plugin
GetPluginsByProvider returns plugins that provide specific data types
func (*PluginRegistry) GetPluginsRequiringConfirmation ¶
func (pr *PluginRegistry) GetPluginsRequiringConfirmation() []Plugin
GetPluginsRequiringConfirmation returns plugins that require confirmation
func (*PluginRegistry) IsRegistered ¶
func (pr *PluginRegistry) IsRegistered(name string) bool
IsRegistered checks if a plugin is registered
func (*PluginRegistry) List ¶
func (pr *PluginRegistry) List() []string
List returns a list of all plugin names
func (*PluginRegistry) Register ¶
func (pr *PluginRegistry) Register(plugin Plugin)
Register registers a plugin in the registry
func (*PluginRegistry) Unregister ¶
func (pr *PluginRegistry) Unregister(name string)
Unregister removes a plugin from the registry
func (*PluginRegistry) ValidatePlugin ¶
func (pr *PluginRegistry) ValidatePlugin(plugin Plugin) error
ValidatePlugin checks if a plugin meets registration requirements
type PluginStatus ¶
type PluginStatus struct {
Name string `json:"name"`
State string `json:"state"` // pending, running, completed, failed
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
ResultCount int `json:"result_count"`
Error string `json:"error,omitempty"`
}
PluginStatus represents the current status of a plugin
type PriorityOptimizationStrategy ¶
type PriorityOptimizationStrategy struct{}
PriorityOptimizationStrategy optimizes based on plugin priorities
func (*PriorityOptimizationStrategy) Apply ¶
func (pos *PriorityOptimizationStrategy) Apply(phases []*ExecutionPhase, predictions map[string]PerformancePrediction) []*ExecutionPhase
func (*PriorityOptimizationStrategy) Name ¶
func (pos *PriorityOptimizationStrategy) Name() string
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue represents a thread-safe queue for sharing artifacts between plugins
func (*Queue) FilterByType ¶
FilterByType returns items of a specific type
type QueueItem ¶
type QueueItem struct {
ID string `json:"id"`
Type string `json:"type"`
Data interface{} `json:"data"`
Source string `json:"source"`
Timestamp time.Time `json:"timestamp"`
Metadata map[string]interface{} `json:"metadata"`
Priority int `json:"priority"`
}
QueueItem represents an item in a queue
type QueueManager ¶
type QueueManager struct {
// contains filtered or unexported fields
}
QueueManager manages multiple queues
func NewQueueManager ¶
func NewQueueManager() *QueueManager
NewQueueManager creates a new queue manager
func (*QueueManager) CreateQueue ¶
func (qm *QueueManager) CreateQueue(name string) *Queue
CreateQueue creates a new queue
func (*QueueManager) GetOrCreateQueue ¶
func (qm *QueueManager) GetOrCreateQueue(name string) *Queue
GetOrCreateQueue returns an existing queue or creates a new one
func (*QueueManager) GetQueue ¶
func (qm *QueueManager) GetQueue(name string) (*Queue, bool)
GetQueue returns an existing queue
func (*QueueManager) GetQueueStats ¶
func (qm *QueueManager) GetQueueStats() map[string]QueueStats
GetQueueStats returns statistics for all queues
func (*QueueManager) ListQueues ¶
func (qm *QueueManager) ListQueues() []string
ListQueues returns all queue names
type QueueStats ¶
type QueueStats struct {
Name string `json:"name"`
Size int `json:"size"`
IsFull bool `json:"is_full"`
IsEmpty bool `json:"is_empty"`
MaxSize int `json:"max_size"`
}
QueueStats represents queue statistics
type RegistryStats ¶
type RegistryStats struct {
Total int `json:"total"`
Categories map[string]int `json:"categories"`
Passive int `json:"passive"`
Active int `json:"active"`
Confirmed int `json:"confirmed"`
}
RegistryStats contains statistics about the plugin registry
type ResourceAllocation ¶
type ResourceAllocation struct {
CPUCores int
MemoryMB int
DiskMB int
NetworkBW string
Processes int
}
ResourceAllocation represents allocated resources for execution
type ResourceManager ¶
type ResourceManager struct {
// contains filtered or unexported fields
}
ResourceManager manages resource allocation
func NewResourceManager ¶
func NewResourceManager() *ResourceManager
func (*ResourceManager) AllocateResources ¶
func (rm *ResourceManager) AllocateResources(phases []*ExecutionPhase) map[string]ResourceAllocation
type ResourceOptimizationStrategy ¶
type ResourceOptimizationStrategy struct{}
ResourceOptimizationStrategy optimizes based on resource usage
func (*ResourceOptimizationStrategy) Apply ¶
func (ros *ResourceOptimizationStrategy) Apply(phases []*ExecutionPhase, predictions map[string]PerformancePrediction) []*ExecutionPhase
func (*ResourceOptimizationStrategy) Name ¶
func (ros *ResourceOptimizationStrategy) Name() string
type Resources ¶
type Resources struct {
CPUCores int `json:"cpu_cores"`
MemoryMB int `json:"memory_mb"`
DiskMB int `json:"disk_mb"`
NetworkBandwidth string `json:"network_bandwidth"`
MaxFileHandles int `json:"max_file_handles"`
MaxProcesses int `json:"max_processes"`
RequiresRoot bool `json:"requires_root"`
NetworkAccess bool `json:"network_access"`
}
Resources defines plugin resource requirements
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages intelligent plugin execution planning and optimization
func NewScheduler ¶
NewScheduler creates a new intelligent scheduler
func (*Scheduler) CreateExecutionPlan ¶
func (s *Scheduler) CreateExecutionPlan(plugins []Plugin, targets []*models.Target) (*ExecutionPlan, error)
CreateExecutionPlan creates an optimized execution plan for plugins
type SharedContext ¶
type SharedContext struct {
// contains filtered or unexported fields
}
SharedContext enables plugins to share discoveries and communicate
func NewSharedContext ¶
func NewSharedContext(cache CacheInterface, intelligence IntelligenceInterface, logger Logger, metrics MetricsInterface) *SharedContext
NewSharedContext creates a new shared context
func (*SharedContext) AddDiscovery ¶
func (sc *SharedContext) AddDiscovery(discovery models.Discovery)
AddDiscovery adds a discovery to the shared context
func (*SharedContext) GetCache ¶
func (sc *SharedContext) GetCache() CacheInterface
GetCache returns the shared cache interface
func (*SharedContext) GetDiscoveries ¶
func (sc *SharedContext) GetDiscoveries(discoveryType string) []models.Discovery
GetDiscoveries returns all discoveries of a specific type
func (*SharedContext) GetDiscoveriesBySource ¶
func (sc *SharedContext) GetDiscoveriesBySource(source string) []models.Discovery
GetDiscoveriesBySource returns all discoveries from a specific source
func (*SharedContext) GetIntelligence ¶
func (sc *SharedContext) GetIntelligence() IntelligenceInterface
GetIntelligence returns the intelligence interface
func (*SharedContext) GetLogger ¶
func (sc *SharedContext) GetLogger() Logger
GetLogger returns the shared logger
func (*SharedContext) GetMetrics ¶
func (sc *SharedContext) GetMetrics() MetricsInterface
GetMetrics returns the metrics interface
func (*SharedContext) Subscribe ¶
func (sc *SharedContext) Subscribe() <-chan ContextEvent
Subscribe returns a channel to receive context events
type Stage ¶
type Stage struct {
Name string `json:"name"`
Category string `json:"category"`
Plugins []string `json:"plugins"`
Required bool `json:"required"`
NeedsConfirm bool `json:"needs_confirm"`
DependsOn []string `json:"depends_on"`
Timeout time.Duration `json:"timeout"`
Passive bool `json:"passive"`
Description string `json:"description"`
}
Stage represents a phase in the penetration testing workflow
type StageStatus ¶
type StageStatus struct {
State string `json:"state"` // pending, running, completed, failed, skipped
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
Results int `json:"results"`
Error string `json:"error,omitempty"`
}
StageStatus represents the status of a single stage
type SystemResources ¶
type TimelineEvent ¶
type TimelineEvent struct {
Timestamp time.Time `json:"timestamp"`
Event string `json:"event"`
Description string `json:"description"`
Source string `json:"source"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
TimelineEvent represents an event in a timeline
type Workspace ¶
type Workspace struct {
ID string `json:"id"`
Target string `json:"target"`
BasePath string `json:"base_path"`
ScanID string `json:"scan_id"`
CreatedAt time.Time `json:"created_at"`
Directories map[string]string `json:"directories"`
Files map[string][]string `json:"files"`
Metadata map[string]interface{} `json:"metadata"`
// contains filtered or unexported fields
}
Workspace represents a scan workspace with organized file structure
func (*Workspace) GetDirectory ¶
GetDirectory returns the full path for a directory type
func (*Workspace) GetMetadata ¶
GetMetadata returns workspace metadata
func (*Workspace) GetStats ¶
func (w *Workspace) GetStats() WorkspaceStats
GetStats returns workspace statistics
func (*Workspace) SaveResult ¶
func (w *Workspace) SaveResult(result models.PluginResult) error
SaveResult saves a plugin result to the workspace
func (*Workspace) SetMetadata ¶
SetMetadata sets workspace metadata
type WorkspaceManager ¶
type WorkspaceManager struct {
// contains filtered or unexported fields
}
WorkspaceManager manages scan workspaces and file organization
func NewWorkspaceManager ¶
func NewWorkspaceManager(basePath string) *WorkspaceManager
NewWorkspaceManager creates a new workspace manager
func (*WorkspaceManager) CreateWorkspace ¶
func (wm *WorkspaceManager) CreateWorkspace(target string, scanID string) (*Workspace, error)
CreateWorkspace creates a new workspace for a target
func (*WorkspaceManager) GetWorkspace ¶
func (wm *WorkspaceManager) GetWorkspace(workspaceID string) (*Workspace, bool)
GetWorkspace returns an existing workspace
func (*WorkspaceManager) ListWorkspaces ¶
func (wm *WorkspaceManager) ListWorkspaces() []*Workspace
ListWorkspaces returns all workspaces
type WorkspaceStats ¶
type WorkspaceStats struct {
TotalFiles int `json:"total_files"`
TotalSize int64 `json:"total_size"`
DirectoryCount int `json:"directory_count"`
FilesByType map[string]int `json:"files_by_type"`
CreatedAt time.Time `json:"created_at"`
LastModified time.Time `json:"last_modified"`
}
WorkspaceStats represents workspace statistics
type ZerologAdapter ¶
type ZerologAdapter struct {
// contains filtered or unexported fields
}
ZerologAdapter adapts zerolog.Logger to the Logger interface
func (*ZerologAdapter) Debug ¶
func (z *ZerologAdapter) Debug(msg string, fields ...interface{})
func (*ZerologAdapter) Error ¶
func (z *ZerologAdapter) Error(msg string, err error, fields ...interface{})
func (*ZerologAdapter) Fatal ¶
func (z *ZerologAdapter) Fatal(msg string, err error, fields ...interface{})
func (*ZerologAdapter) Info ¶
func (z *ZerologAdapter) Info(msg string, fields ...interface{})
func (*ZerologAdapter) Warn ¶
func (z *ZerologAdapter) Warn(msg string, fields ...interface{})
func (*ZerologAdapter) WithField ¶
func (z *ZerologAdapter) WithField(key string, value interface{}) Logger
func (*ZerologAdapter) WithFields ¶
func (z *ZerologAdapter) WithFields(fields map[string]interface{}) Logger