-
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
Return nexpose_id via API using vulnid #210
Comments
How are you intending to look up the vulnerability ID? What would you be passing in as params to find it? |
Via the NXID field in ticket creation, I already have the device_id and vuln_id. I would simply provide the numerical vuln_id from the ticket as a parameter. Sorry, should have clarified that. |
The value corresponds as so - https://127.0.0.1:3780/vulnerability/vuln-summary.jsp?vulnid=29225 Normally, I would provide the devid and vulnid, but if devid is Nil, it throws the error. |
I think I'm still not quite following, at what point are you getting the numeric vuln ID when using the API? The natural ID should always be present in any responses that provide vulnerabilities. |
When generating tickets using nexpose_ticketing gem, an NXID is generated. It looks something like this: NXID: 187d20000d29225 187 = site number Querying the device using the following code and then passing the id for template creation:
In this case, the id should be 'apache-httpd-cve-2012-0883' However, the vulnerability is reporting as no longer existent. Thus, when passing the nil id, the template can't be created. This is the reason for the exception prior. If I could just do something like |
I see now. Unfortunately it doesn't look like there is a trivial way to do this currently through existing APIs in Nexpose. What might work is to do a one-time SQL query export of all vuln IDs and vuln natural IDs, so you can map them quickly offline. You'd have to re-generate weekly to keep up with content updates. You could probably even store it in a sqlite DB for potentially faster lookup (vs searching a csv file). |
Is it possible for this functionality to be included in the future? It looks like passing the site parameter to the sql query greatly decreases the processing time. I will do that for now. |
I don't think we'll add an API for that to Nexpose since the use case is limited. I think it would make more sense to have the ticketing gem put the natural ID somewhere and not force users to rely on numeric IDs that are unique to each console. |
I opened rapid7/nexpose_ticketing#8 to help move along any changes there (if necessary). I'm closing this issue since IMO the ticketing gem should be providing the natural IDs. |
Hi,
I would like to see if the ability exists or can be easily created to pull the nexpose_id via API just in general. The SQL query is incredibly slow
SELECT nexpose_id from dim_vulnerability where vulnerability_id = 'xxx'
I am aware that #list_device_vulns exists. However, if the vulnerability was resolved prior, this causes my code to throw an exception or force a full scan.
This would help resolve 2 major bugs in our code deployment. Thanks!
Here is some example code.
The text was updated successfully, but these errors were encountered: