-
Notifications
You must be signed in to change notification settings - Fork 16
/
types.go
145 lines (135 loc) · 4.74 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package nvd
type NVDMeta struct {
LastModifiedDate string
Size string
ZipSize string
GzSize string
Sha256 string
}
// NVD CVE Feed JSON Schema:
// https://csrc.nist.gov/schema/nvd/feed/1.1/nvd_cve_feed_json_1.1.schema
type NVDFeed 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"`
CVEItems []CVEItem `json:"CVE_Items"`
}
type CVEItem struct {
CVE struct {
DataType string `json:"data_type"`
DataFormat string `json:"data_format"`
DataVersion string `json:"data_version"`
CVEDataMeta struct {
ID string `json:"ID"`
ASSIGNER string `json:"ASSIGNER"`
} `json:"CVE_data_meta"`
Problemtype struct {
ProblemtypeData []struct {
Description []struct {
Lang string `json:"lang"`
Value string `json:"value"`
} `json:"description"`
} `json:"problemtype_data"`
} `json:"problemtype"`
References struct {
ReferenceData []struct {
URL string `json:"url"`
Name string `json:"name"`
Refsource string `json:"refsource"`
Tags []string `json:"tags"`
} `json:"reference_data"`
} `json:"references"`
Description struct {
DescriptionData []struct {
Lang string `json:"lang"`
Value string `json:"value"`
} `json:"description_data"`
} `json:"description"`
} `json:"cve"`
Configurations struct {
CVEDataVersion string `json:"CVE_data_version"`
Nodes []struct {
Operator string `json:"operator"`
CPEMatch []struct {
Vulnerable bool `json:"vulnerable"`
CPE23URI string `json:"cpe23Uri"`
} `json:"cpe_match"`
} `json:"nodes"`
} `json:"configurations"`
Impact struct {
BaseMetricV3 struct {
CvssV3 struct {
Version string `json:"version"`
VectorString string `json:"vectorString"`
AttackVector string `json:"attackVector"`
AttackComplexity string `json:"attackComplexity"`
PrivilegesRequired string `json:"privilegesRequired"`
UserInteraction string `json:"userInteraction"`
Scope string `json:"scope"`
ConfidentialityImpact string `json:"confidentialityImpact"`
IntegrityImpact string `json:"integrityImpact"`
AvailabilityImpact string `json:"availabilityImpact"`
BaseScore float64 `json:"baseScore"`
BaseSeverity string `json:"baseSeverity"`
} `json:"cvssV3"`
ExploitabilityScore float64 `json:"exploitabilityScore"`
ImpactScore float64 `json:"impactScore"`
} `json:"baseMetricV3"`
BaseMetricV2 struct {
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"`
} `json:"cvssV2"`
Severity string `json:"severity"`
ExploitabilityScore float64 `json:"exploitabilityScore"`
ImpactScore float64 `json:"impactScore"`
AcInsufInfo bool `json:"acInsufInfo"`
ObtainAllPrivilege bool `json:"obtainAllPrivilege"`
ObtainUserPrivilege bool `json:"obtainUserPrivilege"`
ObtainOtherPrivilege bool `json:"obtainOtherPrivilege"`
UserInteractionRequired bool `json:"userInteractionRequired"`
} `json:"baseMetricV2"`
} `json:"impact"`
PublishedDate string `json:"publishedDate"`
LastModifiedDate string `json:"lastModifiedDate"`
Reserved bool `json:"reserved,omitempty"`
}
type Vendor struct {
Name string
Products []Product
}
type Product struct {
Name string
URIShort string
}
// WeaknessCatalog has CWE items
type WeaknessCatalog struct {
Weaknesses []Weakness `xml:"Weaknesses>Weakness"`
Categories []WeaknessCategory `xml:"Categories>Category"`
}
type Weakness struct {
ID string `xml:"ID,attr"`
Name string `xml:"Name,attr"`
Description string `xml:"Description"`
// ExtendedDescription string `xml:"Extended_Description"`
}
type WeaknessCategory struct {
ID string `xml:"ID,attr"`
Name string `xml:"Name,attr"`
Description string `xml:"Summary"`
}
type CPEMatchFeed struct {
CPEMatches []CPEMatch `json:"matches"`
}
type CPEMatch struct {
CPE23URI string `json:"cpe23Uri"`
}