-
Notifications
You must be signed in to change notification settings - Fork 103
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
Delete assets from sites if there is no deviceid #148
Comments
By any chance is your site an IP range and the asset you delete in that range? for example
|
Without looking, I suspect the logic for removing an IP doesn't check in ranges and thus is a no-op if the IP is part of a range. |
Hello, I run some tests and confirmed the suspicion of @gschneider-r7:
I tried to delete 4 IPs
From the logs:
Effective result is that only 172.16.0.5 (the IP NOT within range) got deleted. Do you have a timeline for when this bug could be fixed? Cheers! |
@98231jssa We're working on it as we speak - aiming to have something ready by the end of the week. |
@sgreen-r7 @asalazar-r7 thanks! |
I started looking into this a bit. @asalazar-r7 @sgreen-r7 here's my work so far: master...erran:bug/148-allow-the-deletion-of-assets-in-ranges I've added new abilities to test whether an asset/IP is included (by string). We should be able to leverage this in the |
I've added more changes and the tests that I wrote to reproduce the issue here are now passing. @sgreen-r7 Can you check out my changes? |
@98231jssa I've been discussing this internally since I felt a bit uncomfortable with the fix I wrote this morning. One solution we came up with using exclusions instead. Asset exclusion is a feature we created to remove the need of removing a single asset from a site (created via a range). What that means for you is instead of calling If you go through my other solution you can see that we need to delete each range and split it into subsets which are then converted back into ranges. |
@98231jssa - when you get a chance, can you let us know if @erran-r7 suggested solution would work? Using The holistic fix we're trying to put in place has proved to not be as straight forward as I originally estimated. Either way, we're still working on updating |
Hi, I'm back and can run all the tests required. |
@98231jssa The 1.0 gem release is tied to the last version of nexpose and is not backwards compatible. So if you took that nexpose update (last week) then trying the 1.0 version of the gem is a good idea. A lot changed for that update so if i'm remembering correctly - it should be fixed in a different way. Give 1.0 a try if you have an updated Nexpose console, otherwise - we can try that branch which has the fix for the 0.9.x version of them gem. Let me know if you need some info on working off a branch of the gem. |
@98231jssa - anything new to report? |
At the moment I only have the production environment to work on, where if I update to v1.0 I break existing scripts, so I cannot test it. Cheers and thanks again |
Hi,
I'm managing an instance of nexpose with about 100K assets, split in quite some groups, and I have frequently the need to delete/add/tag assets in the various sites so I do it via the ruby API.
Take this example code:
f I have an assetID the device gets always deleted properly, but the remove_asset function doesn't work as expected when the asset doesn't have an ID.
The behaviour I observe is that even if I issue a remove_asset on the site and save it, the site definition still contains the asset (in the site.assets array).
My biggest problem is that when I delete an asset from a site I must be sure it doesn't get scanned in the next discovery scan.
Is my code wrong or is it a bug?
You can cross-related this with internal support case 00122399 for more details.
The text was updated successfully, but these errors were encountered: