Class: Ops::Nexpose

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose_tpam/nexpose_ops.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nxip, nxuser, nxpasword) ⇒ Nexpose

Returns a new instance of Nexpose.



6
7
8
9
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 6

def initialize(nxip, nxuser, nxpasword)
  @nsc = Connection.new(nxip, nxuser, nxpasword)
  @nsc.
end

Instance Attribute Details

#nscObject

Returns the value of attribute nsc.



5
6
7
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 5

def nsc
  @nsc
end

Instance Method Details

#delete_site_credentials(site_id) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 27

def delete_site_credentials(site_id)
  site = Site.load(@nsc, site_id)
  #site.site_credentials = []
  #site.shared_credentials = []
  site.credentials = []
  site.save(@nsc)
end

#get_ips_from_site(site_id) ⇒ Object



11
12
13
14
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 11

def get_ips_from_site(site_id)
  site = Site.load(@nsc, site_id)
  site.assets
end

#get_name_from_site(site_id) ⇒ Object



16
17
18
19
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 16

def get_name_from_site(site_id)
  site = Site.load(@nsc, site_id)
  site.name
end

#save_site(site_id, credentials) ⇒ Object



21
22
23
24
25
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 21

def save_site(site_id, credentials)
  site = Site.load(@nsc, site_id)
  site.credentials = credentials
  site.save(@nsc)
end

#scan_status(scan_id) ⇒ Object



41
42
43
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 41

def scan_status(scan_id)
  @nsc.scan_status(scan_id)
end

#start_scan(site_id) ⇒ Object



35
36
37
38
39
# File 'lib/nexpose_tpam/nexpose_ops.rb', line 35

def start_scan(site_id)
  site = Site.load(@nsc, site_id)
  puts "Name: #{site.name}"
  site.scan(@nsc)
end