Documentation
¶
Overview ¶
Description: This file contains the NVD struct and all the functions that are used to parse the NVD data
Index ¶
- func CleanName(value string) string
- func ConvertComposerAuthor(authors []Author) []string
- func ConvertNpmVersion(npm Npm) []knowledge.Version
- func GetLatestVersion(npmVersions map[string]NpmVersion) string
- type Author
- type CVE
- type Composer
- type ComposerPackage
- type ComposerSource
- type Configuration
- type CpeMatch
- type CriteriaDict
- type Description
- type Dist
- type LicenseMaven
- type LicenseNpm
- type LinkLicensePackage
- type Maintainers
- type Maven
- type NVD
- type NVDAffected
- type Node
- type Notification
- type NotificationContentType
- type NotificationType
- type Npm
- type NpmVersion
- type Package
- type ReferenceNVD
- type Repository
- type Revision
- type SCM
- type Signature
- type Source
- type Version
- type Weakness
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertComposerAuthor ¶
func ConvertNpmVersion ¶
func GetLatestVersion ¶
func GetLatestVersion(npmVersions map[string]NpmVersion) string
Types ¶
type CVE ¶
type CVE struct {
Key string `json:"_key,omitempty"`
Id string `json:"id"`
SourceIdentifier string `json:"sourceIdentifier"`
Published string `json:"published"`
LastModified string `json:"lastModified"`
VulnStatus string `json:"vulnStatus"`
Descriptions []Description `json:"descriptions"`
Metrics any `json:"metrics"`
// Weaknesses []Weakness `json:"weaknesses"`
Weaknesses []any `json:"weaknesses"`
Configurations []Configuration `json:"configurations,omitempty"`
Affected []NVDAffected `json:"affected"`
References []ReferenceNVD `json:"references"`
AffectedFlattened []CpeMatch `json:"affectedFlattened"`
}
type Composer ¶
type Composer struct {
Minified string `json:"minified"`
Packages map[string][]ComposerPackage `json:"packages"`
}
type ComposerPackage ¶
type ComposerPackage struct {
Name string `json:"name"`
Description string `json:"description"`
Homepage string `json:"homepage"`
Version string `json:"version"`
VersionNormalized string `json:"version_normalized"`
Authors []Author `json:"authors"`
Time string `json:"time"`
Keywords []string `json:"keywords"`
Source ComposerSource `json:"source"`
Dist ComposerSource `json:"dist"`
License []string `json:"license"`
Require map[string]string `json:"require"`
RequireDev map[string]string `json:"require-dev"`
}
type ComposerSource ¶
type Configuration ¶
type Configuration struct {
Nodes []Node `json:"nodes"`
}
type CpeMatch ¶
type CpeMatch struct {
Vulnerable bool `json:"vulnerable"`
Criteria string `json:"criteria"`
MatchCriteriaId string `json:"matchCriteriaId"`
VersionEndIncluding string `json:"versionEndIncluding"`
VersionEndExcluding string `json:"versionEndExcluding"`
VersionStartIncluding string `json:"versionStartIncluding"`
VersionStartExcluding string `json:"versionStartExcluding"`
CriteriaDict CriteriaDict `json:"criteriaDict"`
}
type CriteriaDict ¶
type CriteriaDict struct {
Part string `json:"part"`
Vendor string `json:"vendor"`
Product string `json:"product"`
Version string `json:"version"`
Update string `json:"update"`
Edition string `json:"edition"`
Language string `json:"language"`
Sw_edition string `json:"sw_edition"`
Target_sw string `json:"target_sw"`
Target_hw string `json:"target_hw"`
Other string `json:"other"`
}
type Description ¶
type LicenseMaven ¶
type LicenseNpm ¶
type LinkLicensePackage ¶
type Maintainers ¶
type Maven ¶
type Maven struct {
Name string `xml:"name"`
Description string `xml:"description"`
Url string `xml:"url"`
Version string `xml:"version"`
Packaging string `xml:"packaging"`
SCM SCM `xml:"scm"`
// Versions map[string]NpmVersion `json:"versions"`
// License any `json:"license"`
Licenses []LicenseMaven `json:"licenses"`
}
type NVD ¶
NVD struct This struct contains all the fields that are needed to parse the NVD data The fields are based on the NVD JSON schema https://nvd.nist.gov/vuln/data-feeds#JSON_FEED
type NVDAffected ¶
type Notification ¶
type Notification struct {
Key string `json:"_key"`
Title string `json:"title"`
Description string `json:"description"`
Content map[string]string `json:"content"`
Type NotificationType `json:"type"`
ContentType NotificationContentType `json:"content_type"`
}
type NotificationContentType ¶
type NotificationContentType string
const (
NewVersion NotificationContentType = "new_version"
)
type NotificationType ¶
type NotificationType string
const ( Info NotificationType = "info" Warning NotificationType = "warning" Error NotificationType = "error" )
type Npm ¶
type Npm struct {
Name string `json:"name"`
Description string `json:"description"`
Revision string `json:"_rev"`
Homepage string `json:"homepage"`
Versions map[string]NpmVersion `json:"versions"`
Time map[string]time.Time `json:"time"`
Repository any `json:"repository"`
Keywords any `json:"keywords"`
DistTags map[string]string `json:"dist-tags"`
Maintainers []Maintainers `json:"maintainers"`
Author any `json:"author"`
License any `json:"license"`
Licenses []LicenseNpm `json:"licenses"`
}
type NpmVersion ¶
type NpmVersion struct {
Version string `json:"version"`
Author interface{} `json:"author"`
Engines any `json:"engines"`
Dist Dist `json:"dist"`
License any `json:"license"`
Licenses any `json:"licenses"`
Dependencies map[string]string `json:"dependencies"`
DevDependencies map[string]string `json:"devDependencies"`
PeerDependencies any `json:"peerDependencies"`
PeerDependenciesMeta any `json:"peerDependenciesMeta"`
BundleDependencies any `json:"bundleDependencies"`
BundledDependencies any `json:"bundledDependencies"`
OptionalDependencies any `json:"optionalDependencies"`
Deprecated interface{} `json:"deprecated"`
}
type Package ¶
type Package struct {
Key string `json:"_key"`
Revision string `json:"Revision"`
Name string `json:"Name"`
Description string `json:"Description"`
Homepage string `json:"Homepage"`
Version string `json:"Version"`
Versions []Version `json:"-"`
Time string `json:"Time"`
Keywords []string `json:"Keywords"`
Source Source `json:"Source"`
Licenses []string `json:"Licenses"`
Extra any `json:"Extra"`
}
type ReferenceNVD ¶
type Repository ¶
type Version ¶
type Version struct {
Key string `json:"_key"`
Version string `json:"Version"`
Time string `json:"Time"`
Dependencies map[string]string `json:"Dependencies"`
DevDependencies map[string]string `json:"DevDependencies"`
Licenses []string `json:"Licenses"`
Extra any `json:"Extra"`
}
func ConvertComposerVersion ¶
func ConvertComposerVersion(composerPackage []ComposerPackage, key string) []Version
type Weakness ¶
type Weakness struct {
Source string `json:"source"`
Type string `json:"type"`
Descriptions []Description `json:"descriptions"`
}
Click to show internal directories.
Click to hide internal directories.