config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Debug is the most verbose logging level and will
	// report all logs
	Debug = "DEBUG"
	// Info level reports logrus.Info, logrus.Warn, and logrus.Error
	Info = "INFO"
	// Warn level reports logrus.Warn, and logrus.Error
	Warn = "WARN"
	// Error level reports ony error messages
	Error = "ERROR"
	// Off level turns off logs from logrus. instead the "stylized"
	// logging using terminal spinners will be used
	Off = "OFF"
)

Variables

This section is empty.

Functions

func Init

func Init() error

Init will initialize the configuration of the application

func ShouldUseColor

func ShouldUseColor() bool

ShouldUseColor will return true, if colored output should be used

func ShouldUseSpinner

func ShouldUseSpinner() bool

ShouldUseSpinner will return true if the "stylized"

Types

type File added in v1.0.0

type File struct {
	// Layer is the configuration of the layer detector
	// (i.e. build arguments, environment variables and statically defined creds)
	Layer LayerConfig
	// Filesystem is the configuration of the filesystem detector
	// (i.e. file and folder content)
	Filesystem FilesystemConfig
	// Rules is the list of user defined rules for matching secret strings
	Rules []UserRule
	// ExcludeDefaultRules will disable the default Patterns for detecting
	// secret strings2. See the variable [common.DefaultRules] for the full
	// list of defaults
	ExcludeDefaultRules bool
}

File is the user configuration file for the application

type FilesystemConfig added in v1.0.0

type FilesystemConfig struct {
	// Disable is a boolean indicating whether to run the detector
	Disable bool
}

type LayerConfig added in v1.0.0

type LayerConfig struct {
	// Disable is a boolean indicating whether to run the detector
	Disable bool
}

LayerConfig is the configuration of the layer detector, which detects secret strings in build arguments and environment variables

type LoggingLevel

type LoggingLevel = string

LoggingLevel is the verbosity level of logging

type UserRule added in v1.0.0

type UserRule struct {
	// Pattern is a regular expression for matching a secret.
	// must be compatible with [re2 syntax]
	//
	// [re2 syntax]: https://github.com/google/re2/wiki/Syntax
	Pattern string
	// Name is a human-readable name of the secret the expression
	// searches for (i.e. AWS SecretString Key, OAuth token, etc.)
	Name string
	// Entropy is the minimum entropy the string should have
	Entropy float64
}

UserRule represents a user defined string pattern/entropy for the layer and filesystem detectors to search

func ParseRules added in v1.0.0

func ParseRules(userRules []UserRule) (rules []common.SecretStringRule, errors []UserRule)

ParseRules will parse a list of UserRule patterns into regexp.Regexp and a common.SecretStringRule. All rules that result in error are returned in the second variables

Jump to

Keyboard shortcuts

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