Documentation
¶
Index ¶
- Variables
- func LoadSignatures(content []byte, mLevel int, loadFromConfig bool) map[string]Signature
- type File
- type PatternSignature
- func (s PatternSignature) Check(path string, kind types.Type, contents []byte, showSecrets bool, ...) []*sarif.Result
- func (s PatternSignature) ConfidenceLevel() int
- func (s PatternSignature) Description() *string
- func (s PatternSignature) Enable() int
- func (s PatternSignature) SignatureID() *string
- func (s PatternSignature) SignaturePattern() *regexp.Regexp
- type Secret
- type SecretConfig
- type Signature
- type SignatureConfig
- type SignatureDef
- type SignaturesMetaData
Constants ¶
This section is empty.
Variables ¶
var FalsePositives []regexp.Regexp
var IgnoreList []regexp.Regexp
var Signatures = make(map[string]Signature)
Signatures holds a list of all signatures used during the session
Functions ¶
Types ¶
type File ¶
type File struct {
Reference file.Reference
Reader io.ReadCloser
}
Distro represents a Linux Distribution.
type PatternSignature ¶
type PatternSignature struct {
// contains filtered or unexported fields
}
PatternSignature holds the information about a pattern signature which is a regex used to match content within a file
func (PatternSignature) ConfidenceLevel ¶
func (s PatternSignature) ConfidenceLevel() int
ConfidenceLevel sets the confidence level of the pattern
func (PatternSignature) Description ¶
func (s PatternSignature) Description() *string
Description sets the user comment of the signature
func (PatternSignature) Enable ¶
func (s PatternSignature) Enable() int
Enable sets whether as signature is active or not
func (PatternSignature) SignatureID ¶
func (s PatternSignature) SignatureID() *string
SignatureID sets the id used to identify the signature. This id is immutable and generated from a has of the signature and is changed with every update to a signature.
func (PatternSignature) SignaturePattern ¶ added in v0.0.4
func (s PatternSignature) SignaturePattern() *regexp.Regexp
SignaturePattern gets the pattern of the signature
type SecretConfig ¶ added in v0.0.8
type Signature ¶
type Signature interface {
Description() *string
Enable() int
ConfidenceLevel() int
SignatureID() *string
Check(path string, kind types.Type, contents []byte, showSecrets bool, secretChar string, secretRatio float64) []*sarif.Result
SignaturePattern() *regexp.Regexp
}
Signature is an expression that we are looking for in a file
type SignatureConfig ¶
type SignatureConfig struct {
Meta SignaturesMetaData `yaml:"Meta"`
Ignore []string `yaml:"Ignore"`
//PatternSignatures []SignatureDef `yaml:"PatternSignatures"`
Signatures []SignatureDef `yaml:"Signatures"`
FalsePositive []string `yaml:"FalsePositive"`
}
SignatureConfig holds the base file structure for the signatures file
type SignatureDef ¶
type SignatureDef struct {
Comment string `yaml:"comment" json:"comment"`
Description string `yaml:"description" json:"description"`
Enable int `yaml:"enable" json:"enable"`
Entropy float64 `yaml:"entropy" json:"entropy"`
Match string `yaml:"match" json:"match"`
ConfidenceLevel int `yaml:"confidence-level" json:"confidence-level"`
Severity float64 `json:"severity,string"`
Path string `yaml:"path" json:"path"`
SignatureID string `yaml:"signatureid" json:"signatureid"`
}
SignatureDef maps to a signature within the yaml file
type SignaturesMetaData ¶
SignaturesMetaData is used by updateSignatures to determine if/how to update the signatures