trufflegopher

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Diff          string
	CommitHash    string
	CommitMessage string
	CommitDate    time.Time
	Branch        string
	Reason        string
}

Finding struct will contain details about the signature match on the scanned diff

type Signature

type Signature struct {
	Match       *regexp.Regexp
	Description string `yaml:"description"`
	Exp         string `yaml:"exp"`
}

Signature struct contains regexp to run agains every commit, more signatures = more computation

type Trufflegopher

type Trufflegopher struct {
	SearchedDiffs cmap.ConcurrentMap

	FindingsChan chan Finding
	// contains filtered or unexported fields
}

Trufflegopher is the core of the project, instanciate only once and call multiple time its ScanRepo function signatures and searchedDiff database will be shared between different parallel scans

func (*Trufflegopher) Init

func (t *Trufflegopher) Init(workers int, signatures []Signature) error

Init will setup Trufflegopher with necessary configuration.

func (*Trufflegopher) LoadState

func (t *Trufflegopher) LoadState(path string) error

LoadState loads a previously saved state of already scanned commits from a file

func (*Trufflegopher) SaveState

func (t *Trufflegopher) SaveState(path string) error

SaveState saves the current state of already scanned commits to a file

func (*Trufflegopher) ScanRepo

func (t *Trufflegopher) ScanRepo(path string) error

ScanRepo given a git repo location iterate on all commits TODO: provide some metrics (commits, line scanned, findings, repos, branches..)

Jump to

Keyboard shortcuts

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