Comments (12)
Could you show me the code you are using to generate the report? Nothing changed afaik. I can try to reproduce.
from nexpose-client.
def self.generate_and_save(site_list, nsc)
site_list=Nexty::Sites.load_from_file(site_list)
site_list_score = 0
report = Nexpose::ReportAdHoc.new(nsc, 'report-card', 'raw-xml')
site_list.each do |site|
s = nsc.find_site_by_name_2(site) || []
if ! s[:site_id].nil?
site_config = Nexpose::SiteConfig.new
site_config.getSiteConfig(nsc, s[:site_id])
scan_history = nsc.site_scan_history(s[:site_id])
scan_history.sort! { |a,b| b[:start_time] <=> a[:start_time]}
scan_history.take(4).each do |scan|
report.addFilter('scan', scan[:scan_id])
end
end
end
file_name = "export_#{Time.now.strftime("%Y%m%d%H%M%s")}.csv"
file = File.open(file_name, "w")
file.write(report.generate)
file.close
file_name
end
I added also some prints in my nexpose-client report and it seems that response content type is different if format is CSV rather than RAW-XML. It happened starting from today after the Nexpose automatic product update. So nothing changed in API nor in my personal code... only Nexpose is :(
from nexpose-client.
You are correct, this was an oversight of the engineering team. The response for CSV has changed. I will be working today to fix this in our various API wrappers, should have a fixed version this evening. Very sorry about this and any inconvenience it has caused. We are looking into better testing requirements to catch this before releases.
Will also be getting your other pull request checked in with the Nexpose::Misc changes, stay tuned.
from nexpose-client.
Ok, an update. It appears that the way templates and CSV reports interact have changed with the last release. For CSV reports, you need to create a template of type 'data' rather than a 'document' type report. Type 'document' templates will no longer work with CSV reports.
Please create a template of type 'data' rather than type 'document' in the UI and see if this fixes your issue. I am still looking into this reporting code because, to be honest, a lot of it could have been written better. This also could have been better communicated through the release notes, even I wasn't aware this change was made. Oh well, c'est la vie.
from nexpose-client.
To reinforce this, if you look in nsc.log in your nexpose installation directory, you will see an error similar to this:
2012-03-21T20:11:22 [INFO] [Thread: Generating report Adhoc_1332360682634 (default:838)] CSVReportExporter exporting to /opt/rapid7/nexpose/nsc/htroot/reports/00000346/00000345
2012-03-21T20:11:22 [INFO] [Thread: Generating report Adhoc_1332360682634 (default:838)] Failed to generate report: Adhoc_1332360682634
com.rapid7.nexpose.report.ReportException: Invalid report template. Template type should be 'data'.
at com.rapid7.nexpose.report.CSVReportExporter.export(Unknown Source) ~[nxshared.jar:na]
at com.rapid7.nexpose.report.ReportCreationContext.generateReports(Unknown Source) [nxshared.jar:na]
at com.rapid7.nexpose.report.service.ReportService.generateReport(Unknown Source) [nxshared.jar:na]
at com.rapid7.nexpose.report.service.ReportGenerationThread.run(Unknown Source) [nxshared.jar:na]
from nexpose-client.
This also should only affect CSV reports.
from nexpose-client.
Perry, any update on this topic?
from nexpose-client.
No news guys?
from nexpose-client.
Hi, sorry I just saw this email. Was the above information not correct? After creating a template for the CSV reports you are still getting improper reports?
from nexpose-client.
Brandon (sorry I misunderstood your name in the nick), I mean... there are no changes in the API call that I must wait for?
By the way I hacked SiteDeviceListing class and I'll submit a pull request but I want to make sure I can take the repo as reference :)
from nexpose-client.
No, the API will not change, you need to specify a template that is specifically for a CSV report. You will need to create this through the UI.
from nexpose-client.
That's fine Brandon, you're the boss so if you tell API won't change I'll check the template way. Thank you indeed.
from nexpose-client.
Related Issues (20)
- XML::VulnerabilityDetail/Complete API missing an instances value for vulnerabilities HOT 2
- Credentials failure after using Site.copy HOT 3
- Unknown SSH Handshake error HOT 5
- Api call to Generate Scan Engine Shared Secret HOT 1
- Is there any 2.1 API(i.e json support one) to get device vulnerability details ? HOT 3
- list_vuln_exceptions returns API error HOT 9
- APIError HTTP 500 when updating one tag with existing search_criteria HOT 3
- No data returned for vulnerability id and asset id in list_vuln_exceptions
- user.save(connection) causes a Null Pointer Exception HOT 1
- No method to save search criteria for a dynamic site? HOT 4
- Connection object `scan_devices` method failure on Global assets HOT 4
- api/3/assets/{id}/software returns HTTP.500 error HOT 2
- OpenSSL certificate verify failed HOT 7
- [QUESTION] How to generate Shared Secret via RESTful API? HOT 2
- job failure in servicenow HOT 1
- Login Failed when update nexpose-client 2.0.2 to 7.2.1 HOT 2
- Hostname not recognized by util.rb/convert with Ruby 2.6.3 HOT 2
- Stuck on maintenance mode page HOT 1
- Scan engine Issue HOT 1
- FQDN not recognized by util.rb/convert with Ruby 2.7.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nexpose-client.