Skip to content

Latest commit

History

History

hunter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

hunter

import "github.com/brittonhayes/pillager/pkg/hunter"

Package hunter contains secret hunting and file scanning tools.

Index

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(opts ...ConfigOption) *Config

NewConfig creates a Config instance.

ConfigOption is a convenient type alias for func(*Config).

type ConfigOption func(*Config)

func WithFS

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

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