Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRelativeFilename ¶
GetRelativeFilename returns filename relative to scan root directory
Types ¶
type Defect ¶
type Defect struct { Lines []int Tag string AdditionalInfo string `yaml:"additional-info,omitempty"` // contains filtered or unexported fields }
Defect represents a unique secret combination of a file and a unique secret
type FileDefects ¶
FileDefects is the mapping of files
func NewFileDefects ¶
func NewFileDefects() FileDefects
NewFileDefects allocates FileDefects structure
func (*FileDefects) AddInstance ¶
func (this *FileDefects) AddInstance(fileName string, secret secret.Secret) (defectInstance *Defect, newDefect bool)
AddInstance adds a new Defect structure when secret is the first occurrence detected in fileName. If secret is not the first occurrence found in fileName the Defect is modified to inlcude the additional line number where the secret was again detected.
type FileRepo ¶
type FileRepo struct { ID int64 `yaml:",omitempty"` //Intialized for GithubFileRepository Org string `yaml:",omitempty"` //Intialized for GithubFileRepository Name string `yaml:",omitempty"` //Intialized for GithubFileRepository Branch string `yaml:",omitempty"` //Intialized for GithubFileRepository Head string `yaml:",omitempty"` //Intialized for GithubFileRepository LastPush string `yaml:"last-push,omitempty"` //Intialized for GithubFileRepository LocalDir string `yaml:",omitempty"` //Intialized for LocalFileRepository }
FileRepo documents the FileRepository scanned
type Report ¶
type Report struct { Repositories map[FileRepo]FileDefects DefectCount int // contains filtered or unexported fields }
Report fully documents detected secrets and is written to the final output file
func NewDefectReport ¶
NewDefectReport initialzied a DefectReport structure used to maintain and report detected secrets
func (*Report) AddDefects ¶
func (this *Report) AddDefects(currentRepo FileRepo, fileDefects FileDefects)
AddDefects adds a FileDefect collection to currentRepo
func (*Report) ReduceAndExploit ¶
func (this *Report) ReduceAndExploit(secrets []secret.Secret, scanRoot string) FileDefects
ReduceAndExploit consolidates instances of the same secret and executes the optional Expoloit function specified in the configuration rule used to detect the Value.