internal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RuleSet = map[string]Rule{
	"E001": {
		Code:        "E001",
		Name:        "check-reference-url-protocol",
		Description: "Reference URLs use allowed protocols (ftp(s)/http(s))",
		CheckFunc:   rules.CheckRefProtocol,
	},
	"E002": {
		Code:        "E002",
		Name:        "check-duplicate-reference-url",
		Description: "CVE record does not contain duplicate reference URLs",
		CheckFunc:   rules.DuplicateRefs,
	},
	"E003": {
		Code:        "E003",
		Name:        "check-description-length",
		Description: "One en-US description of at least 10 characters is present in the CNA container",
		CheckFunc:   rules.CheckLength,
	},
	"E004": {
		Code:        "E004",
		Name:        "check-leading-trailing-space",
		Description: "CNA container descriptions do not have leading or trailing whitespace",
		CheckFunc:   rules.CheckLeadingTrailingSpace,
	},
	"E005": {
		Code:        "E005",
		Name:        "check-cvss3-base-severity",
		Description: "CVSSv3 base severity matches the base score",
		CheckFunc:   rules.CheckCvssV3BaseSeverity,
	},
	"E006": {
		Code:        "E006",
		Name:        "check-affected-product-present",
		Description: "One affected/unknown product is present in CNA container",
		CheckFunc:   rules.CheckAffectedProduct,
	},
	"E007": {
		Code:        "E007",
		Name:        "check-invalid-version-string",
		Description: "Version field contains invalid characters",
		CheckFunc:   rules.CheckInvalidVersion,
	},
}

Functions

This section is empty.

Types

type LintResult

type LintResult struct {
	File  string
	CveId string
	Cna   string
	Error rules.ValidationError
	Rule
}

type Linter

type Linter struct {
	Timestamp     time.Time
	FileInput     *[]string
	FilesChecked  int
	Results       []LintResult
	GenericErrors []string
}

func (*Linter) Print

func (l *Linter) Print(format string)

func (*Linter) Run

func (l *Linter) Run(selectedRules *[]Rule, cna string)

type Rule

type Rule struct {
	Code        string
	Name        string
	Description string
	CheckFunc   func(*string) []rules.ValidationError
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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