cve

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeTypeNone        = "none"
	NodeTypeBlockquote  = "blockquote"
	NodeTypeBulletList  = "bulletList"
	NodeTypeCodeBlock   = "codeBlock"
	NodeTypeHeading     = "heading"
	NodeTypeMediaGroup  = "mediaGroup"
	NodeTypeMediaSingle = "mediaSingle"
	NodeTypeOrderedList = "orderedList"
	NodeTypePanel       = "panel"
	NodeTypeParagraph   = "paragraph"
	NodeTypeRule        = "rule"
	NodeTypeTable       = "table"
	NodeTypeListItem    = "listItem"
	NodeTypeMedia       = "media"
	NodeTypeTableCell   = "table_cell"
	NodeTypeTableHeader = "table_header"
	NodeTypeTableRow    = "table_row"
	NodeTypeEmoji       = "emoji"
	NodeTypeHardBreak   = "hardBreak"
	NodeTypeInlineCard  = "inlineCard"
	NodeTypeMention     = "mention"
	NodeTypeText        = "text"
)
View Source
const (
	LayoutWrapLeft   = "wrap-left"
	LayoutCenter     = "center"
	LayoutWrapRight  = "wrap-right"
	LayoutWide       = "wide"
	LayoutFullWidth  = "full-width"
	LayoutAlignStart = "align-start"
	LayoutAlignEnd   = "align-end"
)

Enum values for Layout in Attributes struct

View Source
const (
	// Kubernetes is a container orchestration system for Docker containers
	ExcludeNonCoreComponentsCves = "CVE-2019-11255"
)

Variables

This section is empty.

Functions

func AmendCveDoc

func AmendCveDoc(doc string) string

func Render

func Render(w io.Writer, source []byte) error

func ValidateCveData

func ValidateCveData(cves []*Vulnerability) error

Types

type AdditionalFields

type AdditionalFields struct {
	Cvss      string
	Score     string
	Component string
}

type Affected

type Affected struct {
	Ranges []*Range `json:"ranges,omitempty"`
}

type Attributes

type Attributes struct {
	Width    float32 `json:"width,omitempty"`
	Layout   Layout  `json:"layout,omitempty"`
	Level    int     `json:"level,omitempty"`
	Language string  `json:"language,omitempty"`
}

type Containers

type Containers struct {
	Cna struct {
		Affected []struct {
			Product  string
			Vendor   string
			Versions []*MitreVersion
		}
		Descriptions []struct {
			Value string
		}
	}
}

type Content

type Content struct {
	Description      string     `json:"description,omitempty"`
	ComponentName    string     `json:"component_name,omitempty"`
	AffectedVersions []*Version `json:"affected_version,omitempty"`
	FixedVersions    []*Version `json:"fixed_version,omitempty"`
	Cvss             string     `json:"cvss,omitempty"`
}

type CveMetadata

type CveMetadata struct {
	CveId string
}

type Cvssv3

type Cvssv3 struct {
	Vector string
	Score  float64
}

type Event

type Event struct {
	Introduced   string `json:"introduced,omitempty"`
	Fixed        string `json:"fixed,omitempty"`
	LastAffected string `json:"last_affected,omitempty"`
	Limit        string `json:"limit,omitempty"`
}

type JSONRenderer

type JSONRenderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer() *JSONRenderer

func (*JSONRenderer) AddOptions

func (*JSONRenderer) AddOptions(...renderer.Option)

func (*JSONRenderer) Render

func (r *JSONRenderer) Render(w io.Writer, source []byte, n ast.Node) error

Render implements goldmark.Renderer interface.

type K8sVulnDB

type K8sVulnDB struct {
	Cves []*Vulnerability
}

func Collect

func Collect() (*K8sVulnDB, error)

func ParseVulnDBData

func ParseVulnDBData(vulnDB []byte) (*K8sVulnDB, error)

type Layout

type Layout string

type Mark

type Mark string

Mark represents a text formatting directive

const (
	MarkCode      Mark = "code"
	MarkEm        Mark = "em"
	MarkLink      Mark = "link"
	MarkStrike    Mark = "strike"
	MarkStrong    Mark = "strong"
	MarkSubsup    Mark = "subsup"
	MarkTextcolor Mark = "textColor"
	MarkUnderline Mark = "underline"
)

Enum values for Mark text formatting

type MarkAttributes

type MarkAttributes struct {
	Href  string `json:"href,omitempty"`
	Title string `json:"title,omitempty"`
}

type MarkStruct

type MarkStruct struct {
	Type       Mark            `json:"type,omitempty"`
	Attributes *MarkAttributes `json:"attrs,omitempty"`
}

type MitreCVE

type MitreCVE struct {
	CveMetadata CveMetadata
	Containers  Containers
}

type MitreVersion

type MitreVersion struct {
	Status          string
	Version         string
	LessThanOrEqual string
	LessThan        string
	VersionType     string
}

type Node

type Node struct {
	Type       NodeType     `json:"type"`
	Version    int          `json:"version,omitempty"`
	Attributes *Attributes  `json:"attrs,omitempty"`
	Content    []*Node      `json:"content,omitempty"`
	Marks      []MarkStruct `json:"marks,omitempty"`
	Text       string       `json:"text,omitempty"`
}

func (*Node) AddContent

func (n *Node) AddContent(c *Node)

type NodeType

type NodeType string

type Range

type Range struct {
	Events    []*Event `json:"events,omitempty"`
	RangeType string   `json:"type,omitempty"`
}

type Version

type Version struct {
	Introduced   string `json:"introduced,omitempty"`
	Fixed        string `json:"fixed,omitempty"`
	LastAffected string `json:"last_affected,omitempty"`
	Limit        string `json:"limit,omitempty"`
	FixedIndex   int    `json:"-"`
}

type Vulnerability

type Vulnerability struct {
	ID               string      `json:"id,omitempty"`
	CreatedAt        string      `json:"created_at,omitempty"`
	Summary          string      `json:"summary,omitempty"`
	Component        string      `json:"component,omitempty"`
	Description      string      `json:"details,omitempty"`
	AffectedVersions []*Version  `json:"-"`
	Affected         []*Affected `json:"affected,omitempty"`
	FixedVersions    []*Version  `json:"-"`
	Urls             []string    `json:"references,omitempty"`
	CvssV3           Cvssv3      `json:"cvssv3,omitempty"`
	Severity         string      `json:"severity,omitempty"`
	Major            bool        `json:"-"`
}

func LoadCveFromMitre

func LoadCveFromMitre(externalURL string, cveID string) (*Vulnerability, error)

func ParseVulnItem

func ParseVulnItem(item interface{}, mid string) (*Vulnerability, error)

Jump to

Keyboard shortcuts

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