/
model.go
77 lines (69 loc) · 2.59 KB
/
model.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
package aqua
type ResourceType int
const (
_ ResourceType = iota
Library
Package
)
type ScanReport struct {
Image string `json:"image"`
Registry string `json:"registry"`
Digest string `json:"digest"`
PullName string `json:"pull_name"`
OS string `json:"os"`
Version string `json:"version"`
PartialResults bool `json:"partial_results"`
ChangedResults bool `json:"changed_results"`
InitiatingUser string `json:"initiating_user"`
Resources []ResourceScan `json:"resources"`
Summary Summary `json:"vulnerability_summary"`
ScanOptions ScanOptions `json:"scan_options"`
}
type ResourceScan struct {
Resource Resource `json:"resource"`
Scanned bool `json:"scanned"`
Vulnerabilities []Vulnerability `json:"vulnerabilities"`
}
type Resource struct {
Format string `json:"format"`
Type ResourceType `json:"type"`
Path string `json:"path"`
Name string `json:"name"`
Version string `json:"version"`
CPE string `json:"cpe"` // CPE Common Platform Enumerations
}
type Vulnerability struct {
Name string `json:"name"`
Description string `json:"description"`
NVDURL string `json:"nvd_url"`
VendorURL string `json:"vendor_url"`
FixVersion string `json:"fix_version"`
AquaScore float32 `json:"aqua_score"`
AquaSeverity string `json:"aqua_severity"`
AquaVectors string `json:"aqua_vectors"`
AquaScoringSystem string `json:"aqua_scoring_system"`
}
type Summary struct {
Total int `json:"total"`
Critical int `json:"critical"`
High int `json:"high"`
Medium int `json:"medium"`
Low int `json:"low"`
Negligible int `json:"negligible"`
Sensitive int `json:"sensitive"`
Malware int `json:"malware"`
}
type ScanOptions struct {
ScanExecutables bool `json:"scan_executables"`
ShowWillNotFix bool `json:"show_will_not_fix"`
StrictScan bool `json:"strict_scan"`
ScanMalware bool `json:"scan_malware"`
ScanFiles bool `json:"scan_files"`
ManualPullFallback bool `json:"manual_pull_fallback"`
SaveAdHockScans bool `json:"save_adhoc_scans"`
Dockerless bool `json:"dockerless"`
EnableFastScanning bool `json:"enable_fast_scanning"`
SuggestOSUpgrade bool `json:"suggest_os_upgrade"`
IncludeSiblingAdvisories bool `json:"include_sibling_advisories"`
UseCVSS3 bool `json:"use_cvss3"`
}