types

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled        bool           `json:"enabled" yaml:"enabled" mapstructure:"enabled"`
	ScannersList   []string       `yaml:"scanners_list" mapstructure:"scanners_list"`
	Inputs         []Input        `yaml:"inputs" mapstructure:"inputs"`
	ScannersConfig ScannersConfig `yaml:"scanners_config" mapstructure:"scanners_config"`
}

type Input

type Input struct {
	Input     string `yaml:"input" mapstructure:"input"`
	InputType string `yaml:"input_type" mapstructure:"input_type"`
}

type LynisConfig

type LynisConfig struct {
	InstallPath string `yaml:"install_path" mapstructure:"install_path"`
}

type Misconfiguration

type Misconfiguration struct {
	// Path which was scanned to find this Misconfiguration, might be "/",
	// "partitionX/" or "/home/Dockerfile"
	//
	// This might just be the scanner input if the tool scans it as a whole
	// or it can be a specific file if the scanner performs some
	// sub-discovery like trivy.
	ScannedPath string `json:"ScannedPath"`

	// Information about the test that was run to detect this specific
	// misconfiguration, this is specific to each Scanner.
	TestCategory    string `json:"TestCategory"`
	TestID          string `json:"TestID"`
	TestDescription string `json:"TestDescription"`

	// Information about this specific misconfiguration hit
	Severity    Severity `json:"Severity"`
	Message     string   `json:"Message"`
	Remediation string   `json:"Remediation"`
}

type ScannerResult

type ScannerResult struct {
	ScannerName       string
	Misconfigurations []Misconfiguration
	Error             error
}

func (ScannerResult) GetError

func (sr ScannerResult) GetError() error

type ScannersConfig

type ScannersConfig struct {
	Lynis LynisConfig `yaml:"lynis" mapstructure:"lynis"`
}

Add scanner specific configurations here, where the key is the scanner name, and the value is the scanner specific configuration.

For example if the scanner name is "lynis":

Lynis LynisConfig `yaml:"lynis" mapstructure:"lynis"`

func (ScannersConfig) IsConfig

func (ScannersConfig) IsConfig()

type Severity

type Severity string
const (
	HighSeverity   Severity = "HighSeverity"
	MediumSeverity Severity = "MediumSeverity"
	LowSeverity    Severity = "LowSeverity"
)

Jump to

Keyboard shortcuts

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