I’m currently looking at using the HTML reports to generate a series of charts based off of the Issues (not notes) imported from Nexpose. The idea is to take these charts and simply add them into the AdvancedWord report. I have the example working where the report is based on the notes, however, I’m unable to find out if I can do something similar with the issues.
This worked great, I’ve included the code below that generates the charts using the imported issues instead of the notes below. Can you tell me if the Tags are also available to these reports?
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script type="text/javascript">
// this hash will map note id's to CSS classes associated with their
// CVSS score
var noteClassName = {};
<%# Create a Ruby hash mapping each note to a risk level %>
<% sorted = { :low => [], :medium => [], :high => []} %>
<% issues.each do |issue|;
cvss = issue.fields['Severity'].to_f;
case cvss
when 0.0..3.9
sorted[:low] << issue
when 4.0..6.9
sorted[:medium] << issue
else
sorted[:high] << issue
end
end %>
Yes, you can access them using the #tag method of each Issue instance. Keep in mind it will return an array (even though each Issue, can only have one Tag). Something like this should work: