Documentation
¶
Index ¶
- type BaseAdapter
- func (ba *BaseAdapter) AddDiscovery(discoveryType string, value interface{}, confidence float64)
- func (ba *BaseAdapter) Author() string
- func (ba *BaseAdapter) Category() string
- func (ba *BaseAdapter) CheckCache(ctx context.Context, key string) (interface{}, bool)
- func (ba *BaseAdapter) CleanupWorkspace(workspaceDir string)
- func (ba *BaseAdapter) Consumes() []string
- func (ba *BaseAdapter) CreateEvidence(evidenceType, content, url string, statusCode int, headers map[string]string) models.Evidence
- func (ba *BaseAdapter) CreateResult(target *models.Target, title, description string, severity string, ...) models.PluginResult
- func (ba *BaseAdapter) CreateWorkspace() (string, error)
- func (ba *BaseAdapter) Dependencies() []core.PluginDependency
- func (ba *BaseAdapter) Description() string
- func (ba *BaseAdapter) EstimatedDuration() time.Duration
- func (ba *BaseAdapter) ExecuteCommand(ctx context.Context, args []string) ([]byte, error)
- func (ba *BaseAdapter) ExtractDomain(rawURL string) string
- func (ba *BaseAdapter) GetCacheKey(target *models.Target, suffix string) string
- func (ba *BaseAdapter) GetDiscoveries(discoveryType string) []models.Discovery
- func (ba *BaseAdapter) GetIntelligencePatterns() []core.Pattern
- func (ba *BaseAdapter) IsPassive() bool
- func (ba *BaseAdapter) MaxConcurrency() int
- func (ba *BaseAdapter) Name() string
- func (ba *BaseAdapter) NormalizeURL(rawURL string) string
- func (ba *BaseAdapter) Prepare(ctx context.Context, target *models.Target, cfg *config.Config, ...) error
- func (ba *BaseAdapter) Priority() int
- func (ba *BaseAdapter) ProcessDiscovery(ctx context.Context, discovery models.Discovery) error
- func (ba *BaseAdapter) Provides() []string
- func (ba *BaseAdapter) RecordMetrics(duration time.Duration, resultCount int, errorCount int)
- func (ba *BaseAdapter) RequiredBinaries() []string
- func (ba *BaseAdapter) RequiredEnvVars() []string
- func (ba *BaseAdapter) RequiresConfirmation() bool
- func (ba *BaseAdapter) ResourceRequirements() core.Resources
- func (ba *BaseAdapter) SetCache(ctx context.Context, key string, value interface{}, ttl time.Duration)
- func (ba *BaseAdapter) SupportedTargetTypes() []string
- func (ba *BaseAdapter) Teardown(ctx context.Context) error
- func (ba *BaseAdapter) Validate(ctx context.Context, cfg *config.Config) error
- func (ba *BaseAdapter) ValidateTargetType(target *models.Target) bool
- func (ba *BaseAdapter) Version() string
- type BaseAdapterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseAdapter ¶
type BaseAdapter struct {
// contains filtered or unexported fields
}
BaseAdapter provides common functionality for plugin adapters
func NewBaseAdapter ¶
func NewBaseAdapter(config BaseAdapterConfig) *BaseAdapter
NewBaseAdapter creates a new base adapter with the given configuration
func (*BaseAdapter) AddDiscovery ¶
func (ba *BaseAdapter) AddDiscovery(discoveryType string, value interface{}, confidence float64)
AddDiscovery adds a discovery to the shared context
func (*BaseAdapter) Author ¶
func (ba *BaseAdapter) Author() string
func (*BaseAdapter) Category ¶
func (ba *BaseAdapter) Category() string
func (*BaseAdapter) CheckCache ¶
func (ba *BaseAdapter) CheckCache(ctx context.Context, key string) (interface{}, bool)
CheckCache checks if results are cached
func (*BaseAdapter) CleanupWorkspace ¶
func (ba *BaseAdapter) CleanupWorkspace(workspaceDir string)
CleanupWorkspace removes the temporary workspace
func (*BaseAdapter) Consumes ¶
func (ba *BaseAdapter) Consumes() []string
func (*BaseAdapter) CreateEvidence ¶
func (ba *BaseAdapter) CreateEvidence(evidenceType, content, url string, statusCode int, headers map[string]string) models.Evidence
CreateEvidence creates evidence for a finding
func (*BaseAdapter) CreateResult ¶
func (ba *BaseAdapter) CreateResult(target *models.Target, title, description string, severity string, data map[string]interface{}) models.PluginResult
CreateResult creates a standard plugin result
func (*BaseAdapter) CreateWorkspace ¶
func (ba *BaseAdapter) CreateWorkspace() (string, error)
CreateWorkspace creates a temporary workspace for the plugin
func (*BaseAdapter) Dependencies ¶
func (ba *BaseAdapter) Dependencies() []core.PluginDependency
func (*BaseAdapter) Description ¶
func (ba *BaseAdapter) Description() string
func (*BaseAdapter) EstimatedDuration ¶
func (ba *BaseAdapter) EstimatedDuration() time.Duration
func (*BaseAdapter) ExecuteCommand ¶
ExecuteCommand executes the tool command with given arguments
func (*BaseAdapter) ExtractDomain ¶
func (ba *BaseAdapter) ExtractDomain(rawURL string) string
ExtractDomain extracts domain from URL
func (*BaseAdapter) GetCacheKey ¶
func (ba *BaseAdapter) GetCacheKey(target *models.Target, suffix string) string
GetCacheKey generates a cache key for the plugin and target
func (*BaseAdapter) GetDiscoveries ¶
func (ba *BaseAdapter) GetDiscoveries(discoveryType string) []models.Discovery
GetDiscoveries retrieves discoveries of a specific type
func (*BaseAdapter) GetIntelligencePatterns ¶
func (ba *BaseAdapter) GetIntelligencePatterns() []core.Pattern
Intelligence methods
func (*BaseAdapter) MaxConcurrency ¶
func (ba *BaseAdapter) MaxConcurrency() int
func (*BaseAdapter) NormalizeURL ¶
func (ba *BaseAdapter) NormalizeURL(rawURL string) string
NormalizeURL normalizes a URL for consistent processing
func (*BaseAdapter) Prepare ¶
func (ba *BaseAdapter) Prepare(ctx context.Context, target *models.Target, cfg *config.Config, shared *core.SharedContext) error
Prepare sets up the plugin for execution
func (*BaseAdapter) Priority ¶
func (ba *BaseAdapter) Priority() int
func (*BaseAdapter) ProcessDiscovery ¶
ProcessDiscovery processes discoveries from other plugins
func (*BaseAdapter) Provides ¶
func (ba *BaseAdapter) Provides() []string
func (*BaseAdapter) RecordMetrics ¶
func (ba *BaseAdapter) RecordMetrics(duration time.Duration, resultCount int, errorCount int)
RecordMetrics records execution metrics
func (*BaseAdapter) RequiredBinaries ¶
func (ba *BaseAdapter) RequiredBinaries() []string
Dependency methods
func (*BaseAdapter) RequiredEnvVars ¶
func (ba *BaseAdapter) RequiredEnvVars() []string
func (*BaseAdapter) RequiresConfirmation ¶
func (ba *BaseAdapter) RequiresConfirmation() bool
func (*BaseAdapter) ResourceRequirements ¶
func (ba *BaseAdapter) ResourceRequirements() core.Resources
func (*BaseAdapter) SetCache ¶
func (ba *BaseAdapter) SetCache(ctx context.Context, key string, value interface{}, ttl time.Duration)
SetCache stores results in cache
func (*BaseAdapter) SupportedTargetTypes ¶
func (ba *BaseAdapter) SupportedTargetTypes() []string
func (*BaseAdapter) Teardown ¶
func (ba *BaseAdapter) Teardown(ctx context.Context) error
Teardown cleans up after plugin execution
func (*BaseAdapter) ValidateTargetType ¶
func (ba *BaseAdapter) ValidateTargetType(target *models.Target) bool
ValidateTargetType checks if the target type is supported
func (*BaseAdapter) Version ¶
func (ba *BaseAdapter) Version() string
type BaseAdapterConfig ¶
type BaseAdapterConfig struct {
Name string
Category string
Description string
Version string
Author string
ToolName string
ToolPath string
ToolArgs []string
Passive bool
Confirmation bool
Duration time.Duration
Concurrency int
Priority int
Resources core.Resources
Dependencies []core.PluginDependency
Provides []string
Consumes []string
Patterns []core.Pattern
}
BaseAdapterConfig contains configuration for base adapter