cvemodels

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMetricV2

type BaseMetricV2 struct {
	CvssV2                  CvssV2  `json:"cvssV2"`
	Severity                string  `json:"severity"`
	ExploitabilityScore     float64 `json:"exploitabilityScore"`
	ImpactScore             float64 `json:"impactScore"`
	ObtainAllPrivilege      bool    `json:"obtainAllPrivilege"`
	ObtainUserPrivilege     bool    `json:"obtainUserPrivilege"`
	ObtainOtherPrivilege    bool    `json:"obtainOtherPrivilege"`
	UserInteractionRequired bool    `json:"userInteractionRequired"`
}

type CVEDataMeta

type CVEDataMeta struct {
	ID       string `json:"ID"`
	ASSIGNER string `json:"ASSIGNER"`
}

type CVERecord

type CVERecord struct {
	Cve              Cve            `json:"cve"`
	Configurations   Configurations `json:"configurations"`
	Impact           Impact         `json:"impact"`
	PublishedDate    string         `json:"publishedDate"`
	LastModifiedDate string         `json:"lastModifiedDate"`
}

func (*CVERecord) CPEConfigurationsToJSONB

func (c *CVERecord) CPEConfigurationsToJSONB() (postgres.Jsonb, error)

func (*CVERecord) CVEId

func (c *CVERecord) CVEId() string

func (*CVERecord) CWE

func (c *CVERecord) CWE() string

func (*CVERecord) DescriptionMain

func (c *CVERecord) DescriptionMain() string

func (*CVERecord) DescriptionsToJSONB

func (c *CVERecord) DescriptionsToJSONB() (postgres.Jsonb, error)

func (*CVERecord) GetLastModifiedDate

func (c *CVERecord) GetLastModifiedDate() time.Time

func (*CVERecord) GetPublishedDate

func (c *CVERecord) GetPublishedDate() time.Time

func (*CVERecord) ProblemTypeToJSONB

func (c *CVERecord) ProblemTypeToJSONB() (postgres.Jsonb, error)

func (*CVERecord) ReferencesToJSONB

func (c *CVERecord) ReferencesToJSONB() (postgres.Jsonb, error)

type CVEYearFile

type CVEYearFile struct {
	CVEDataType         string      `json:"CVE_data_type"`
	CVEDataFormat       string      `json:"CVE_data_format"`
	CVEDataVersion      string      `json:"CVE_data_version"`
	CVEDataNumberOfCVEs string      `json:"CVE_data_numberOfCVEs"`
	CVEDataTimestamp    string      `json:"CVE_data_timestamp"`
	CVERecords          []CVERecord `json:"CVE_Items"`
}

type Configurations

type Configurations struct {
	CVEDataVersion string  `json:"CVE_data_version"`
	Nodes          []Nodes `json:"nodes"`
}

func (*Configurations) ShowShorter

func (c *Configurations) ShowShorter() string

func (*Configurations) ToHumanReadableString

func (c *Configurations) ToHumanReadableString() string

func (*Configurations) ValidateCPE

func (c *Configurations) ValidateCPE(cpes ...string) (bool, []string, error)

type CpeMatch

type CpeMatch struct {
	Vulnerable bool   `json:"vulnerable"`
	Cpe23URI   string `json:"cpe23Uri"`
}

type CpeStruct

type CpeStruct struct {
	// 7 for specific fields
	Part, Vendor, Product, Version, Update, Edition, Language string

	// for default
	Ext1, Ext2, Ext3, Ext4 string
}

func ParseCPEStringToStruct

func ParseCPEStringToStruct(cpe string) (*CpeStruct, error)

func (*CpeStruct) CPE23String

func (c *CpeStruct) CPE23String() string

func (*CpeStruct) ProductCPE23

func (c *CpeStruct) ProductCPE23() string

func (*CpeStruct) Regexp

func (c *CpeStruct) Regexp() (*regexp.Regexp, error)

func (*CpeStruct) ToLikeSearch

func (c *CpeStruct) ToLikeSearch() string

type Cve

type Cve struct {
	DataType        string          `json:"data_type"`
	DataFormat      string          `json:"data_format"`
	DataVersion     string          `json:"data_version"`
	CVEDataMeta     CVEDataMeta     `json:"CVE_data_meta"`
	Problemtype     Problemtype     `json:"problemtype"`
	References      References      `json:"references"`
	DescriptionInfo DescriptionInfo `json:"description"`
}

type CvssV2

type CvssV2 struct {
	Version               string  `json:"version"`
	VectorString          string  `json:"vectorString"`
	AccessVector          string  `json:"accessVector"`
	AccessComplexity      string  `json:"accessComplexity"`
	Authentication        string  `json:"authentication"`
	ConfidentialityImpact string  `json:"confidentialityImpact"`
	IntegrityImpact       string  `json:"integrityImpact"`
	AvailabilityImpact    string  `json:"availabilityImpact"`
	BaseScore             float64 `json:"baseScore"`
}

type Description

type Description struct {
	Lang  string `json:"lang"`
	Value string `json:"value"`
}

type DescriptionData

type DescriptionData struct {
	Lang  string `json:"lang"`
	Value string `json:"value"`
}

type DescriptionInfo

type DescriptionInfo struct {
	DescriptionData []DescriptionData `json:"description_data"`
}

type Impact

type Impact struct {
	BaseMetricV2 BaseMetricV2 `json:"baseMetricV2"`
}

type Nodes

type Nodes struct {
	Operator string     `json:"operator"`
	CpeMatch []CpeMatch `json:"cpe_match"`
	Children []Nodes    `json:"children"`
}

func (*Nodes) ToHumanReadableString

func (n *Nodes) ToHumanReadableString() string

func (*Nodes) Validate

func (n *Nodes) Validate(h func(t string) bool) bool

func (*Nodes) ValidateCPEs

func (n *Nodes) ValidateCPEs(cpes ...string) (bool, []string)

func (*Nodes) ValidateRegexp

func (n *Nodes) ValidateRegexp(r *regexp.Regexp) bool

func (*Nodes) ValidateString

func (n *Nodes) ValidateString(s string) bool

type Problemtype

type Problemtype struct {
	ProblemtypeData []ProblemtypeData `json:"problemtype_data"`
}

type ProblemtypeData

type ProblemtypeData struct {
	Description []Description `json:"description"`
}

type ReferenceData

type ReferenceData struct {
	URL       string        `json:"url"`
	Name      string        `json:"name"`
	Refsource string        `json:"refsource"`
	Tags      []interface{} `json:"tags"`
}

type References

type References struct {
	ReferenceData []ReferenceData `json:"reference_data"`
}

type VersionCharNode

type VersionCharNode struct {
	VersionTreeNodeIf
	// contains filtered or unexported fields
}

func (*VersionCharNode) AddChild

func (v *VersionCharNode) AddChild(a *VersionCharNode)

func (*VersionCharNode) GetChild

func (v *VersionCharNode) GetChild(a byte) (*VersionCharNode, error)

func (*VersionCharNode) GetChildren

func (v *VersionCharNode) GetChildren() []*VersionCharNode

func (*VersionCharNode) GetParent

func (v *VersionCharNode) GetParent() VersionTreeNodeIf

func (*VersionCharNode) HaveLeaf

func (v *VersionCharNode) HaveLeaf() bool

func (*VersionCharNode) IsLeaf

func (v *VersionCharNode) IsLeaf() bool

func (*VersionCharNode) IsRoot

func (v *VersionCharNode) IsRoot() bool

func (*VersionCharNode) NextString

func (v *VersionCharNode) NextString() []string

func (*VersionCharNode) PathString

func (v *VersionCharNode) PathString() string

func (*VersionCharNode) Versions

func (v *VersionCharNode) Versions() []string

type VersionTree

type VersionTree struct {
	VersionTreeNodeIf
	// contains filtered or unexported fields
}

func NewVersionTree

func NewVersionTree(prefix string, version ...string) *VersionTree

func (*VersionTree) AddChild

func (v *VersionTree) AddChild(a *VersionCharNode)

func (*VersionTree) GetChild

func (v *VersionTree) GetChild(a byte) (*VersionCharNode, error)

func (*VersionTree) GetChildren

func (v *VersionTree) GetChildren() []*VersionCharNode

func (*VersionTree) GetParent

func (v *VersionTree) GetParent() VersionTreeNodeIf

func (*VersionTree) IsRoot

func (v *VersionTree) IsRoot() bool

func (*VersionTree) Strings

func (v *VersionTree) Strings() []string

type VersionTreeNodeIf

type VersionTreeNodeIf interface {
	GetChild(a byte) (*VersionCharNode, error)
	AddChild(a *VersionCharNode)
	GetChildren() []*VersionCharNode
	GetParent() VersionTreeNodeIf
	IsRoot() bool
}

Jump to

Keyboard shortcuts

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