-
Notifications
You must be signed in to change notification settings - Fork 8
/
vulnerabilitytypes.go
194 lines (177 loc) · 8.24 KB
/
vulnerabilitytypes.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
package armotypes
import (
"time"
)
const (
ExploitableCisaKev = "Known Exploited"
ExploitableHighLikelihood = "High Likelihood"
ExploitableNo = "No"
EpssThreshold = 0.10 // 10%
CisaKevKnown = "Known"
CisaKevUnknown = "Unknown"
)
type VulnerabilityJobParams struct {
Name string `json:"name,omitempty"`
ID string `json:"id,omitempty"`
ClusterName string `json:"clusterName"`
Namespace string `json:"namespace"`
CronTabSchedule string `json:"cronTabSchedule,omitempty"`
JobID string `json:"jobID,omitempty"`
}
type VulnerabilityWorkload struct {
Wlid string `json:"wlid"`
ResourceHash string `json:"resourceHash"` //common hash of customerGUID, cluster, kind, name, namespace, apiVersion
Name string `json:"name"`
Namespace string `json:"namespace"`
Kind string `json:"kind"`
Cluster string `json:"cluster"`
ClusterShortName string `json:"clusterShortName"`
LastScanTime time.Time `json:"lastScanTime"`
CustomerGUID string `json:"customerGUID"`
ImagesCount int `json:"imagesCount"`
CriticalCount int `json:"criticalCount"`
HighCount int `json:"highCount"`
MediumCount int `json:"mediumCount"`
LowCount int `json:"lowCount"`
SeverityStats map[string][]string `json:"severityStats"`
RiskFactorsCount int `json:"riskFactorsCount"`
RiskFactors []RiskFactor `json:"riskFactors"`
Labels []string `json:"labels"`
HasRelevancyData bool `json:"hasRelevancyData"`
Images []string `json:"images"`
Tickets []Ticket `json:"tickets,omitempty"`
}
type ContainerPathInfo struct {
NameSpace string `json:"namespace"`
WorkloadName string `json:"workloadName"`
ContainerName string `json:"containerName"`
WorkloadKind string `json:"workloadKind"`
WorkloadHash string `json:"workloadHash"`
WLID string `json:"wlid"`
ClusterName string `json:"clusterName"`
ClusterShortName string `json:"clusterShortName"`
}
type ComponentSummary struct {
CustomerGUID string `json:"customerGUID"`
Name string `json:"name"`
Version string `json:"version"`
PackageType string `json:"packageType"`
FixVersions []string `json:"fixVersions"`
CriticalCount int `json:"criticalCount"`
HighCount int `json:"highCount"`
MediumCount int `json:"mediumCount"`
LowCount int `json:"lowCount"`
ClustersCount int `json:"clustersCount"`
NamespacesCount int `json:"namespacesCount"`
WorkloadsCount int `json:"workloadsCount"`
ImagesCount int `json:"imagesCount"`
SeverityStats map[string][]string `json:"severityStats"`
Tickets []Ticket `json:"tickets,omitempty"`
}
type ImageSummary struct {
CustomerGUID string `json:"customerGUID"`
Tag string `json:"tag"`
Digest string `json:"digest"`
Registry string `json:"registry"`
Repository string `json:"repository"`
Architecture string `json:"architecture"`
OS string `json:"os"`
Size uint64 `json:"size"`
LastScanTime time.Time `json:"lastScanTime"`
Clusters []string `json:"clusters"`
Namespaces []string `json:"namespaces"`
Workloads []string `json:"workloads"`
Kinds []string `json:"kinds"`
Containers []string `json:"containers"`
SeverityStats map[string][]string `json:"severityStats"`
CriticalCount int `json:"criticalCount"`
HighCount int `json:"highCount"`
MediumCount int `json:"mediumCount"`
LowCount int `json:"lowCount"`
ClustersCount int `json:"clustersCount"`
NamespacesCount int `json:"namespacesCount"`
WorkloadsCount int `json:"workloadsCount"`
ContainersCount int `json:"containersCount"`
Tickets []Ticket `json:"tickets,omitempty"`
}
type VulnerabilitiesComponent struct {
CustomerGUID string `json:"customerGUID"`
Name string `json:"name"`
Version string `json:"version"`
PackageType string `json:"packageType"`
// swagger:ignore
FirstSeen time.Time `json:"firstSeen"` //first found in the user account (not in the world)
FixVersions []string `json:"fixVersions"`
PathsInfo []ComponentPathInfo `json:"pathsInfo"`
}
type ComponentPathInfo struct {
ContainerPathInfo
ImageTag string `json:"imageTag"`
ImageHash string `json:"imageHash"`
IsRelevant string `json:"isRelevant"`
Paths []string `json:"paths"`
}
type Vulnerability struct {
Name string `json:"name"`
ID string `json:"id"`
Severity string `json:"severity"`
SeverityScore int `json:"severityScore"`
Links []string `json:"links"`
Description string `json:"description"`
Exploitable string `json:"exploitable"`
IsRelevant string `json:"isRelevant"`
ComponentInfo VulnerabilitiesComponent `json:"componentInfo"`
CvssInfo CvssInfo `json:"cvssInfo"`
EpssInfo EpssInfo `json:"epssInfo"`
CisaKevInfo CisaKevInfo `json:"cisaKevInfo"`
WorkloadsCount int `json:"workloadsCount"`
ImagesCount int `json:"imagesCount"`
IgnoreRulesSummary map[string]IgnoreRuleSummary `json:"ignoreRulesSummary"`
Tickets []Ticket `json:"tickets,omitempty"`
}
type CvssInfo struct {
BaseScore float64 `json:"baseScore"`
ScoreVersion string `json:"scoreVersion"`
Severity string `json:"severity"`
CVSS []Cvss `json:"cvss"`
}
type Cvss struct {
Vector string `json:"vector"`
Version string `json:"version"`
Source string `json:"source"`
BaseScore float64 `json:"baseScore"`
ExploitabiltiyScore float64 `json:"exploitabilityScore"`
ImpactScore float64 `json:"impactScore"`
ExploitabilityInfo CvssExploitabilityInfo `json:"exploitabilityInfo"`
ImpactInfo CvssImpactInfo `json:"impactInfo"`
}
type CvssExploitabilityInfo struct {
AttackVector string `json:"attackVector,omitempty"`
AccessVector string `json:"accessVector,omitempty"`
AttackComplexity string `json:"attackComplexity,omitempty"`
AccessComplexity string `json:"accessComplexity,omitempty"`
Authentication string `json:"authentication,omitempty"`
PrivilegesRequired string `json:"privilegesRequired,omitempty"`
UserInteraction string `json:"userInteraction,omitempty"`
Scope string `json:"scope,omitempty"`
}
type CvssImpactInfo struct {
Confidentiality string `json:"confidentiality,omitempty"`
Integrity string `json:"integrity,omitempty"`
Availability string `json:"availability,omitempty"`
}
type EpssInfo struct {
Epss float64 `json:"epss"`
Percentile float64 `json:"percentile"`
Date string `json:"date"`
}
type CisaKevInfo struct {
DateAdded string `json:"dateAdded"`
DueDate string `json:"dueDate"`
KnownRansomwareCampaignUse string `json:"knownRansomwareCampaignUse"`
Notes string `json:"notes"`
}
type IgnoreRuleSummary struct {
NumberOfSystemRules int `json:"numberOfSystemRules"`
IgnoreRulesIDs []string `json:"ignoreRulesIDs"`
}