Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ScanTypeGo indicates Golang files ScanTypeGo = "go" // ScanTypeYaml indicates YAML files ScanTypeYaml = "yaml" // ScanTypeJSON indicates JSON files ScanTypeJSON = "json" // ScanTypeProperties indicates properties files ScanTypeProperties = "properties" // ScanTypePrivateKey indicates private key files ScanTypePrivateKey = "privatekey" // ScanTypeXML indicates XML files ScanTypeXML = "xml" // ScanTypePHP indicates PHP files ScanTypePHP = "php" // ScanTypeBash indicates Bash files ScanTypeBash = "bash" // ScanTypeGeneric indicates a file parsable as generic text ScanTypeGeneric = "generic" // ScanTypeGenericCode indicates a file parsable as generic code ScanTypeGenericCode = "generic_code" // ScanTypeJavaScript indicates JavaScript files ScanTypeJavaScript = "javascript" // ScanTypeTypeScript indicates TypeScript files ScanTypeTypeScript = "typescript" // ScanTypeHTML indicates HTML files ScanTypeHTML = "html" )
Variables ¶
View Source
var ( //ScanPath is the path which should be scanned ScanPath string )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
VariableNamePatterns []string `yaml:"variableNamePatterns,flow"`
VariableNameExclusionPattern string `yaml:"variableNameExclusionPattern"`
XMLAttributeNameExclusionPattern string `yaml:"xmlAttributeNameExclusionPattern"`
ValueMatchPatterns []ValueMatchPattern `yaml:"valueMatchPatterns,flow"`
FullTextValueExcludePatterns []string `yaml:"fullTextValueExcludePatterns,flow"`
VariableValueExcludePatterns []string `yaml:"variableValueExcludePatterns,flow"`
MinPasswordLength int `yaml:"minPasswordLength"`
ExcludeTests bool `yaml:"excludeTests"`
ExcludeComments bool `yaml:"excludeComments"`
TestDirectories []string `yaml:"testDirectories,flow"`
IgnoreFiles []string `yaml:"ignoreFiles,flow"`
ScanTypes []string `yaml:"scanTypes,flow"`
GenericFileExtensions []string `yaml:"genericFileExtensions"`
GenericCodeFileExtensions []string `yaml:"genericCodeFileExtensions"`
DisableOutputColors bool `yaml:"disableOutputColors"`
Verbose bool `yaml:"verbose"`
}
Config contains all the configuration for the credential detector
func LoadConfig ¶
LoadConfig loads configuration based on the provided config path and root config path. If rootConfigPath is empty, the default will be used
func MergeConfigs ¶ added in v1.17.0
MergeConfigs merges the additions config on top of the root config. Scalar fields are replaced when non-zero; list fields are appended.
func ParseConfig ¶
ParseConfig parses the given YAML file data into a configuration object
func (Config) IsIgnoreFile ¶ added in v1.7.1
IsIgnoreFile returns true if the given file/directory matches one of the configured files to ignore
func (Config) IsTestDirectory ¶
IsTestDirectory returns true if the given directory matches one of the configured test directories
type ValueMatchPattern ¶ added in v1.10.0
ValueMatchPattern is a tuple of pattern and name
Click to show internal directories.
Click to hide internal directories.