line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SecurityCenter::API::ScanResult; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
930
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
76
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
28
|
|
|
2
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
111
|
|
7
|
2
|
|
|
2
|
|
1376
|
use IO::Uncompress::Unzip qw(unzip $UnzipError); |
|
2
|
|
|
|
|
79293
|
|
|
2
|
|
|
|
|
242
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
18
|
use parent 'Net::SecurityCenter::Base'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
14
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
136
|
use Net::SecurityCenter::Utils qw(:all); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
4071
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.311'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $common_template = { |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
id => { |
18
|
|
|
|
|
|
|
required => 1, |
19
|
|
|
|
|
|
|
allow => qr/^\d+$/, |
20
|
|
|
|
|
|
|
messages => { |
21
|
|
|
|
|
|
|
required => 'Scan Result ID is required', |
22
|
|
|
|
|
|
|
allow => 'Invalid Scan Result ID', |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
filter => { |
27
|
|
|
|
|
|
|
allow => [ 'usable', 'manageable', 'running', 'completed' ] |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
fields => { |
31
|
|
|
|
|
|
|
allow => \&sc_filter_array_to_string, |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
# METHODS |
38
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub download { |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $tmpl = { |
45
|
|
|
|
|
|
|
filename => {}, |
46
|
0
|
|
|
|
|
0
|
id => $common_template->{'id'}, |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
0
|
my $params = sc_check_params( $tmpl, \%args ); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
0
|
my $scan_result_id = delete( $params->{'id'} ); |
52
|
0
|
|
|
|
|
0
|
my $filename = delete( $params->{'filename'} ); |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
0
|
my $sc_scan_data = $self->client->post( "/scanResult/$scan_result_id/download", { 'downloadType' => 'v2' } ); |
55
|
0
|
|
|
|
|
0
|
my $nessus_scan_data = q{}; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
0
|
return if ( !$sc_scan_data ); |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
0
|
if ($sc_scan_data) { |
60
|
0
|
0
|
|
|
|
0
|
unzip \$sc_scan_data => \$nessus_scan_data or croak "Failed to uncompress Nessus scan: $UnzipError\n"; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
0
|
0
|
|
|
|
0
|
return $nessus_scan_data if ( !$filename ); |
64
|
|
|
|
|
|
|
|
65
|
0
|
0
|
|
|
|
0
|
open my $fh, '>', $filename |
66
|
|
|
|
|
|
|
or croak("Could not open file '$filename': $!"); |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
0
|
print $fh $nessus_scan_data; |
69
|
|
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
0
|
close $fh |
71
|
|
|
|
|
|
|
or carp("Failed to close file '$filename': $!"); |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
0
|
return 1; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub list { |
80
|
|
|
|
|
|
|
|
81
|
1
|
|
|
1
|
1
|
3
|
my ( $self, %args ) = @_; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
my $tmpl = { |
84
|
|
|
|
|
|
|
fields => $common_template->{'fields'}, |
85
|
1
|
|
|
|
|
18
|
filter => $common_template->{'filter'}, |
86
|
|
|
|
|
|
|
raw => {}, |
87
|
|
|
|
|
|
|
start_date => { |
88
|
|
|
|
|
|
|
filter => \&sc_filter_datetime_to_epoch, |
89
|
|
|
|
|
|
|
remap => 'startTime', |
90
|
|
|
|
|
|
|
}, |
91
|
|
|
|
|
|
|
end_date => { |
92
|
|
|
|
|
|
|
filter => \&sc_filter_datetime_to_epoch, |
93
|
|
|
|
|
|
|
remap => 'endTime', |
94
|
|
|
|
|
|
|
}, |
95
|
|
|
|
|
|
|
start_time => { |
96
|
|
|
|
|
|
|
allow => qr/^\d+$/, |
97
|
|
|
|
|
|
|
remap => 'startTime' |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
end_time => { |
100
|
|
|
|
|
|
|
allow => qr/^\d+$/, |
101
|
|
|
|
|
|
|
remap => 'endTime' |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
}; |
104
|
|
|
|
|
|
|
|
105
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
106
|
1
|
|
|
|
|
4
|
my $raw = delete( $params->{'raw'} ); |
107
|
1
|
|
|
|
|
10
|
my $scans = $self->client->get( '/scanResult', $params ); |
108
|
|
|
|
|
|
|
|
109
|
1
|
50
|
|
|
|
14
|
return if ( !$scans ); |
110
|
|
|
|
|
|
|
|
111
|
1
|
50
|
|
|
|
7
|
if ($raw) { |
112
|
0
|
0
|
|
|
|
0
|
return wantarray ? @{$scans} : $scans; |
|
0
|
|
|
|
|
0
|
|
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
1
|
50
|
|
|
|
8
|
return wantarray ? @{ sc_merge($scans) } : sc_merge($scans); |
|
0
|
|
|
|
|
0
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub list_running { |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = @_; |
124
|
|
|
|
|
|
|
|
125
|
0
|
|
|
|
|
0
|
my $tmpl = { fields => $common_template->{'fields'}, raw => {}, }; |
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
0
|
my $params = sc_check_params( $tmpl, \%args ); |
128
|
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
0
|
$params->{'filter'} = 'running'; |
130
|
|
|
|
|
|
|
|
131
|
0
|
|
|
|
|
0
|
return $self->list( %{$params} ); |
|
0
|
|
|
|
|
0
|
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub list_completed { |
138
|
|
|
|
|
|
|
|
139
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = @_; |
140
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
0
|
my $tmpl = { fields => $common_template->{'fields'}, raw => {}, }; |
142
|
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
0
|
my $params = sc_check_params( $tmpl, \%args ); |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
0
|
$params->{'filter'} = 'completed'; |
146
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
0
|
return $self->list( %{$params} ); |
|
0
|
|
|
|
|
0
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub get { |
154
|
|
|
|
|
|
|
|
155
|
3
|
|
|
3
|
1
|
12
|
my ( $self, %args ) = @_; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
my $tmpl = { |
158
|
|
|
|
|
|
|
id => $common_template->{'id'}, |
159
|
3
|
|
|
|
|
12
|
fields => $common_template->{'fields'}, |
160
|
|
|
|
|
|
|
raw => {}, |
161
|
|
|
|
|
|
|
}; |
162
|
|
|
|
|
|
|
|
163
|
3
|
|
|
|
|
11
|
my $params = sc_check_params( $tmpl, \%args ); |
164
|
3
|
|
|
|
|
12
|
my $scan_result_id = delete( $params->{'id'} ); |
165
|
3
|
|
|
|
|
6
|
my $raw = delete( $params->{'raw'} ); |
166
|
|
|
|
|
|
|
|
167
|
3
|
|
|
|
|
16
|
my $scan_result = $self->client->get( "/scanResult/$scan_result_id", $params ); |
168
|
|
|
|
|
|
|
|
169
|
3
|
50
|
|
|
|
11
|
return if ( !$scan_result ); |
170
|
3
|
50
|
|
|
|
10
|
return $scan_result if ($raw); |
171
|
|
|
|
|
|
|
|
172
|
3
|
|
|
|
|
11
|
return sc_normalize_hash($scan_result); |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub delete { |
179
|
|
|
|
|
|
|
|
180
|
1
|
|
|
1
|
1
|
5
|
my ( $self, %args ) = @_; |
181
|
|
|
|
|
|
|
|
182
|
1
|
|
|
|
|
4
|
my $tmpl = { id => $common_template->{'id'} }; |
183
|
|
|
|
|
|
|
|
184
|
1
|
|
|
|
|
5
|
my $params = sc_check_params( $tmpl, \%args ); |
185
|
1
|
|
|
|
|
3
|
my $scan_result_id = delete( $params->{'id'} ); |
186
|
|
|
|
|
|
|
|
187
|
1
|
|
|
|
|
7
|
my $scan_result = $self->client->delete("/scanResult/$scan_result_id"); |
188
|
|
|
|
|
|
|
|
189
|
1
|
50
|
|
|
|
9
|
return 1 if ( defined $scan_result ); |
190
|
0
|
0
|
|
|
|
0
|
return if ( !$scan_result ); |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
sub progress { |
197
|
|
|
|
|
|
|
|
198
|
1
|
|
|
1
|
1
|
5
|
my ( $self, %args ) = @_; |
199
|
|
|
|
|
|
|
|
200
|
1
|
|
|
|
|
3
|
my $tmpl = { id => $common_template->{'id'}, }; |
201
|
|
|
|
|
|
|
|
202
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
203
|
1
|
|
|
|
|
4
|
my $scan_result_id = delete( $params->{'id'} ); |
204
|
|
|
|
|
|
|
|
205
|
1
|
|
|
|
|
8
|
my $scan_data = $self->get( |
206
|
|
|
|
|
|
|
id => $scan_result_id, |
207
|
|
|
|
|
|
|
fields => [ 'id', 'totalChecks', 'completedChecks' ] |
208
|
|
|
|
|
|
|
); |
209
|
|
|
|
|
|
|
|
210
|
1
|
50
|
|
|
|
6
|
return if ( !$scan_data ); |
211
|
|
|
|
|
|
|
|
212
|
1
|
|
|
|
|
32
|
return sprintf( '%d', ( $scan_data->{'completedChecks'} * 100 ) / $scan_data->{'totalChecks'} ); |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
sub status { |
219
|
|
|
|
|
|
|
|
220
|
1
|
|
|
1
|
1
|
5
|
my ( $self, %args ) = @_; |
221
|
|
|
|
|
|
|
|
222
|
1
|
|
|
|
|
5
|
my $tmpl = { id => $common_template->{'id'}, }; |
223
|
|
|
|
|
|
|
|
224
|
1
|
|
|
|
|
5
|
my $params = sc_check_params( $tmpl, \%args ); |
225
|
1
|
|
|
|
|
5
|
my $scan_result_id = delete( $params->{'id'} ); |
226
|
|
|
|
|
|
|
|
227
|
1
|
|
|
|
|
6
|
my $scan_data = $self->get( |
228
|
|
|
|
|
|
|
id => $scan_result_id, |
229
|
|
|
|
|
|
|
fields => [ 'id', 'status' ] |
230
|
|
|
|
|
|
|
); |
231
|
|
|
|
|
|
|
|
232
|
1
|
50
|
|
|
|
4
|
return if ( !$scan_data ); |
233
|
|
|
|
|
|
|
|
234
|
1
|
|
|
|
|
35
|
return lc( $scan_data->{'status'} ); |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
sub pause { |
241
|
|
|
|
|
|
|
|
242
|
1
|
|
|
1
|
1
|
5
|
my ( $self, %args ) = @_; |
243
|
|
|
|
|
|
|
|
244
|
1
|
|
|
|
|
4
|
my $tmpl = { id => $common_template->{'id'}, }; |
245
|
|
|
|
|
|
|
|
246
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
247
|
1
|
|
|
|
|
5
|
my $scan_result_id = delete( $params->{'id'} ); |
248
|
|
|
|
|
|
|
|
249
|
1
|
|
|
|
|
5
|
$self->client->post("/scanResult/$scan_result_id/pause"); |
250
|
1
|
|
|
|
|
43
|
return 1; |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
sub resume { |
257
|
|
|
|
|
|
|
|
258
|
1
|
|
|
1
|
1
|
5
|
my ( $self, %args ) = @_; |
259
|
|
|
|
|
|
|
|
260
|
1
|
|
|
|
|
4
|
my $tmpl = { id => $common_template->{'id'}, }; |
261
|
|
|
|
|
|
|
|
262
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
263
|
1
|
|
|
|
|
4
|
my $scan_result_id = delete( $params->{'id'} ); |
264
|
|
|
|
|
|
|
|
265
|
1
|
|
|
|
|
8
|
$self->client->post("/scanResult/$scan_result_id/resume"); |
266
|
1
|
|
|
|
|
7
|
return 1; |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
} |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
sub reimport { |
273
|
|
|
|
|
|
|
|
274
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = @_; |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
my $tmpl = { |
277
|
0
|
|
|
|
|
0
|
id => $common_template->{'id'}, |
278
|
|
|
|
|
|
|
scan_vhost => { |
279
|
|
|
|
|
|
|
remap => 'scanningVirtualHosts', |
280
|
|
|
|
|
|
|
filter => \&sc_filter_int_to_bool, |
281
|
|
|
|
|
|
|
allow => qr/\d/, |
282
|
|
|
|
|
|
|
}, |
283
|
|
|
|
|
|
|
dhcp_tracking => { |
284
|
|
|
|
|
|
|
remap => 'dhcpTracking', |
285
|
|
|
|
|
|
|
filter => \&sc_filter_int_to_bool, |
286
|
|
|
|
|
|
|
allow => qr/\d/, |
287
|
|
|
|
|
|
|
}, |
288
|
|
|
|
|
|
|
classify_mitigated_age => { remap => 'classifyMitigatedAge' } |
289
|
|
|
|
|
|
|
}; |
290
|
|
|
|
|
|
|
|
291
|
0
|
|
|
|
|
0
|
my $params = sc_check_params( $tmpl, \%args ); |
292
|
0
|
|
|
|
|
0
|
my $scan_result_id = delete( $params->{'id'} ); |
293
|
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
0
|
$self->client->post("/scanResult/$scan_result_id/import"); |
295
|
0
|
|
|
|
|
0
|
return 1; |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
sub import { |
302
|
|
|
|
|
|
|
|
303
|
0
|
|
|
0
|
|
0
|
my ( $self, %args ) = @_; |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
my $single_id_filter = sub { |
306
|
0
|
|
|
0
|
|
0
|
return { 'id' => $_[0] }; |
307
|
0
|
|
|
|
|
0
|
}; |
308
|
|
|
|
|
|
|
|
309
|
0
|
|
|
|
|
0
|
my $tmpl = { |
310
|
|
|
|
|
|
|
filename => {}, |
311
|
|
|
|
|
|
|
dhcp_tracking => { |
312
|
|
|
|
|
|
|
remap => 'dhcpTracking', |
313
|
|
|
|
|
|
|
filter => \&sc_filter_int_to_bool, |
314
|
|
|
|
|
|
|
allow => qr/\d/, |
315
|
|
|
|
|
|
|
}, |
316
|
|
|
|
|
|
|
classify_mitigated_age => { remap => 'classifyMitigatedAge' }, |
317
|
|
|
|
|
|
|
scan_vhost => { |
318
|
|
|
|
|
|
|
remap => 'scanningVirtualHosts', |
319
|
|
|
|
|
|
|
filter => \&sc_filter_int_to_bool, |
320
|
|
|
|
|
|
|
allow => qr/\d/, |
321
|
|
|
|
|
|
|
}, |
322
|
|
|
|
|
|
|
repository => { |
323
|
|
|
|
|
|
|
allow => qr/\d+/, |
324
|
|
|
|
|
|
|
errors => { allow => 'Invalid Repository ID' }, |
325
|
|
|
|
|
|
|
filter => \&$single_id_filter |
326
|
|
|
|
|
|
|
}, |
327
|
|
|
|
|
|
|
}; |
328
|
|
|
|
|
|
|
|
329
|
0
|
|
|
|
|
0
|
my $params = sc_check_params( $tmpl, \%args ); |
330
|
0
|
|
|
|
|
0
|
my $filename = delete( $params->{'filename'} ); |
331
|
0
|
|
|
|
|
0
|
my $sc_filename = $self->client->upload($filename)->{'filename'}; |
332
|
|
|
|
|
|
|
|
333
|
0
|
|
|
|
|
0
|
$params->{'filename'} = $sc_filename; |
334
|
|
|
|
|
|
|
|
335
|
0
|
|
|
|
|
0
|
$self->client->post( "/scanResult/import", $params ); |
336
|
0
|
|
|
|
|
0
|
return 1; |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
} |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
sub email { |
343
|
|
|
|
|
|
|
|
344
|
0
|
|
|
0
|
1
|
0
|
my ( $self, %args ) = @_; |
345
|
|
|
|
|
|
|
|
346
|
0
|
|
|
|
|
0
|
my $tmpl = { id => $common_template->{'id'}, email => {} }; |
347
|
|
|
|
|
|
|
|
348
|
0
|
|
|
|
|
0
|
my $params = sc_check_params( $tmpl, \%args ); |
349
|
0
|
|
|
|
|
0
|
my $scan_result_id = delete( $params->{'id'} ); |
350
|
|
|
|
|
|
|
|
351
|
0
|
|
|
|
|
0
|
$self->client->post( "/scanResult/$scan_result_id/import", $params ); |
352
|
0
|
|
|
|
|
0
|
return 1; |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
sub stop { |
359
|
|
|
|
|
|
|
|
360
|
1
|
|
|
1
|
1
|
5
|
my ( $self, %args ) = @_; |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
my $tmpl = { |
363
|
1
|
|
|
|
|
7
|
id => $common_template->{'id'}, |
364
|
|
|
|
|
|
|
type => { |
365
|
|
|
|
|
|
|
allow => ['import'] |
366
|
|
|
|
|
|
|
} |
367
|
|
|
|
|
|
|
}; |
368
|
|
|
|
|
|
|
|
369
|
1
|
|
|
|
|
5
|
my $params = sc_check_params( $tmpl, \%args ); |
370
|
1
|
|
|
|
|
6
|
my $scan_result_id = delete( $params->{'id'} ); |
371
|
|
|
|
|
|
|
|
372
|
1
|
|
|
|
|
6
|
$self->client->post( "/scanResult/$scan_result_id/stop", $params ); |
373
|
1
|
|
|
|
|
13
|
return 1; |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
1; |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
__END__ |