import "github.com/brittonhayes/pillager/pkg/hunter"
Package hunter contains secret hunting and file scanning tools.
- type Config
- type ConfigOption
- func WithFS(fs afero.Fs) ConfigOption
- func WithFormat(reporter format.Reporter) ConfigOption
- func WithGitleaksConfig(g config.Config) ConfigOption
- func WithLogLevel(level string) ConfigOption
- func WithRedact(redact bool) ConfigOption
- func WithScanPath(path string) ConfigOption
- func WithTemplate(template string) ConfigOption
- func WithVerbose(verbose bool) ConfigOption
- func WithWorkers(count int) ConfigOption
- type Hunter
type Config
Config takes all of the configurable parameters for a Hunter.
type Config struct {
Filesystem afero.Fs
Reporter format.Reporter
Gitleaks config.Config
ScanPath string
Verbose bool
Redact bool
Debug bool
Workers int
Template string
}
func NewConfig
func NewConfig(opts ...ConfigOption) *Config
NewConfig creates a Config instance.
type ConfigOption
ConfigOption is a convenient type alias for func(*Config).
type ConfigOption func(*Config)
func WithFS
func WithFS(fs afero.Fs) ConfigOption
func WithFormat
func WithFormat(reporter format.Reporter) ConfigOption
func WithGitleaksConfig
func WithGitleaksConfig(g config.Config) ConfigOption
func WithLogLevel
func WithLogLevel(level string) ConfigOption
func WithRedact
func WithRedact(redact bool) ConfigOption
func WithScanPath
func WithScanPath(path string) ConfigOption
func WithTemplate
func WithTemplate(template string) ConfigOption
func WithVerbose
func WithVerbose(verbose bool) ConfigOption
func WithWorkers
func WithWorkers(count int) ConfigOption
type Hunter
Hunter is the secret scanner.
type Hunter struct {
*Config
}
func New
func New(opts ...ConfigOption) (*Hunter, error)
New creates an instance of the Hunter.
func (*Hunter) Hunt
func (h *Hunter) Hunt() ([]report.Finding, error)
Hunt walks over the filesystem at the configured path, looking for sensitive information.
func (*Hunter) Report
func (h *Hunter) Report(w io.Writer, findings []report.Finding) error
Report prints out the Findings in the preferred output format.
Generated by gomarkdoc