class CMSScanner::Finders::BaseFinders
Base class container for the Finders
(i.e IndependentFinders
etc)
Public Instance Methods
Source
# File lib/cms_scanner/finders/base_finders.rb, line 8 def findings @findings ||= NS::Finders::Findings.new end
@return [ Findings
]
Source
# File lib/cms_scanner/finders/base_finders.rb, line 13 def run; end
Should be implemented in child classes
Protected Instance Methods
Source
# File lib/cms_scanner/finders/base_finders.rb, line 40 def filter_findings findings end
Allow child classes to filter the findings, such as return the best one or remove the low confidence ones.
@return [ Findings
]
Source
# File lib/cms_scanner/finders/base_finders.rb, line 30 def run_finder(finder, symbol, opts) Array(finder.send(symbol, opts.merge(found: findings))).compact.each do |found| findings << found end end
@param [ CMSScanner::Finders::Finder
] finder @param [ Symbol ] symbol See return values of symbols_from_mode
@param [ Hash ] opts
Source
# File lib/cms_scanner/finders/base_finders.rb, line 19 def symbols_from_mode(mode) symbols = %i[passive aggressive] return symbols if mode.nil? || mode == :mixed symbols.include?(mode) ? Array(mode) : [] end
@param [ Symbol ] mode :mixed, :passive or :aggressive @return [ Array<Symbol> ] The symbols to call for the mode