Skip to content

Commit

Permalink
Add a method to add common vuln status filters to report configs
Browse files Browse the repository at this point in the history
This is a convenience method for creating reports that should behave the
same as reports created in the web UI.
  • Loading branch information
gschneider-r7 committed Oct 3, 2017
1 parent 5c4022e commit efb262a
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 most
# report templates (defaults). Recommended for reports that do not require
# 'not vlunerable' 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 efb262a

Please sign in to comment.