hunter

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 13 Imported by: 0

README

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
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

Documentation

Overview

Package hunter contains secret hunting and file scanning tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Reporter format.Reporter
	Gitleaks config.Config
	ScanPath string
	Verbose  bool
	Redact   bool
	Debug    bool
	Workers  int
	Template string
}

Config takes all of the configurable parameters for a Hunter.

func NewConfig added in v0.5.9

func NewConfig(opts ...ConfigOption) *Config

NewConfig creates a Config instance.

type ConfigOption added in v0.7.0

type ConfigOption func(*Config)

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

func WithFormat added in v0.7.0

func WithFormat(reporter format.Reporter) ConfigOption

func WithGitleaksConfig added in v0.7.0

func WithGitleaksConfig(g config.Config) ConfigOption

func WithLogLevel added in v0.7.0

func WithLogLevel(level string) ConfigOption

func WithRedact added in v0.7.0

func WithRedact(redact bool) ConfigOption

func WithScanPath added in v0.7.0

func WithScanPath(path string) ConfigOption

func WithTemplate added in v0.7.0

func WithTemplate(template string) ConfigOption

func WithVerbose added in v0.7.0

func WithVerbose(verbose bool) ConfigOption

func WithWorkers added in v0.7.0

func WithWorkers(count int) ConfigOption

type Hunter

type Hunter struct {
	*Config
}

Hunter is the secret scanner.

func New added in v0.6.0

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 added in v0.6.0

func (h *Hunter) Report(w io.Writer, findings []report.Finding) error

Report prints out the Findings in the preferred output format.

Jump to

Keyboard shortcuts

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