/
types.go
300 lines (257 loc) · 10.6 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
package oval
import (
"encoding/xml"
)
type OvalDefinitions struct {
XMLName xml.Name `xml:"oval_definitions"`
Generator Generator `xml:"generator"`
Definitions Definitions `xml:"definitions"`
Tests Tests `xml:"tests" json:",omitempty"`
Objects Objects `xml:"objects" json:",omitempty"`
States States `xml:"states" json:",omitempty"`
}
type Generator struct {
ProductName string `xml:"product_name"`
ProductVersion string `xml:"product_version"`
SchemaVersion string `xml:"schema_version"`
ContentVersion string `xml:"content_version"`
Timestamp string `xml:"timestamp"`
}
type Definitions struct {
Definition []Definition `xml:"definition" json:",omitempty"`
}
type Definition struct {
Class string `xml:"class,attr" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Metadata Metadata `xml:"metadata" json:",omitempty"`
Criteria Criteria `xml:"criteria" json:",omitempty"`
}
type Metadata struct {
Title string `xml:"title" json:",omitempty"`
AffectedList []Affected `xml:"affected" json:",omitempty"`
References []Reference `xml:"reference" json:",omitempty"`
Description string `xml:"description" json:",omitempty"`
Advisory Advisory `xml:"advisory" json:",omitempty"`
}
type Advisory struct {
From string `xml:"from,attr" json:",omitempty"`
Severity string `xml:"severity" json:",omitempty"`
Rights string `xml:"rights" json:",omitempty"`
Issued Issued `xml:"issued" json:",omitempty"`
Updated Updated `xml:"updated" json:",omitempty"`
Cves []Cve `xml:"cve" json:",omitempty"`
Bugzilla []Bugzilla `xml:"bugzilla" json:",omitempty"`
AffectedCpeList []string `xml:"affected_cpe_list>cpe" json:",omitempty"`
}
type Criteria struct {
Operator string `xml:"operator,attr" json:",omitempty"`
Criterions []Criterion `xml:"criterion" json:",omitempty"`
Criterias []Criteria `xml:"criteria" json:",omitempty"`
}
type Criterion struct {
Comment string `xml:"comment,attr"`
TestRef string `xml:"test_ref,attr"`
}
type Affected struct {
Family string `xml:"family,attr" json:",omitempty"`
Platforms []string `xml:"platform" json:",omitempty"`
}
type Reference struct {
Source string `xml:"source,attr" json:",omitempty"`
RefID string `xml:"ref_id,attr" json:",omitempty"`
RefURL string `xml:"ref_url,attr" json:",omitempty"`
}
type Issued struct {
Date string `xml:"date,attr" json:",omitempty"`
}
type Updated struct {
Date string `xml:"date,attr" json:",omitempty"`
}
type Cve struct {
CveID string `xml:",chardata" json:",omitempty"`
Cvss2 string `xml:"cvss2,attr" json:",omitempty"`
Cvss3 string `xml:"cvss3,attr" json:",omitempty"`
Cwe string `xml:"cwe,attr" json:",omitempty"`
Impact string `xml:"impact,attr" json:",omitempty"`
Href string `xml:"href,attr" json:",omitempty"`
Public string `xml:"public,attr" json:",omitempty"`
}
type Bugzilla struct {
Href string `xml:"href,attr" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
}
type State struct {
Text string `xml:",chardata" json:",omitempty"`
StateRef string `xml:"state_ref,attr" json:",omitempty"`
}
type Object struct {
Text string `xml:",chardata" json:",omitempty"`
ObjectRef string `xml:"object_ref,attr" json:",omitempty"`
}
type RpminfoTest struct {
Check string `xml:"check,attr" json:",omitempty"`
Comment string `xml:"comment,attr" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
CheckExistence string `xml:"check_existence,attr" json:",omitempty"`
Object Object `xml:"object" json:",omitempty"`
State State `xml:"state" json:",omitempty"`
}
type RpminfoObject struct {
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Name string `xml:"name" json:",omitempty"`
}
type RpminfoState struct {
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Arch Arch `xml:"arch" json:",omitempty"`
Evr Evr `xml:"evr" json:",omitempty"`
SignatureKeyID SignatureKeyID `xml:"signature_keyid" json:",omitempty"`
}
type SignatureKeyID struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type Arch struct {
Text string `xml:",chardata" json:",omitempty"`
Datatype string `xml:"datatype,attr" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type Evr struct {
Text string `xml:",chardata" json:",omitempty"`
Datatype string `xml:"datatype,attr" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type Tests struct {
RpminfoTests []RpminfoTest `xml:"rpminfo_test" json:",omitempty"`
RpmverifyfileTests []RpmverifyfileTest `xml:"rpmverifyfile_test" json:",omitempty"`
Textfilecontent54Tests []Textfilecontent54Test `xml:"textfilecontent54_test" json:",omitempty"`
UnameTests []UnameTest `xml:"uname_test" json:",omitempty"`
}
type Textfilecontent54Test struct {
Check string `xml:"check,attr" json:",omitempty"`
Comment string `xml:"comment,attr" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Object Object `xml:"object" json:",omitempty"`
State State `xml:"state" json:",omitempty"`
}
type RpmverifyfileTest struct {
Check string `xml:"check,attr" json:",omitempty"`
Comment string `xml:"comment,attr" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Object Object `xml:"object" json:",omitempty"`
State State `xml:"state" json:",omitempty"`
}
type UnameTest struct {
Check string `xml:"check,attr" json:",omitempty"`
Comment string `xml:"comment,attr" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Object Object `xml:"object" json:",omitempty"`
State State `xml:"state" json:",omitempty"`
}
type Objects struct {
RpminfoObjects []RpminfoObject `xml:"rpminfo_object" json:",omitempty"`
RpmverifyfileObjects []RpmverifyfileObject `xml:"rpmverifyfile_object" json:",omitempty"`
Textfilecontent54Objects []Textfilecontent54Object `xml:"textfilecontent54_object" json:",omitempty"`
UnameObjects []UnameObject `xml:"uname_object" json:",omitempty"`
}
type UnameObject struct {
Text string `xml:",chardata" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
}
type Filepath struct {
Text string `xml:",chardata" json:",omitempty"`
Datatype string `xml:"datatype,attr" json:",omitempty"`
}
type Pattern struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type Instance struct {
Text string `xml:",chardata" json:",omitempty"`
Datatype string `xml:"datatype,attr" json:",omitempty"`
VarRef string `xml:"var_ref,attr" json:",omitempty"`
}
type Textfilecontent54Object struct {
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Filepath Filepath `xml:"filepath" json:",omitempty"`
Pattern Pattern `xml:"pattern" json:",omitempty"`
Instance Instance `xml:"instance" json:",omitempty"`
}
type Behaviors struct {
Text string `xml:",chardata" json:",omitempty"`
Noconfigfiles string `xml:"noconfigfiles,attr" json:",omitempty"`
Noghostfiles string `xml:"noghostfiles,attr" json:",omitempty"`
Nogroup string `xml:"nogroup,attr" json:",omitempty"`
Nolinkto string `xml:"nolinkto,attr" json:",omitempty"`
Nomd5 string `xml:"nomd5,attr" json:",omitempty"`
Nomode string `xml:"nomode,attr" json:",omitempty"`
Nomtime string `xml:"nomtime,attr" json:",omitempty"`
Nordev string `xml:"nordev,attr" json:",omitempty"`
Nosize string `xml:"nosize,attr" json:",omitempty"`
Nouser string `xml:"nouser,attr" json:",omitempty"`
}
type RpmverifyfileObject struct {
ID string `xml:"id,attr" json:",omitempty"`
AttrVersion string `xml:"version,attr" json:",omitempty"`
Behaviors Behaviors `xml:"behaviors" json:",omitempty"`
Filepath Filepath `xml:"filepath" json:",omitempty"`
Name Name `xml:"name" json:",omitempty"`
Version Version `xml:"version" json:",omitempty"`
Epoch Epoch `xml:"epoch" json:",omitempty"`
Arch Arch `xml:"arch" json:",omitempty"`
Release Release `xml:"release" json:",omitempty"`
}
type Epoch struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type Release struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type Name struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type States struct {
RpminfoState []RpminfoState `xml:"rpminfo_state" json:",omitempty"`
RpmverifyfileStates []RpmverifyfileState `xml:"rpmverifyfile_state" json:",omitempty"`
Textfilecontent54State []Textfilecontent54State `xml:"textfilecontent54_state" json:",omitempty"`
UnameState []UnameState `xml:"uname_state" json:",omitempty"`
}
type Version struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type RpmverifyfileState struct {
ID string `xml:"id,attr" json:",omitempty"`
AttrVersion string `xml:"version,attr" json:",omitempty"`
Name Name `xml:"name" json:",omitempty"`
Version Version `xml:"version" json:",omitempty"`
}
type Textfilecontent54State struct {
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
Text Text `xml:"text" json:",omitempty"`
}
type Text struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type OsRelease struct {
Text string `xml:",chardata" json:",omitempty"`
Operation string `xml:"operation,attr" json:",omitempty"`
}
type UnameState struct {
ID string `xml:"id,attr" json:",omitempty"`
Version string `xml:"version,attr" json:",omitempty"`
OsRelease OsRelease `xml:"os_release" json:",omitempty"`
}