nexpose 2.2.0 → 2.3.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/nexpose/global_settings.rb +22 -0
- data/lib/nexpose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b700cb98e385100a28c8b58f7952a9d26644c24a
|
4
|
+
data.tar.gz: 8595c6416a6b61a6855e2fcc19f3427e9ccd1301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd9cadc253fd186e47dd8bcde7a653c3926759e401e8a5a79babf869da3c2f434ab7ffecb51354f668c17626e82f0e21233068dd082d15305632ad69c4fed4f8
|
7
|
+
data.tar.gz: 57e46c5e4cc26e7ed85057e3081556776f3320dfe1dd18f1ab7544966112b878df6190736077ab0b4ce3143c0fa2f90183b570f19c61a435b61c8a566ad170f9
|
@@ -6,6 +6,9 @@ module Nexpose
|
|
6
6
|
# all sites.
|
7
7
|
attr_accessor :asset_exclusions
|
8
8
|
|
9
|
+
# Whether asset linking in enabled.
|
10
|
+
attr_accessor :asset_linking
|
11
|
+
|
9
12
|
# Whether control scanning in enabled. A feature tied to ControlsInsight
|
10
13
|
# integration.
|
11
14
|
attr_accessor :control_scanning
|
@@ -18,6 +21,7 @@ module Nexpose
|
|
18
21
|
def initialize(xml)
|
19
22
|
@xml = xml
|
20
23
|
|
24
|
+
@asset_linking = parse_asset_linking_from_xml(xml)
|
21
25
|
@asset_exclusions = HostOrIP.parse(xml)
|
22
26
|
@control_scanning = parse_control_scanning_from_xml(xml)
|
23
27
|
end
|
@@ -41,6 +45,7 @@ module Nexpose
|
|
41
45
|
|
42
46
|
replace_exclusions(xml, asset_exclusions)
|
43
47
|
add_control_scanning_to_xml(xml, control_scanning)
|
48
|
+
add_asset_linking_to_xml(xml, asset_linking)
|
44
49
|
|
45
50
|
response = AJAX.post(nsc, '/data/admin/global-settings', xml)
|
46
51
|
XMLUtils.success? response
|
@@ -115,5 +120,22 @@ module Nexpose
|
|
115
120
|
'enabled' => enabled ? '1' : '0')
|
116
121
|
end
|
117
122
|
end
|
123
|
+
|
124
|
+
# Internal method for parsing XML for whether asset linking in enabled.
|
125
|
+
def parse_asset_linking_from_xml(xml)
|
126
|
+
enabled = true
|
127
|
+
if elem = REXML::XPath.first(xml, '//AssetCorrelation[@enabled]')
|
128
|
+
enabled = elem.attribute('enabled').value.to_i == 1
|
129
|
+
end
|
130
|
+
enabled
|
131
|
+
end
|
132
|
+
|
133
|
+
# Internal method for updating asset linking before saving.
|
134
|
+
def add_asset_linking_to_xml(xml, enabled)
|
135
|
+
elem = REXML::XPath.first(xml, '//AssetCorrelation')
|
136
|
+
return nil unless elem
|
137
|
+
|
138
|
+
elem.attributes['enabled'] = enabled ? '1' : '0'
|
139
|
+
end
|
118
140
|
end
|
119
141
|
end
|
data/lib/nexpose/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexpose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HD Moore
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2015-12-
|
16
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rex
|