config

package
v0.0.1-beta1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRepo

func AddRepo(cfg *Config, uri, alias string, l log.Logger) error

func ReadConfig

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

Types

type Check

type Check struct {
	Type      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 *Checktype
}

func GetCheckById

func GetCheckById(cfg *Config, id string) *Check

type Checktype

type Checktype struct {
	Name         string                 `json:"name"`
	Description  string                 `json:"description"`
	Timeout      int                    `json:"timeout,omitempty"`
	Image        string                 `json:"image"`
	Options      map[string]interface{} `json:"options,omitempty"`
	RequiredVars []string               `json:"required_vars"`
	QueueName    string                 `json:"queue_name,omitempty"`
	Assets       []string               `json:"assets"`
}

Definition borrowed from vulcan-checks-bsys.

func GetManifestFromFile

func GetManifestFromFile(path string) ([]Checktype, error)

func GetManifestFromUrl

func GetManifestFromUrl(url string) ([]Checktype, error)

type ChecktypeRef

type ChecktypeRef string

ChektypeRef represents a checktype with an optional prefix denoting the repository (i.e. default/vulcan-zap vulcan-zap ).

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 map[string]string      `yaml:"repositories"`
	Repository   string                 `yaml:"repository"`
	Registries   []Registry             `yaml:"registries"`
	LogLevel     string                 `yaml:"logLevel"`
	Concurrency  int                    `yaml:"concurrency"`
	IfName       string                 `yaml:"ifName"`
	Exclude      string                 `yaml:"exclude"`
	Include      string                 `yaml:"include"`
	IncludeR     *regexp.Regexp
	ExcludeR     *regexp.Regexp
}

type Config

type Config struct {
	Conf       Conf                       `yaml:"conf"`
	Reporting  Reporting                  `yaml:"reporting,omitempty"`
	Checks     []Check                    `yaml:"checks"`
	Targets    []Target                   `yaml:"targets"`
	CheckTypes map[ChecktypeRef]Checktype `yaml:"checkTypes"`
}

type Exclusion

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

type Manifest

type Manifest struct {
	CheckTypes []Checktype
}

type Registry

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

type Reporting

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

type Target

type Target struct {
	Target    string
	AssetType string
	Options   map[string]interface{}
}

Jump to

Keyboard shortcuts

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