Documentation
¶
Index ¶
- type BugcrowdClient
- type Config
- type HackerOneClient
- type Manager
- func (m *Manager) AddProgram(program *Program) error
- func (m *Manager) GetAllInScopeItems() ([]ScopeItem, error)
- func (m *Manager) GetPlatformClient(platform Platform) PlatformClient
- func (m *Manager) GetProgram(programID string) (*Program, error)
- func (m *Manager) GetScopeForProgram(programID string) ([]ScopeItem, error)
- func (m *Manager) IsInScope(asset string) (bool, error)
- func (m *Manager) ListPrograms() ([]*Program, error)
- func (m *Manager) RemoveProgram(programID string) error
- func (m *Manager) SearchScope(query string) ([]ScopeItem, error)
- func (m *Manager) SetMonitorInterval(interval time.Duration)
- func (m *Manager) StartMonitoring() error
- func (m *Manager) StopMonitoring() error
- func (m *Manager) SyncAllPrograms() error
- func (m *Manager) SyncProgram(programID string) error
- func (m *Manager) ValidateAsset(asset string) (*ValidationResult, error)
- func (m *Manager) ValidateBatch(assets []string) ([]*ValidationResult, error)
- type Platform
- type PlatformClient
- type Program
- type Rule
- type ScopeCache
- type ScopeItem
- type ScopeManager
- type ScopeMonitor
- type ScopeStatus
- type ScopeType
- type ValidationResult
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BugcrowdClient ¶
type BugcrowdClient struct {
// contains filtered or unexported fields
}
BugcrowdClient implements the Bugcrowd API client
func NewBugcrowdClient ¶
func NewBugcrowdClient(logger *logger.Logger) *BugcrowdClient
NewBugcrowdClient creates a new Bugcrowd client
func (*BugcrowdClient) Configure ¶
func (c *BugcrowdClient) Configure(apiToken string)
Configure sets the API token
func (*BugcrowdClient) GetProgram ¶
GetProgram fetches a program's details including scope
func (*BugcrowdClient) ListPrograms ¶
func (c *BugcrowdClient) ListPrograms(ctx context.Context) ([]*Program, error)
ListPrograms lists available programs
type Config ¶
type Config struct { AutoSync bool `yaml:"auto_sync"` SyncInterval time.Duration `yaml:"sync_interval"` CacheTTL time.Duration `yaml:"cache_ttl"` ValidateWorkers int `yaml:"validate_workers"` StrictMode bool `yaml:"strict_mode"` // Fail closed on ambiguous cases EnableMonitoring bool `yaml:"enable_monitoring"` MonitorInterval time.Duration `yaml:"monitor_interval"` }
Config contains scope manager configuration
type HackerOneClient ¶
type HackerOneClient struct {
// contains filtered or unexported fields
}
HackerOneClient implements the HackerOne API client
func NewHackerOneClient ¶
func NewHackerOneClient(logger *logger.Logger) *HackerOneClient
NewHackerOneClient creates a new HackerOne client
func (*HackerOneClient) Configure ¶
func (c *HackerOneClient) Configure(username, apiKey string)
Configure sets the API credentials
func (*HackerOneClient) GetProgram ¶
GetProgram fetches a program's details including scope
func (*HackerOneClient) ListPrograms ¶
func (c *HackerOneClient) ListPrograms(ctx context.Context) ([]*Program, error)
ListPrograms lists available programs
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager implements comprehensive scope management
func NewManager ¶
NewManager creates a new scope manager
func (*Manager) AddProgram ¶
AddProgram adds a new bug bounty program
func (*Manager) GetAllInScopeItems ¶
GetAllInScopeItems returns all in-scope items
func (*Manager) GetPlatformClient ¶
func (m *Manager) GetPlatformClient(platform Platform) PlatformClient
GetPlatformClient returns a platform client
func (*Manager) GetProgram ¶
GetProgram retrieves a program by ID
func (*Manager) GetScopeForProgram ¶
GetScopeForProgram returns scope items for a program
func (*Manager) ListPrograms ¶
ListPrograms lists all programs
func (*Manager) RemoveProgram ¶
RemoveProgram removes a program
func (*Manager) SearchScope ¶
SearchScope searches for scope items matching a query
func (*Manager) SetMonitorInterval ¶
SetMonitorInterval sets the monitoring interval
func (*Manager) StartMonitoring ¶
StartMonitoring starts the scope monitoring service
func (*Manager) StopMonitoring ¶
StopMonitoring stops the scope monitoring service
func (*Manager) SyncAllPrograms ¶
SyncAllPrograms syncs all active programs
func (*Manager) SyncProgram ¶
SyncProgram syncs a program's scope from the platform
func (*Manager) ValidateAsset ¶
func (m *Manager) ValidateAsset(asset string) (*ValidationResult, error)
ValidateAsset validates if an asset is in scope
func (*Manager) ValidateBatch ¶
func (m *Manager) ValidateBatch(assets []string) ([]*ValidationResult, error)
ValidateBatch validates multiple assets
type PlatformClient ¶
type PlatformClient interface { GetProgram(ctx context.Context, handle string) (*Program, error) ListPrograms(ctx context.Context) ([]*Program, error) }
PlatformClient is the interface all platform clients must implement
type Program ¶
type Program struct { ID string `json:"id"` Platform Platform `json:"platform"` Name string `json:"name"` Handle string `json:"handle"` // HackerOne/Bugcrowd handle URL string `json:"url"` Scope []ScopeItem `json:"scope"` OutOfScope []ScopeItem `json:"out_of_scope"` Rules []Rule `json:"rules"` TestingGuidelines string `json:"testing_guidelines,omitempty"` Credentials map[string]string `json:"credentials,omitempty"` VPNRequired bool `json:"vpn_required"` MaxBounty float64 `json:"max_bounty,omitempty"` LastSynced time.Time `json:"last_synced"` Metadata map[string]string `json:"metadata,omitempty"` Active bool `json:"active"` }
Program represents a bug bounty program
type Rule ¶
type Rule struct { ID string `json:"id"` Type string `json:"type"` // rate_limit, testing_hours, auth_required, etc. Description string `json:"description"` Value string `json:"value"` Applies []string `json:"applies_to,omitempty"` // specific scope items this applies to }
Rule represents a program-specific rule
type ScopeCache ¶
type ScopeCache struct {
// contains filtered or unexported fields
}
ScopeCache provides caching for scope validations
func NewScopeCache ¶
func NewScopeCache(ttl time.Duration) *ScopeCache
NewScopeCache creates a new cache
func (*ScopeCache) GetValidation ¶
func (c *ScopeCache) GetValidation(asset string) *ValidationResult
GetValidation retrieves a cached validation result
func (*ScopeCache) StoreValidation ¶
func (c *ScopeCache) StoreValidation(asset string, result *ValidationResult)
StoreValidation stores a validation result
type ScopeItem ¶
type ScopeItem struct { ID string `json:"id"` Type ScopeType `json:"type"` Value string `json:"value"` Status ScopeStatus `json:"status"` Description string `json:"description,omitempty"` Severity string `json:"severity,omitempty"` EnvironmentType string `json:"environment_type,omitempty"` // production, staging, dev MaxSeverity string `json:"max_severity,omitempty"` Restrictions []string `json:"restrictions,omitempty"` Instructions string `json:"instructions,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` CompiledPattern *regexp.Regexp `json:"-"` LastUpdated time.Time `json:"last_updated"` }
ScopeItem represents a single scope entry
type ScopeManager ¶
type ScopeManager interface { // Program management AddProgram(program *Program) error RemoveProgram(programID string) error GetProgram(programID string) (*Program, error) ListPrograms() ([]*Program, error) SyncProgram(programID string) error SyncAllPrograms() error // Validation ValidateAsset(asset string) (*ValidationResult, error) ValidateBatch(assets []string) ([]*ValidationResult, error) IsInScope(asset string) (bool, error) // Scope queries GetScopeForProgram(programID string) ([]ScopeItem, error) GetAllInScopeItems() ([]ScopeItem, error) SearchScope(query string) ([]ScopeItem, error) // Real-time monitoring StartMonitoring() error StopMonitoring() error }
ScopeManager is the main interface for scope management
type ScopeMonitor ¶
type ScopeMonitor struct {
// contains filtered or unexported fields
}
ScopeMonitor monitors for scope changes
func NewScopeMonitor ¶
NewScopeMonitor creates a new scope monitor
func (*ScopeMonitor) SetInterval ¶
func (m *ScopeMonitor) SetInterval(interval time.Duration)
SetInterval sets the monitoring interval
type ScopeStatus ¶
type ScopeStatus string
ScopeStatus represents if an item is in or out of scope
const ( ScopeStatusInScope ScopeStatus = "in_scope" ScopeStatusOutOfScope ScopeStatus = "out_of_scope" ScopeStatusUnknown ScopeStatus = "unknown" )
type ScopeType ¶
type ScopeType string
ScopeType represents the type of scope item
const ( ScopeTypeDomain ScopeType = "domain" ScopeTypeURL ScopeType = "url" ScopeTypeIP ScopeType = "ip" ScopeTypeIPRange ScopeType = "ip_range" ScopeTypeApplication ScopeType = "application" ScopeTypeAPI ScopeType = "api" ScopeTypeWildcard ScopeType = "wildcard" ScopeTypeMobile ScopeType = "mobile" ScopeTypeSource ScopeType = "source_code" ScopeTypeExecutable ScopeType = "executable" ScopeTypeHardware ScopeType = "hardware" ScopeTypeOther ScopeType = "other" )
type ValidationResult ¶
type ValidationResult struct { Asset string `json:"asset"` Status ScopeStatus `json:"status"` MatchedItem *ScopeItem `json:"matched_item,omitempty"` Program *Program `json:"program,omitempty"` Reason string `json:"reason,omitempty"` Restrictions []string `json:"restrictions,omitempty"` ApplicableRules []Rule `json:"applicable_rules,omitempty"` ValidatedAt time.Time `json:"validated_at"` }
ValidationResult contains the result of scope validation
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates assets against scope
func NewValidator ¶
NewValidator creates a new validator
func (*Validator) Validate ¶
func (v *Validator) Validate(asset string) *ValidationResult
Validate checks if an asset is in scope