module Risu::Templates::ScanHelper
Public Instance Methods
authenticated_count()
click to toggle source
TODO doc
# File lib/risu/base/scan_helper.rb, line 50 def authenticated_count count = {} count["auth"] = 0 count["unauth"] = 0 Item.where(:plugin_id => 19506).each do |item| scan_info = scan_info_to_hash (item.plugin_output) auth = scan_info["credentialed_checks"] if auth =~ /yes/ count["auth"] = count["auth"] + 1 else count["unauth"] = count["unauth"] + 1 end end return count end
scan_info_to_hash(plugin_output)
click to toggle source
TODO doc
# File lib/risu/base/scan_helper.rb, line 27 def scan_info_to_hash plugin_output scan_info = {} plugin_output.split("\n").each do |line| a = line.split(":") if a.size != 2 next end key = a[0].strip.downcase value = a[1].strip.downcase key = key.gsub(" ", "_") scan_info[key] = value end return scan_info end