Skip to content

Commit

Permalink
Merge pull request #91 from mitre/remove_verbose_parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
rx294 authored Apr 30, 2021
2 parents cca97c9 + 3258fca commit bf97131
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 49 deletions.
3 changes: 1 addition & 2 deletions lib/heimdall_tools/aws_config_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#
module HeimdallTools
class AwsConfigMapper
def initialize(custom_mapping, endpoint = nil, verbose = false)
@verbose = verbose
def initialize(custom_mapping, endpoint = nil)
@default_mapping = get_rule_mapping(AWS_CONFIG_MAPPING_FILE)
@custom_mapping = custom_mapping.nil? ? {} : get_rule_mapping(custom_mapping)
if endpoint.nil?
Expand Down
3 changes: 1 addition & 2 deletions lib/heimdall_tools/burpsuite_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

module HeimdallTools
class BurpSuiteMapper
def initialize(burps_xml, _name = nil, verbose = false)
def initialize(burps_xml, _name = nil)
@burps_xml = burps_xml
@verbose = verbose

begin
@cwe_nist_mapping = parse_mapper
Expand Down
11 changes: 0 additions & 11 deletions lib/heimdall_tools/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class CLI < Command
long_desc Help.text(:fortify_mapper)
option :fvdl, required: true, aliases: '-f'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def fortify_mapper
hdf = HeimdallTools::FortifyMapper.new(File.read(options[:fvdl])).to_hdf
File.write(options[:output], hdf)
Expand All @@ -17,7 +16,6 @@ def fortify_mapper
option :json, required: true, aliases: '-j'
option :name, required: true, aliases: '-n'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def zap_mapper
hdf = HeimdallTools::ZapMapper.new(File.read(options[:json]), options[:name]).to_hdf
File.write(options[:output], hdf)
Expand All @@ -29,7 +27,6 @@ def zap_mapper
option :api_url, required: true, aliases: '-u'
option :auth, type: :string, required: false
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def sonarqube_mapper
hdf = HeimdallTools::SonarQubeMapper.new(options[:name], options[:api_url], options[:auth]).to_hdf
File.write(options[:output], hdf)
Expand All @@ -39,7 +36,6 @@ def sonarqube_mapper
long_desc Help.text(:burpsuite_mapper)
option :xml, required: true, aliases: '-x'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def burpsuite_mapper
hdf = HeimdallTools::BurpSuiteMapper.new(File.read(options[:xml])).to_hdf
File.write(options[:output], hdf)
Expand All @@ -49,7 +45,6 @@ def burpsuite_mapper
long_desc Help.text(:nessus_mapper)
option :xml, required: true, aliases: '-x'
option :output_prefix, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def nessus_mapper
hdfs = HeimdallTools::NessusMapper.new(File.read(options[:xml])).to_hdf

Expand All @@ -64,7 +59,6 @@ def nessus_mapper
long_desc Help.text(:snyk_mapper)
option :json, required: true, aliases: '-j'
option :output_prefix, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def snyk_mapper
hdfs = HeimdallTools::SnykMapper.new(File.read(options[:json]), options[:name]).to_hdf
puts "\r\HDF Generated:\n"
Expand All @@ -78,7 +72,6 @@ def snyk_mapper
long_desc Help.text(:nikto_mapper)
option :json, required: true, aliases: '-j'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def nikto_mapper
hdf = HeimdallTools::NiktoMapper.new(File.read(options[:json])).to_hdf
File.write(options[:output], hdf)
Expand All @@ -90,7 +83,6 @@ def nikto_mapper
long_desc Help.text(:jfrog_xray_mapper)
option :json, required: true, aliases: '-j'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def jfrog_xray_mapper
hdf = HeimdallTools::JfrogXrayMapper.new(File.read(options[:json])).to_hdf
File.write(options[:output], hdf)
Expand All @@ -102,7 +94,6 @@ def jfrog_xray_mapper
long_desc Help.text(:dbprotect_mapper)
option :xml, required: true, aliases: '-x'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def dbprotect_mapper
hdf = HeimdallTools::DBProtectMapper.new(File.read(options[:xml])).to_hdf
File.write(options[:output], hdf)
Expand All @@ -114,7 +105,6 @@ def dbprotect_mapper
long_desc Help.text(:aws_config_mapper)
# option :custom_mapping, required: false, aliases: '-m'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def aws_config_mapper
hdf = HeimdallTools::AwsConfigMapper.new(options[:custom_mapping]).to_hdf
File.write(options[:output], hdf)
Expand All @@ -126,7 +116,6 @@ def aws_config_mapper
long_desc Help.text(:netsparker_mapper)
option :xml, required: true, aliases: '-x'
option :output, required: true, aliases: '-o'
option :verbose, type: :boolean, aliases: '-V'
def netsparker_mapper
hdf = HeimdallTools::NetsparkerMapper.new(File.read(options[:xml])).to_hdf
File.write(options[:output], hdf)
Expand Down
14 changes: 5 additions & 9 deletions lib/heimdall_tools/dbprotect_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@

module HeimdallTools
class DBProtectMapper
def initialize(xml, _name = nil, verbose = false)
@verbose = verbose

begin
dataset = xml_to_hash(xml)
@entries = compile_findings(dataset['dataset'])
rescue StandardError => e
raise "Invalid DBProtect XML file provided Exception: #{e};\nNote that XML must be of kind `Check Results Details`."
end
def initialize(xml, _name = nil)
dataset = xml_to_hash(xml)
@entries = compile_findings(dataset['dataset'])
rescue StandardError => e
raise "Invalid DBProtect XML file provided Exception: #{e};\nNote that XML must be of kind `Check Results Details`."
end

def to_hdf
Expand Down
3 changes: 1 addition & 2 deletions lib/heimdall_tools/fortify_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

module HeimdallTools
class FortifyMapper
def initialize(fvdl, verbose = false)
def initialize(fvdl)
@fvdl = fvdl
@verbose = verbose

begin
data = xml_to_hash(fvdl)
Expand Down
3 changes: 1 addition & 2 deletions lib/heimdall_tools/jfrog_xray_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@

module HeimdallTools
class JfrogXrayMapper
def initialize(xray_json, _name = nil, verbose = false)
def initialize(xray_json, _name = nil)
@xray_json = xray_json
@verbose = verbose

begin
@cwe_nist_mapping = parse_mapper
Expand Down
3 changes: 1 addition & 2 deletions lib/heimdall_tools/nessus_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@

module HeimdallTools
class NessusMapper
def initialize(nessus_xml, verbose = false)
def initialize(nessus_xml)
@nessus_xml = nessus_xml
@verbose = verbose
read_cci_xml
begin
@cwe_nist_mapping = parse_mapper
Expand Down
22 changes: 9 additions & 13 deletions lib/heimdall_tools/netsparker_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@

module HeimdallTools
class NetsparkerMapper
def initialize(xml, _name = nil, verbose = false)
@verbose = verbose

begin
@cwe_nist_mapping = parse_mapper(CWE_NIST_MAPPING_FILE)
@owasp_nist_mapping = parse_mapper(OWASP_NIST_MAPPING_FILE)
data = xml_to_hash(xml)

@vulnerabilities = data['netsparker-enterprise']['vulnerabilities']['vulnerability']
@scan_info = data['netsparker-enterprise']['target']
rescue StandardError => e
raise "Invalid Netsparker XML file provided Exception: #{e}"
end
def initialize(xml, _name = nil)
@cwe_nist_mapping = parse_mapper(CWE_NIST_MAPPING_FILE)
@owasp_nist_mapping = parse_mapper(OWASP_NIST_MAPPING_FILE)
data = xml_to_hash(xml)

@vulnerabilities = data['netsparker-enterprise']['vulnerabilities']['vulnerability']
@scan_info = data['netsparker-enterprise']['target']
rescue StandardError => e
raise "Invalid Netsparker XML file provided Exception: #{e}"
end

def to_hdf
Expand Down
3 changes: 1 addition & 2 deletions lib/heimdall_tools/nikto_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@

module HeimdallTools
class NiktoMapper
def initialize(nikto_json, _name = nil, verbose = false)
def initialize(nikto_json, _name = nil)
@nikto_json = nikto_json
@verbose = verbose

begin
@nikto_nist_mapping = parse_mapper
Expand Down
3 changes: 1 addition & 2 deletions lib/heimdall_tools/snyk_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@

module HeimdallTools
class SnykMapper
def initialize(synk_json, _name = nil, verbose = false)
def initialize(synk_json, _name = nil)
@synk_json = synk_json
@verbose = verbose

begin
@cwe_nist_mapping = parse_mapper
Expand Down
3 changes: 1 addition & 2 deletions lib/heimdall_tools/zap_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@

module HeimdallTools
class ZapMapper
def initialize(zap_json, name, verbose = false)
def initialize(zap_json, name)
@zap_json = zap_json
@verbose = verbose

begin
data = JSON.parse(zap_json, symbolize_names: true)
Expand Down

0 comments on commit bf97131

Please sign in to comment.