scan

package
v0.0.0-...-1e00a76 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FsScanner

type FsScanner struct {
	RulesPath string
	Root      string
	Result    []model.Leak

	Debug       bool
	ProgressBar *progressbar.ProgressBar
	RuleSet     *model.RuleSet
	Output      ReportInterface
}

FsScanner stores configuration for scanning a local directory in the fs

func NewFsScanner

func NewFsScanner(root, rulespath string, output ReportInterface, debug bool) *FsScanner

NewFsScanner creates a new FsScanner

func (*FsScanner) Scan

func (f *FsScanner) Scan(concurrent int)

Scan iterates over each file recursively and use defined rules to analyse for possible leaks

func (FsScanner) Type

func (f FsScanner) Type() string

Type returns the string type of the scanner ("fs")

type GitScanner

type GitScanner struct {
	// Where to store local copy of the repo
	Cache string
	// Path to the rule definition file
	// If set to "" automatically used default resources.yaml embedded by packr
	RulesPath string
	Repo      *model.Repo
	RuleSet   *model.RuleSet
	Result    []model.Leak

	// Whether or not to display progressbar (mainly for testing)
	Debug       bool
	ProgressBar *progressbar.ProgressBar
	// Output writer interface
	Output ReportInterface
}

GitScanner stores configuration for scanning a git repository

func NewGitScanner

func NewGitScanner(source, cache, rulespath string, output ReportInterface, debug bool) *GitScanner

NewGitScanner creates a new git Scanner

func (*GitScanner) Scan

func (g *GitScanner) Scan(concurrent int)

Scan iterates over each commits and use defined rules to analyse for possible leaks

func (GitScanner) Type

func (g GitScanner) Type() string

Type returns the string type of the scanner ("git")

type HTMLReport

type HTMLReport struct {
	Outfile  string
	Template *template.Template
}

HTMLReport implements the ReportInterface to write html reports

func (HTMLReport) Write

func (h HTMLReport) Write(s Scanner)

type ReportInterface

type ReportInterface interface {
	Write(Scanner)
}

ReportInterface modules writer behaviour for different reports

type Scanner

type Scanner interface {
	Scan(concurrent int)
	Type() string
}

Scanner is an interface for scanning behaviours

type YamlReport

type YamlReport struct {
	Outfile string
}

YamlReport implements the ReportInterface to write yaml reports

func (YamlReport) Write

func (y YamlReport) Write(s Scanner)

Jump to

Keyboard shortcuts

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