matching

package
v0.0.0-...-81b3271 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package matching contains specific functionality elated to scanning and detecting secrets within the given input.

Package matching contains specific functionality elated to scanning and detecting secrets within the given input.

Package matching contains specific functionality elated to scanning and detecting secrets within the given input.

Package matching contains specific functionality elated to scanning and detecting secrets within the given input.

Package matching contains specific functionality elated to scanning and detecting secrets within the given input.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentSignature

type ContentSignature struct {
	MatchOn     string
	Description string
	Comment     string
}

func (ContentSignature) GetComment

func (c ContentSignature) GetComment() string

GetComment will return the comment of the signature

func (ContentSignature) GetDescription

func (c ContentSignature) GetDescription() string

GetDescription will return the description of the signature

func (ContentSignature) Match

func (c ContentSignature) Match(target MatchTarget) (bool, error)

Match will attempt a match based on the content of the file. This is used to match items like access tokens or passwords within a given file.

type FileSignature

type FileSignature struct {
	Part        string
	MatchOn     string
	Description string
	Comment     string
}

FileSignature holds various values associated with a specific signature used to find a secret.

func (FileSignature) GetComment

func (f FileSignature) GetComment() string

GetComment will return the comment of the signature

func (FileSignature) GetDescription

func (f FileSignature) GetDescription() string

GetDescription will return the description of the signature

func (FileSignature) Match

func (f FileSignature) Match(target MatchTarget) (bool, error)

Match will attempt to match the path or a given part of the file name. This is used to match specific files such as private keys or specific token files.

type FileSignatureType

type FileSignatureType struct {
	Extension string
	Filename  string
	Path      string
}

FileSignatureType is a breakdown of the various parts associated with a file

type Finding

type Finding struct {
	Id                          string
	FilePath                    string
	Action                      string
	FileSignatureDescription    string
	FileSignatureComment        string
	ContentSignatureDescription string
	ContentSignatureComment     string
	RepositoryOwner             string
	RepositoryName              string
	CommitHash                  string
	CommitMessage               string
	CommitAuthor                string
	FileUrl                     string
	CommitUrl                   string
	RepositoryUrl               string
	CloneUrl                    string
}

Finding is a secret that has been discovered within a target by a discovery method

func (*Finding) Initialize

func (f *Finding) Initialize(scanType string)

Initialize will set the urls and create an ID for inclusion within the finding

type MatchTarget

type MatchTarget struct {
	Path      string
	Filename  string
	Extension string
	Content   string
}

MatchTarget holds the various parts of a file that will be matched using either regex's or simple pattern matches.

func NewMatchTarget

func NewMatchTarget(path string) MatchTarget

NewMatchTarget splits a filename into its composite pieces so that it may be measured and classified for scanning

func (*MatchTarget) IsSkippable

func (f *MatchTarget) IsSkippable(paths []string, exts []string) bool

IsSkippable will check the matched file against a list of extensions or paths either supplied by the user or set by default

type Signatures

type Signatures struct {
	FileSignatures    []FileSignature
	ContentSignatures []ContentSignature
}

Signatures holds a list of all signatures used during the session

func (*Signatures) Load

func (s *Signatures) Load(mode int) error

Load will load all known signatures for the various match types into the session

Jump to

Keyboard shortcuts

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