base

package
v0.0.0-...-f5a5a56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

func (ba *BaseAdapter) ExecuteCommand(ctx context.Context, args []string) ([]byte, error)

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) IsPassive

func (ba *BaseAdapter) IsPassive() bool

Capability methods

func (*BaseAdapter) MaxConcurrency

func (ba *BaseAdapter) MaxConcurrency() int

func (*BaseAdapter) Name

func (ba *BaseAdapter) Name() string

Metadata methods

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

func (ba *BaseAdapter) ProcessDiscovery(ctx context.Context, discovery models.Discovery) error

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) Validate

func (ba *BaseAdapter) Validate(ctx context.Context, cfg *config.Config) error

Validate checks if the plugin can run in the current environment

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL