config

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorExitCode   = 1
	SuccessExitCode = 0
)

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(url string, cfg *Config, l log.Logger) error

func SeverityNames added in v0.1.0

func SeverityNames() []string

Types

type Check

type Check struct {
	Type      checktypes.ChecktypeRef `yaml:"type"`
	Target    string                  `yaml:"target"`
	Options   map[string]interface{}  `yaml:"options,omitempty"`
	Timeout   *int                    `yaml:"timeout,omitempty"`
	AssetType string                  `yaml:"assetType,omitempty"`
	NewTarget string
	Id        string
	Checktype *checktypes.Checktype
}

type Conf

type Conf struct {
	DockerBin    string                 `yaml:"dockerBin"`
	GitBin       string                 `yaml:"gitBin"`
	PullPolicy   agentconfig.PullPolicy `yaml:"pullPolicy"`
	Vars         map[string]string      `yaml:"vars"`
	Repositories []string               `yaml:"repositories"`
	Registries   []Registry             `yaml:"registries"`
	LogLevel     logrus.Level           `yaml:"logLevel"`
	Concurrency  int                    `yaml:"concurrency"`
	IfName       string                 `yaml:"ifName"`
	Exclude      string                 `yaml:"exclude"`
	Include      string                 `yaml:"include"`
	IncludeR     *regexp.Regexp
	ExcludeR     *regexp.Regexp
	Policy       string
}

type Config

type Config struct {
	Conf       Conf                  `yaml:"conf"`
	Reporting  Reporting             `yaml:"reporting,omitempty"`
	Checks     []Check               `yaml:"checks"`
	Targets    []Target              `yaml:"targets"`
	CheckTypes checktypes.Checktypes `yaml:"checkTypes"`
	Policies   []Policy              `yaml:"policies"`
}

type Exclusion

type Exclusion struct {
	Target           string `yaml:"target"`
	Summary          string `yaml:"summary"`
	AffectedResource string `yaml:"affectedResource"`
	Fingerprint      string `yaml:"fingerprint"`
	Description      string `yaml:"description"`
}

type Policy added in v0.1.0

type Policy struct {
	Name       string        `yaml:"name"`
	CheckTypes []PolicyCheck `yaml:"checks"`
}

type PolicyCheck added in v0.1.0

type PolicyCheck struct {
	CheckType checktypes.ChecktypeRef `yaml:"type"`
	Options   map[string]interface{}  `yaml:"options,omitempty"`
}

type Registry

type Registry struct {
	Server   string `yaml:"server"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Reporting

type Reporting struct {
	Severity   Severity    `yaml:"severity"`
	Format     string      `yaml:"format"`
	OutputFile string      `yaml:"outputFile"`
	Exclusions []Exclusion `yaml:"exclusions"`
}

type Severity added in v0.1.0

type Severity int
const (
	SeverityCritical Severity = iota
	SeverityHigh
	SeverityMedium
	SeverityLow
	SeverityInfo
)

func FindSeverityByScore added in v0.1.0

func FindSeverityByScore(score float32) Severity

func Severities added in v0.1.0

func Severities() []Severity

func (Severity) Data added in v0.1.0

func (a Severity) Data() *SeverityData

func (*Severity) MarshalText added in v0.1.0

func (a *Severity) MarshalText() (text []byte, err error)

MarshalText returns string representation of a Severity instance.

func (Severity) String added in v0.1.0

func (a Severity) String() (string, error)

func (*Severity) UnmarshalText added in v0.1.0

func (a *Severity) UnmarshalText(text []byte) error

UnmarshalText creates a Severity from its string representation.

type SeverityData added in v0.1.0

type SeverityData struct {
	Severity  Severity
	Name      string
	Threshold float32
	Exit      int
	Color     int
}

type Target

type Target struct {
	Target    string                 `yaml:"target"`
	AssetType string                 `yaml:"assetType"`
	Options   map[string]interface{} `yaml:"options,omitempty"`
}

Jump to

Keyboard shortcuts

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