Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexpose::Site instance methods remove_included_ip_range and remove_included_asset not working #285

Open
asadasivan opened this issue Aug 22, 2017 · 1 comment

Comments

@asadasivan
Copy link

asadasivan commented Aug 22, 2017

#Nexpose::Site instance methods remove_included_ip_range and remove_included_asset is not working. remove_included_ip_range does not remove if the range of IP is given. remove_included_asset does not delete asset if the asset is part of a range. For example if you have a range (10.10.28.33 - 10.10.28.36) and if you use remove_included_asset method to delete "10.10.28.35" it doesn't delete. It works if the IP is single IP i.e. not a range.

Steps to Reproduce (for bugs)

  1. Create a site in Nexpose console and then add the following as defined assets.
    Ex: 10.10.28.13 - 10.10.28.16, 10.10.28.33 - 10.10.28.36
  2. Use the site.remove_included_asset method to delete 10.10.28.14 . The issue is it will not delete the IP since it is a range.
  3. Use site.remove_included_ip_range(10.10.28.33, 10.10.28.36) to delete the range. The issue is it will not delete the range.

Ruby code that reproduces the issue:

  sites.each do |site|
    if site.name  == "test-site"
      siteObj = Nexpose::Site.load(@nsc, site.id)
      siteObj.remove_included_ip_range("10.10.27.23", "10.10.27.24")
      siteObj.remove_included_asset("10.10.28.14")
    end
  end

Your Environment

  • Nexpose gem version: nexpose (6.1.1)
  • Ruby version: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]
  • Operating System and version:
    ProductName: Mac OS X
    ProductVersion: 10.11.6
    BuildVersion: 15G1611
  • Nexpose Console Version: 6.4.51
@sgreen-r7
Copy link
Contributor

sgreen-r7 commented Aug 22, 2017

@asadasivan thanks for creating the issue.

Yeah, this method is a bit annoying, since it doesn't just work. @gschneider-r7 and I will work something out to figure out the best way to fix this. We had a PR while back that we didn't get around to implementing and trying to fix how the gem deals with IPs and IPRanges.

Your issue actually gives us another straight forward test case to make sure any improvements we make cover your use case. We can make it a priority now, and try to push out an update soon.

Thanks again, and we'll keep this issue updated with our plans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants