scanner

package
v5.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultRules

func GetDefaultRules(includeDeprecated bool) []*ruledefine.Rule

func WithPluginChannels

func WithPluginChannels(pluginChannels plugins.PluginChannels) scannerOption

Types

type ScanConfig added in v5.1.1

type ScanConfig struct {
	IgnoreResultIds []string
	SelectRules     []string
	IgnoreRules     []string
	CustomRules     []*ruledefine.Rule
	WithValidation  bool
	PluginName      string

	// Limit settings
	MaxFindings               uint64 // Total findings limit across entire scan (0 = no limit)
	MaxRuleMatchesPerFragment uint64 // Regex matches limit per rule per fragment (0 = no limit)
	MaxSecretSize             uint64 // Maximum secret size in bytes (0 = no limit)
}

ScanConfig contains configuration options for scanning.

type ScanItem

type ScanItem struct {
	Content *string
	// Unique identifier of the item
	ID string
	// User-friendly description and/or link to the item
	Source string
}

func (ScanItem) GetContent

func (i ScanItem) GetContent() *string

func (ScanItem) GetGitInfo

func (i ScanItem) GetGitInfo() *plugins.GitInfo

func (ScanItem) GetID

func (i ScanItem) GetID() string

func (ScanItem) GetSource

func (i ScanItem) GetSource() string

type Scanner

type Scanner interface {
	Reset(scanConfig *ScanConfig, opts ...engine.EngineOption) error
	Scan(scanItems []ScanItem, scanConfig *ScanConfig, opts ...engine.EngineOption) (reporting.IReport, error)
	// ScanDynamic performs a scans with custom input of items and optional custom plugin channels.
	//
	// To provide custom plugin channels, use engine.WithPluginChannels:
	//
	//	pluginChannels := plugins.NewChannels(func(c *plugins.Channels) {
	//		c.Items = make(chan plugins.ISourceItem, 100)
	//	})
	//	s.ScanDynamic(ScanConfig{}, engine.WithPluginChannels(pluginChannels))
	ScanDynamic(itemsIn <-chan ScanItem, scanConfig *ScanConfig, opts ...engine.EngineOption) (reporting.IReport, error)
}

func NewScanner

func NewScanner() Scanner

Jump to

Keyboard shortcuts

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