forked from aquasecurity/vuln-list-update
/
types.go
70 lines (59 loc) · 2.07 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package cvrf
type Cvrf struct {
Title string `xml:"DocumentTitle"`
Tracking DocumentTracking `xml:"DocumentTracking"`
Notes []DocumentNote `xml:"DocumentNotes>Note"`
ProductTree ProductTree `xml:"ProductTree"`
References []Reference `xml:"DocumentReferences>Reference"`
Vulnerabilities []Vulnerability `xml:"Vulnerability"`
}
type DocumentTracking struct {
ID string `xml:"Identification>ID"`
Status string `xml:"Status"`
Version string `xml:"Version"`
InitialReleaseDate string `xml:"InitialReleaseDate"`
CurrentReleaseDate string `xml:"CurrentReleaseDate"`
RevisionHistory []Revision `xml:"RevisionHistory>Revision"`
}
type DocumentNote struct {
Text string `xml:",chardata"`
Title string `xml:"Title,attr"`
Type string `xml:"Type,attr"`
}
type ProductTree struct {
Relationships []Relationship `xml:"Relationship"`
}
type Relationship struct {
ProductReference string `xml:"ProductReference,attr"`
RelatesToProductReference string `xml:"RelatesToProductReference,attr"`
RelationType string `xml:"RelationType,attr"`
}
type Revision struct {
Number string `xml:"Number"`
Date string `xml:"Date"`
Description string `xml:"Description"`
}
type Vulnerability struct {
CVE string `xml:"CVE"`
Description string `xml:"Notes>Note"`
Threats []Threat `xml:"Threats>Threat"`
References []Reference `xml:"References>Reference"`
ProductStatuses []Status `xml:"ProductStatuses>Status"`
CVSSScoreSets ScoreSet `xml:"CVSSScoreSets>ScoreSet" json:",omitempty"`
}
type Threat struct {
Type string `xml:"Type,attr"`
Severity string `xml:"Description"`
}
type Reference struct {
URL string `xml:"URL"`
Description string `xml:"Description"`
}
type Status struct {
Type string `xml:"Type,attr"`
ProductID []string `xml:"ProductID"`
}
type ScoreSet struct {
BaseScore string `xml:"BaseScore" json:",omitempty"`
Vector string `xml:"Vector" json:",omitempty"`
}