rapid7 / nexpose-client

DEPRECATED: Rapid7 Nexpose API client library written in Ruby
https://www.rapid7.com/
BSD 3-Clause "New" or "Revised" License
150 stars 103 forks source link

FQDN not recognized by util.rb/convert with Ruby 2.7.2 #331

Closed aledean closed 3 years ago

aledean commented 3 years ago

FQDN not recognized by util.rb/convert with Ruby 2.7.2 -- Similar issue as #325 but the update to util.rb is still throwing error. -- I tried with ruby 2.6.3 as well and error is still thrown.

Expected Behavior

Site data that contains FQDN and IPs is loaded with no issues. These sites are used to scan externally facing assets.

Current Behavior

Sites that assets include FQDN return error

Steps to Reproduce (for bugs)

Load site data with assets listed as FQDN with Ruby 2.7.2 (or 2.6.3)

Ruby code that reproduces the issue: Below is just a segment of the script where it fails.

puts "Enter string to filter sites based on (ex. STG, DEV) or full site name: " userSearch = gets.chomp

if sites.length == 0 puts "There are no active sites" else sites.each do |site| if site.name.include? userSearch s = Site.load(nsc, site.id) ##this is where it fails if the site has assets defined as FQDN puts "Site ID: #{site.id}" puts "Site Name: #{site.name}" puts "Template ID: #{s.scan_template_id}" puts "Template Name: #{s.scan_template_name}" puts "Schedule: #{s.schedules}" puts "\n" end end

Context

I am trying to be able to update sites templates, scan schedules, etc and a variety of our sites have FQDNs in their asset listings. So for sites that don't have this it works fine, but whenever one I filter on does, it causes an error.

Your Environment

gschneider-r7 commented 3 years ago

I just released version 7.3.0 to catch up all the changes since 7.2.1. I think this issue should be fixed with that since it been sitting on the master branch for a while.