Documentation
¶
Index ¶
- func ContainsEmailDomainStopWord(s string) (bool, string)
- func ContainsStopWord(s string) (bool, string)
- func ContainsUrlDomainStopWord(s string) (bool, string)
- type Credential
- type Decoder
- type EncodedSegment
- type FileItem
- type Fragment
- type Identifiers
- type Location
- type Logging
- type Options
- type Parser
- type ParserDriver
- type ParserNotFoundError
- type Runner
- func (run *Runner) AddSkipped()
- func (run *Runner) Close()
- func (run *Runner) Detect(fragment Fragment) []models.Finding
- func (run *Runner) DetectBytes(content []byte) []models.Finding
- func (run *Runner) DetectFile(file *models.File) error
- func (run *Runner) DetectReader(r io.Reader, bufSize int) ([]models.Finding, error)
- func (run *Runner) DetectString(content string) []models.Finding
- func (run *Runner) ParsePositionalFile(file FileItem) error
- func (run *Runner) Run() Status
- type Status
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsStopWord ¶
Types ¶
type Credential ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes various types of data in place
type EncodedSegment ¶
type EncodedSegment struct {
// contains filtered or unexported fields
}
EncodedSegment represents a portion of text that is encoded in some way. `decode` supports recusive decoding and can result in "segment trees". There can be multiple segments in the original text, so each can be thought of as its own tree with the root being the original segment.
type Fragment ¶
type Fragment struct {
// Raw is the raw content of the fragment
Raw string
Bytes []byte
// FilePath is the path to the file if applicable
FilePath string
SymlinkFile string
// CommitSHA is the SHA of the commit if applicable
CommitSHA string
// contains filtered or unexported fields
}
Fragment contains the data to be scanned
type Identifiers ¶
func (*Identifiers) LoadRules ¶
func (id *Identifiers) LoadRules() error
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
Location represents a location in a file
type Logging ¶
type Logging struct {
// Debug display debug level logging
Debug bool
// LogScanErrors log errors related to scanning
LogScanErrors bool
// Silence all logging
Silence bool
//Text file output
TextFile string
}
Logging is log related options
type Options ¶
type Options struct {
// Logging is logging options
Logging Logging
// Chrome is Chrome related options
Writer Writer
// Parser is typically Parser options
Parser Parser
// Force use current path as Temp Path
StoreLocalWorkspace bool
// Default DB as Control Only (ignore other tables)
DefaultDBAsControlOnly bool
DateFilter *time.Time
IndexedDateFilter *time.Time
}
Options are global github.com/helviojunior/intelparserintelparser options
func NewDefaultOptions ¶
func NewDefaultOptions() *Options
NewDefaultOptions returns Options with some default values
type Parser ¶
type Parser struct {
// Path/file to be parsed
Path string
// Threads (not really) are the number of goroutines to use.
// More soecifically, its the go-rod page pool well use.
Threads int
//Size of near text data
NearTextSize int
StoreNearText bool
}
Scan is scanning related options
type ParserDriver ¶
type ParserDriver interface {
ParseFile(runner *Runner, file FileItem) (*models.File, error)
Close()
}
Parser is the interface file drivers will implement.
type ParserNotFoundError ¶
type ParserNotFoundError struct {
Err error
}
ChromeNotFoundError signals that chrome is not available
func (ParserNotFoundError) Error ¶
func (e ParserNotFoundError) Error() string
type Runner ¶
type Runner struct {
Parser ParserDriver
// Files to scan.
Files chan FileItem
Identifiers Identifiers
// MaxDecodeDepths limits how many recursive decoding passes are allowed
MaxDecodeDepth int
// files larger than this will be skipped
MaxTargetMegaBytes int
// contains filtered or unexported fields
}
Runner is a runner that probes web targets using a driver
func NewRunner ¶
func NewRunner(logger *slog.Logger, parser ParserDriver, opts Options, writers []writers.Writer) (*Runner, error)
New gets a new Runner ready for probing. It's up to the caller to call Close() on the runner
func (*Runner) AddSkipped ¶
func (run *Runner) AddSkipped()
func (*Runner) DetectBytes ¶
DetectBytes scans the given bytes and returns a list of findings
func (*Runner) DetectReader ¶
DetectReader accepts an io.Reader and a buffer size for the reader in KB
func (*Runner) DetectString ¶
DetectString scans the given string and returns a list of findings