nexpose 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4397794b70770fea503a7f1613d55350ecdb34e4
4
- data.tar.gz: 94ca3aff891805148565fe6b868ea2c22f847038
3
+ metadata.gz: c5104a1f9ff2537b542608d4c5c8d42418bb42ca
4
+ data.tar.gz: 6c5315d6fde97465c5d1120d15990562b518c91d
5
5
  SHA512:
6
- metadata.gz: 2c274049ae4574d6201fe233221c729aa23ab9a5df81397cfda75601f3f3cd59ce830bd8fd43573879b29ea6f74f7e18bca3fe6ce8da9f2e549c9efb0dbb7e15
7
- data.tar.gz: c2113f68a3c3c06e6c3f070ed9114f8351b7b01948dfa540e12558b6157d2e5eb17a85f2e9276314f7dfb64147ec5b7f7e8651dbc85180b69cf18c84d4524381
6
+ metadata.gz: bfe59dabbed124dbb3f0ab2e40b37bfe1a37252fc7b68c479dc1c0ebad8da7726a40074e20ca6b4cd99b1767a23fab33ac293cfac31f95a59067e10abb404a35
7
+ data.tar.gz: 32b85bfd2c1f0f281a2d02302d8381639af4a728dbd6c3b193b5dc633117edc2470767bbc50c4c09b3ae739bbdd8a714f650a3f1c1f3b4ebdd57def0445b34dd
@@ -163,4 +163,54 @@ module Nexpose
163
163
  MONTHLY_DAY = 'monthly-day'
164
164
  end
165
165
  end
166
+
167
+ class Organization
168
+ attr_accessor :name
169
+ attr_accessor :url
170
+ attr_accessor :primary_contact
171
+ attr_accessor :job_title
172
+ attr_accessor :email
173
+ attr_accessor :telephone
174
+ attr_accessor :address
175
+ attr_accessor :state
176
+ attr_accessor :city
177
+ attr_accessor :zip
178
+ attr_accessor :country
179
+
180
+ def initialize(&block)
181
+ instance_eval &block if block_given?
182
+ end
183
+
184
+ def self.parse(xml)
185
+ new do |org|
186
+ org.name = xml.attributes['name']
187
+ org.url = xml.attributes['url']
188
+ org.primary_contact = xml.attributes['primaryContact']
189
+ org.job_title = xml.attributes['jobTitle']
190
+ org.email = xml.attributes['email']
191
+ org.telephone = xml.attributes['telephone']
192
+ org.address = xml.attributes['businessAddress']
193
+ org.state = xml.attributes['state']
194
+ org.city = xml.attributes['city']
195
+ org.zip = xml.attributes['zip']
196
+ org.country = xml.attributes['country']
197
+ end
198
+ end
199
+
200
+ def as_xml
201
+ xml = REXML::Element.new('Organization')
202
+ xml.add_attribute('name', @name)
203
+ xml.add_attribute('url', @url)
204
+ xml.add_attribute('primaryContact', @primary_contact)
205
+ xml.add_attribute('jobTitle', @job_title)
206
+ xml.add_attribute('email', @email)
207
+ xml.add_attribute('telephone', @telephone)
208
+ xml.add_attribute('businessAddress', @address)
209
+ xml.add_attribute('state', @state)
210
+ xml.add_attribute('city', @city)
211
+ xml.add_attribute('zip', @zip)
212
+ xml.add_attribute('country', @country)
213
+ xml
214
+ end
215
+ end
166
216
  end
data/lib/nexpose/site.rb CHANGED
@@ -113,6 +113,10 @@ module Nexpose
113
113
  # @see SyslogAlert
114
114
  attr_accessor :alerts
115
115
 
116
+ # Information about the organization that this site belongs to.
117
+ # Used by some reports.
118
+ attr_accessor :organization
119
+
116
120
  # [Array] List of user IDs for users who have access to the site.
117
121
  attr_accessor :users
118
122
 
@@ -272,6 +276,8 @@ module Nexpose
272
276
  xml.add_element(elem)
273
277
  end
274
278
 
279
+ xml.add_element(@organization.as_xml) if @organization
280
+
275
281
  elem = REXML::Element.new('Hosts')
276
282
  @assets.each { |a| elem.add_element(a.as_xml) }
277
283
  xml.add_element(elem)
@@ -328,6 +334,10 @@ module Nexpose
328
334
  site.users << user.attributes['id'].to_i
329
335
  end
330
336
 
337
+ s.elements.each('Organization') do |org|
338
+ site.organization = Organization.parse(org)
339
+ end
340
+
331
341
  s.elements.each('Hosts/range') do |r|
332
342
  site.assets << IPRange.new(r.attributes['from'], r.attributes['to'])
333
343
  end
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: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - HD Moore
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-10 00:00:00.000000000 Z
13
+ date: 2014-03-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: librex