Skip to content

Commit

Permalink
Merge pull request #303 from rapid7/report_default_filters
Browse files Browse the repository at this point in the history
Add a method to add common vuln status filters to report configs
  • Loading branch information
gschneider-r7 authored Nov 1, 2017
2 parents 5c4022e + b211096 commit f7403f8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/nexpose/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ def add_filter(type, id)
filters << Filter.new(type, id)
end

# Add the common vulnerability status filters as used by the UI for export
# and jasper report templates (the default filters). Recommended for reports
# that do not require 'not vulnerable' results to be included. The following
# statuses are added: vulnerable-exploted, vulnerable-version, and potential.
def add_common_vuln_status_filters
['vulnerable-exploited', 'vulnerable-version', 'potential'].each do |vuln_status|
filters << Filter.new('vuln-status', vuln_status)
end
end

def to_xml
xml = %(<AdhocReportConfig format="#{@format}" template-id="#{@template_id}")
xml << %( owner="#{@owner}") if @owner
Expand Down

0 comments on commit f7403f8

Please sign in to comment.