rule

package
v0.0.0-...-0c672af Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TARGET_GROUP_NAME regex configuration group name for entropy calculation
	TARGET_GROUP_NAME = "suspect"
)

Variables

This section is empty.

Functions

func Entropy

func Entropy(s string) float64

Entropy returns the Shanon entropy of the input string

Types

type List

type List struct {
	Rules []Rule
}

List collection of Rule

type Rule

type Rule struct {
	Target    []*regexp.Regexp
	Except    []*regexp.Regexp
	Entropy   float32
	Tag       string
	ExploitFn string
}

Rule represent the conditions that must be met to realize secret detection

func (*Rule) Match

func (rule *Rule) Match(text string) (matches []string, found bool)

Match takes input data and returns one or more string matches when all conditions in Rule are met.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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