tenable-ruby 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tenable-ruby.rb +4 -27
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0ad4945418eed9203a963b29176367b98faa3edd12883d97cc49d8cdc893fba
|
4
|
+
data.tar.gz: 24c17741e683b65c0c3c2362d7414f099153a7222bad4af37b2f3cb54b99523c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f1a50612125ce469b30e90ec69bc88b307646a1765841564fd127a539dfd8e1c8004fd82ff9a6d6dec0832e298c756edaa4dc67abd85db54039df0d0ddb627e
|
7
|
+
data.tar.gz: 9cd6b2b9b3462a0750104aded927326facfe1efe097ac0520a3118baf3b836803c69145600bac9395145f10f5aa70f463170cb43f59d7afd2278fe7edea70bc8
|
data/lib/tenable-ruby.rb
CHANGED
@@ -566,34 +566,11 @@ module TenableRuby
|
|
566
566
|
scan_create(template_uuid, settings)
|
567
567
|
end
|
568
568
|
|
569
|
-
# Returns
|
569
|
+
# Returns the latest status for a scan.
|
570
|
+
#
|
571
|
+
# Reference: https://developer.tenable.com/reference#scans-get-latest-status
|
570
572
|
def scan_status(scan_id)
|
571
|
-
|
572
|
-
if details.nil?
|
573
|
-
raise TenableRuby::Error::TenableError, "Get scan_details returned nil"
|
574
|
-
end
|
575
|
-
if not details['error'].nil?
|
576
|
-
raise TenableRuby::Error::TenableError, "Get scan_details returned the following error: #{details['error']}"
|
577
|
-
end
|
578
|
-
details['info']['status']
|
579
|
-
end
|
580
|
-
|
581
|
-
# Returns the status of the latest history object of a scan by performing a 'scan_details' API call.
|
582
|
-
# Note this is currently updated more frequently than the scan status in the tenable.io API
|
583
|
-
def scan_latest_history_status(scan_id)
|
584
|
-
details = scan_details(scan_id)
|
585
|
-
if details.nil?
|
586
|
-
raise TenableRuby::Error::TenableError, "Get scan_details returned nil"
|
587
|
-
end
|
588
|
-
if not details['error'].nil?
|
589
|
-
raise TenableRuby::Error::TenableError, "Get scan_details returned the following error: #{details['error']}"
|
590
|
-
end
|
591
|
-
history = details['history']
|
592
|
-
if history.nil? or history.length == 0
|
593
|
-
raise TenableRuby::Error::TenableError, "Get scan_details returned empty history object"
|
594
|
-
else
|
595
|
-
details['history'].last['status']
|
596
|
-
end
|
573
|
+
http_get(:uri => "/scans/#{scan_id}/latest-status", :fields => header)['status']
|
597
574
|
end
|
598
575
|
|
599
576
|
# Parse the scan status command to determine if a scan has finished
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tenable-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Craston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Ruby library for communicating with the tenable.io API.
|