tenable-ruby 0.4.3 → 0.4.4
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 +10 -8
- 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: 77917278fce3594ee5fce1156ba4309ef5ed2fdeeaace91d2b3c3626818acd67
|
4
|
+
data.tar.gz: 26b073b7ef3de954d470002eb035e3aa52d2bb30bde90b211680f6f2f0bb82b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa26c48c98bfea63c85c82402c9850c724de8fe77d81315b23d58c6ce45527f9fd2e6f9302b0ac466abedbffe8ec35caa5598275a5e420381be42d584901e18d
|
7
|
+
data.tar.gz: 933cbeb33c6c6027b18431edfa5347ffd7c00de1483360f8b067ef9d9ceab1b569861bbac4013567a78c9ecf5f7617535ac42cfea374ef3d04caa442140298fa
|
data/lib/tenable-ruby.rb
CHANGED
@@ -526,11 +526,11 @@ module TenableRuby
|
|
526
526
|
|
527
527
|
# Performs scan with scan policy provided (uuid of policy or policy name).
|
528
528
|
# Name is your scan name and opts is your scan configuration hash
|
529
|
-
# (
|
529
|
+
# (scan_folder is optional - folder where to save the scan (if that folder exists))
|
530
530
|
# (scanner_id is optional - ID of the scanner/cloud scanner you want to run this scan on)
|
531
531
|
#
|
532
532
|
# returns: JSON parsed object with scan info
|
533
|
-
def scan_quick_policy(policyname, name, opts = {},
|
533
|
+
def scan_quick_policy(policyname, name, opts = {}, scan_folder = nil, scanner_id = nil)
|
534
534
|
policies = list_policies['policies']
|
535
535
|
if policies.nil?
|
536
536
|
raise TenableRuby::Error::TenableError, "Tenable API request 'list_policies' responded with 'nil'"
|
@@ -548,16 +548,18 @@ module TenableRuby
|
|
548
548
|
settings.merge!(opts)
|
549
549
|
settings['name'] = name
|
550
550
|
settings['policy_id'] = policy['id']
|
551
|
-
|
551
|
+
if scan_folder.is_a?(Integer)
|
552
|
+
settings['folder_id'] = scan_folder
|
553
|
+
elsif scan_folder.is_a?(String)
|
552
554
|
folders = list_folders['folders']
|
553
555
|
if folders.nil?
|
554
556
|
raise TenableRuby::Error::TenableError, "Tenable API request 'list_folders' responded with 'nil'"
|
555
557
|
end
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
558
|
+
selected_folder = folders.find { |f| f['name'] == scan_folder }
|
559
|
+
if selected_folder
|
560
|
+
settings['folder_id'] = selected_folder['id']
|
561
|
+
else
|
562
|
+
raise TenableRuby::Error::TenableError, "Could not find folder with name #{scan_folder}"
|
561
563
|
end
|
562
564
|
end
|
563
565
|
unless scanner_id.nil?
|
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.
|
4
|
+
version: 0.4.4
|
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-06-
|
11
|
+
date: 2020-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Ruby library for communicating with the tenable.io API.
|