/
README
41 lines (30 loc) · 1.17 KB
/
README
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
Usage:
The Scan Manager can be used to:
A. MONITOR A SCAN
# Create a NeXpose API Connection
nexpose_connection = NeXpose::Connection.new host, username, password, port
# Initialize the scan manager
# Poll NeXpose every 5 seconds for the scan status
poll_time = 5
scan_manager = ScanManager.new nexpose_connection, false, poll__time
# Add your observing class to the scan manager that defines an update method
# scan_data contains the scan ID, status, and message if any
class ScanObserver
def update scan_data, notifier
<do whatever with scan_data>
end
end
scan_observer = ScanObserver.new
scan_manager.add_observer scan_observer
B. START A RESTRICTIVE SCAN
# Define the condition
conditional_scan =
{
:site_id => <site ID>,
:max_scans => 5, # Only start scan if there are less than 5 scans running
:devices => <array of devices>, # IPs
:listeners => listeners # Can be null or an observer as defined in A
}
scan_manager.add_conditional_device_scan conditional_scan
This file was modified by JetBrains RubyMine 3.1.1 for binding GitHub repository
This file was modified by JetBrains RubyMine 3.1.1 for binding GitHub repository