Documentation
¶
Overview ¶
Package schema implements parsing the vendor's data.
Index ¶
- func ProvidersConvertStrTime(layout, strTime string) (*time.Time, error)
- func ProvidersNewItem(item *ProvidersItem) (*nvd.NVDCVEFeedJSON10DefCVEItem, error)
- type CVSS
- type CVSS2
- type CVSS3
- type Classification
- type DescParameter
- type Description
- type Information
- type Item
- type ProvidersCVSS
- type ProvidersConfiguration
- type ProvidersItem
- type ProvidersMatch
- type ProvidersNode
- type ProvidersReferences
- type Reference
- type Risk
- type Target
- type TargetParameter
- type VersionAffected
- type Weakness
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProvidersConvertStrTime ¶
ProvidersConvertStrTime takes a time layout and a string representing time in that layout and converts it to a Time type. If the string is empty nil is returned.
func ProvidersNewItem ¶
func ProvidersNewItem(item *ProvidersItem) (*nvd.NVDCVEFeedJSON10DefCVEItem, error)
ProvidersNewItem creates a vendor item.
Types ¶
type CVSS2 ¶
type CVSS2 struct {
Vector string `json:"vector"`
BaseScore string `json:"base_score"`
ImpactScore string `json:"impact_score"`
ExploitScore string `json:"exploit_score"`
AccessVector string `json:"access_vector"`
AccessComplexity string `json:"access_complexity"`
Authentication string `json:"authentication"`
ConfidentialityImpact string `json:"confidentiality_impack"`
IntegrityImpact string `json:"integrety_impact"`
AvailabilityImpact string `json:"availability_impact"`
}
CVSS2 information.
type CVSS3 ¶
type CVSS3 struct {
Vector string `json:"vector"`
BaseScore string `json:"base_score"`
ImpactScore string `json:"impact_score"`
ExploitScore string `json:"exploit_score"`
AccessVector string `json:"access_vector"`
AccessComplexity string `json:"access_complexity"`
PrivilegesRequired string `json:"privileges_required"`
UserInteraction string `json:"user_interaction"`
Score string `json:"score"`
ConfidentialityImpact string `json:"confidentiality_impack"`
IntegrityImpact string `json:"integrety_impact"`
AvailabilityImpact string `json:"availability_impact"`
}
CVSS3 information.
type Classification ¶
type Classification struct {
Targets []*Target `json:"targets"`
Weaknesses []*Weakness `json:"weaknesses"`
}
Classification has CWE and CVSS data.
type DescParameter ¶
type DescParameter struct {
Published string `json:"published"`
Modified string `json:"modified"`
Summary string `json:"summary"`
}
DescParameter holds the CVE metadata.
type Description ¶
type Description struct {
ID string `json:"id"`
Parameters *DescParameter `json:"parameters"`
}
Description has the CVE ID and metadata.
type Information ¶
type Information struct {
Descriptions []*Description `json:"description"`
References []*Reference `json:"references"`
}
Information holds CVE data.
type Item ¶
type Item struct {
Information *Information `json:"information"`
Classification *Classification `json:"classification"`
Risk *Risk `json:"risk"`
}
Item defines the vendor's vulnerability schema.
type ProvidersCVSS ¶
ProvidersCVSS is used to store CVSS2 and CVSS3 data.
type ProvidersConfiguration ¶
type ProvidersConfiguration struct {
Nodes []*ProvidersNode
}
ProvidersConfiguration captures what specific software versions are vulnerable.
func ProvidersNewConfiguration ¶
func ProvidersNewConfiguration() *ProvidersConfiguration
ProvidersNewConfiguration creates a ProvidersConfiguration.
func (*ProvidersConfiguration) NewNode ¶
func (c *ProvidersConfiguration) NewNode() *ProvidersNode
NewNode creates a Node in the ProvidersConfiguration
type ProvidersItem ¶
type ProvidersItem struct {
Vendor string
ID string
Description string
CWEs []string
References *ProvidersReferences
Configuration *ProvidersConfiguration
CVSS2 *ProvidersCVSS
CVSS3 *ProvidersCVSS
LastModifiedDate *time.Time
PublishedDate *time.Time
}
ProvidersItem captures the top-level CVE information for a vendor.
type ProvidersMatch ¶
type ProvidersMatch struct {
CPE22URI string
CPE23URI string
VersionStartExcluding string
VersionStartIncluding string
VersionEndExcluding string
VersionEndIncluding string
Vulnerable bool
}
ProvidersMatch represents software versions that match a CPE.
func ProvidersNewMatch ¶
func ProvidersNewMatch(cpe22uri, cpe23uri string, vulnerable bool) *ProvidersMatch
ProvidersNewMatch creates a ProvidersMatch.
func (*ProvidersMatch) AddVersionEnd ¶
func (m *ProvidersMatch) AddVersionEnd(version string, excluding bool)
AddVersionEnd adds the ending version to a Match, along with whether that version is included or excluded from the Match.
func (*ProvidersMatch) AddVersionStart ¶
func (m *ProvidersMatch) AddVersionStart(version string, excluding bool)
AddVersionStart adds the starting version to a Match, along with whether that version is included or excluded from the Match.
type ProvidersNode ¶
type ProvidersNode struct {
// contains filtered or unexported fields
}
ProvidersNode holds a set of matches, any positive match being able to configure a CVE. If conditional matches are present as well, then at least one conditional match should also be positive to configure a CVE.
func (*ProvidersNode) AddConditionalMatch ¶
func (node *ProvidersNode) AddConditionalMatch(m *ProvidersMatch)
AddConditionalMatch adds a ProvidersMatch to a ProvidersNode.
func (*ProvidersNode) AddMatch ¶
func (node *ProvidersNode) AddMatch(m *ProvidersMatch)
AddMatch adds a ProvidersMatch to a ProvidersNode.
type ProvidersReferences ¶
type ProvidersReferences struct {
// contains filtered or unexported fields
}
ProvidersReferences hold data related to the thread.
func ProvidersNewReferences ¶
func ProvidersNewReferences() *ProvidersReferences
ProvidersNewReferences creates a ProvidersReferences.
func (*ProvidersReferences) Add ¶
func (r *ProvidersReferences) Add(name, url string)
Add adds a new reference to the references.
type Target ¶
type Target struct {
ID int32 `json:"id"`
Parameters []*TargetParameter `json:"parameters"`
}
Target holds NVD Configuration information.
type TargetParameter ¶
type TargetParameter struct {
Title string `json:"title"`
CPE22 string `json:"cpe2.2"`
CPE23 string `json:"cpe2.3"`
VersionAffected VersionAffected `json:"version_affected"`
RunningOn []*TargetParameter `json:"running_on"`
}
TargetParameter holds Configuration Match data.
type VersionAffected ¶
VersionAffected has the version data, as well as whether they are inclusive or exclusive.