This repository has been archived by the owner on Sep 15, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
193 lines (167 loc) · 6.59 KB
/
structs.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
package api
import "time"
// Ref: https://cloud.tenable.com/api#/resources/plugins
type PluginFamilies struct {
Families []PluginFamily `json:"families"`
}
// Ref: https://cloud.tenable.com/api#/resources/plugins
type PluginFamily struct {
ID int `json:"id"`
Name string `json:"name"`
Count int `json:"count"`
}
// Ref: https://cloud.tenable.com/api#/resources/plugins/family-details
type PluginFamilyDetails struct {
ID int `json:"id"`
Name string `json:"name"`
Plugins []Plugin `json:"plugins"`
}
// Ref: https://cloud.tenable.com/api#/resources/plugins
type Plugin struct {
ID int `json:"id"`
Name string `json:"name"`
}
// Ref: https://cloud.tenable.com/api#/resources/plugins/plugin-details
type PluginDetails struct {
ID int `json:"id"`
Name string `json:"name"`
FamilyName string `json:"family_name"`
Attributes []PluginAttributes `json:"attributes"`
}
// Ref: https://cloud.tenable.com/api#/resources/plugins
type PluginAttributes struct {
Name string `json:"attribute_name"`
Value string `json:"attribute_value"`
}
// Ref: https://cloud.tenable.com/api#/resources/workbenches/assets
type Assets struct {
Assets []Asset `json:"assets"`
}
// Ref: https://cloud.tenable.com/api#/resources/workbenches/assets
type Asset struct {
ID string `json:"id""`
HasAgent bool `json:"has_agent"`
LastSeen string `json:"last_seen"`
Sources []Source `json:"sources"`
AgentName []string `json:"agent_name"`
IPv4 []string `json:"ipv4"`
IPv6 []string `json:"ipv6"`
FQDN []string `json:"fqdn"`
NetbiosName []string `json:"netbios_name"`
OperatingSystem []string `json:"operating_system"`
MacAddress []string `json:"mac_address"`
}
// Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerabilities
type AssetVulnerabilities struct {
Vulnerabilities []Vulnerability `json:"vulnerabilities"`
}
// Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-info
type AssetVulnInfo struct {
Info VulnerabilityInfo `json:"info"`
}
// Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-output
type AssetVulnOutputs struct {
Outputs []AssetVulnOutput `json:"outputs"`
}
// Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-output
// TODO: Finish the AssetVulnOutput struct
type AssetVulnOutput struct {
PluginOutput string `json:"plugin_output"`
States interface{} `json:"states"`
}
// vulnerability
// Ref: https://cloud.tenable.com/api#/resources/workbenches
type Vulnerability struct {
Count int `json:"count"`
PluginFamily string `json:"plugin_family"`
PluginID int `json:"plugin_id"`
PluginName string `json:"plugin_name"`
VulnerabilityState string `json:"vulnerability_state"`
Severity int `json:"severity"`
}
// vulnerability_info
// Ref: https://cloud.tenable.com/api#/resources/workbenches
// TODO: Finish the VulnerabilityInfo struct
type VulnerabilityInfo struct {
Description string `json:"description"`
Synopsis string `json:"synopsis"`
Discovery interface{} `json:"discovery"`
PluginDetails VulnerabilityInfoPluginDetails `json:"plugin_details"`
ReferenceInformation interface{} `json:"reference_information"`
RiskInformation interface{} `json:"risk_information"`
SeeAlso []interface{} `json:"see_also"`
Solution string `json:"solution"`
VulnerabilityInformation VulnerabilityInformation `json:"vulnerability_information"`
}
type VulnerabilityInfoPluginDetails struct {
Name string `json:"name"`
FamilyName string `json:"family"`
Severity int `json:"severity"`
Type string `json:"local"`
PublicationDate *time.Time `json:"publication_date"`
ModificationDate *time.Time `json:"modification_date"`
Version string `json:"version"`
}
// vulnerability_info
// Ref: https://cloud.tenable.com/api#/resources/workbenches
type VulnerabilityInformation struct {
CPE []string `json:"cpe"`
VulnPublicationDate *time.Time `json:"vulnerability_publication_date"`
PatchPublicationDate *time.Time `json:"patch_publication_date"`
UnsupportedByVendor bool `json:"unsupported_by_vendor"`
// TODO: Finish implementing this..
ExploitAvailable interface{} `json:"exploit_available"`
ExploitabilityEase interface{} `json:"exploitability_ease"`
ExploitedByMalware interface{} `json:"exploited_by_malware"`
ExploitedByNessus interface{} `json:"exploited_by_nessus"`
ExploitFrameworks interface{} `json:"exploit_frameworks"`
AssetInventory interface{} `json:"asset_inventory"`
DefaultAccount interface{} `json:"default_account"`
InTheNews interface{} `json:"in_the_news"`
Malware interface{} `json:"malware"`
}
// vulnerability_output
// Ref: https://cloud.tenable.com/api#/resources/workbenches
type VulnerabilityOutput struct {
ApplicationProtocol string `json:"application_protocol"`
Assets []Asset `json:"assets"`
Port int `json:"port"`
TransportProtocol string `json:"transport_protocol"`
}
// source
// Ref: https://cloud.tenable.com/api#/resources/workbenches
type Source struct {
Name string `json:"name"`
FirstSeen string `json:"first_seen"`
LastSeen string `json:"last_seen"`
}
// Ref: https://cloud.tenable.com/api#/resources/filters
type Pagination struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Sort []Sort `json:"sort"`
}
// Ref: https://cloud.tenable.com/api#/resources/filters
type Sort struct {
Name string `json:"name"`
Order string `json:"order"`
}
// The details of an agent connected to a scanner.
// Ref: https://cloud.tenable.com/api#/resources/agents
type Agent struct {
ID int `json:"id"`
UUID string `json:"uuid"`
LinkedOn int `json:"linked_on"`
LastConnect int `json:"last_connect"`
LastScanned int `json:"last_scanned"`
PluginFeedID string `json:"plugin_feed_id"`
CoreBuild string `json:"core_build"`
CoreVersion string `json:"core_version"`
Name string `json:"name"`
Distro string `json:"distro"`
Platform string `json:"platform"`
IP string `json:"ip"`
Status string `json:"status"`
Groups []AgentGroupRef `json:"groups"`
}