config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FlagSet should be used by analyzers to reuse -config flag.
	FlagSet flag.FlagSet
)

Functions

func SetBytes added in v0.1.5

func SetBytes(b []byte)

SetBytes allows the contents of a configuration file to be provided directly. This is useful when running the tool in an environment where file access is inconvenient.

Types

type Config

type Config struct {
	ReportMessage             string
	Sources                   []sourceMatcher
	Sinks                     []funcMatcher
	Sanitizers                []funcMatcher
	FieldTags                 []fieldTagMatcher
	Exclude                   []funcMatcher
	AllowPanicOnTaintedValues bool
	// Whether to use EAR pointer analysis as the taint propagation engine.
	UseEAR bool
	// Control the span of the call chain from a source to a sink when analyzing EAR references.
	// This can reduce false positives and enhance the performance.
	EARTaintCallSpan uint
}

Config contains matchers and analysis scope information.

func ReadConfig

func ReadConfig() (*Config, error)

ReadConfig reads configuration from the config cache. The cache reads, parses, and validates the config file if necessary. If the config bytes were set using SetConfigBytes, they are used instead.

func (Config) IsExcluded added in v0.1.4

func (c Config) IsExcluded(path, recv, name string) bool

IsExcluded determines if a function matches one of the exclusion patterns.

func (Config) IsSanitizer

func (c Config) IsSanitizer(path, recv, name string) bool

IsSanitizer determines whether a function is a sanitizer.

func (Config) IsSink

func (c Config) IsSink(path, recv, name string) bool

IsSink determines whether a function is a sink.

func (Config) IsSourceField

func (c Config) IsSourceField(path, typeName, fieldName string) bool

IsSourceField determines whether a field is a source.

func (Config) IsSourceFieldTag added in v0.1.4

func (c Config) IsSourceFieldTag(tag string) bool

IsSourceFieldTag determines whether a field tag made up of a key and value is a Source.

func (Config) IsSourceType added in v0.1.5

func (c Config) IsSourceType(path, name string) bool

IsSourceType determines whether a type is a source.

Directories

Path Synopsis
Package regexp contains functionality for unmarshalling regular expressions from a config.
Package regexp contains functionality for unmarshalling regular expressions from a config.

Jump to

Keyboard shortcuts

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