Class: HeimdallTools::CLI

Inherits:
Command show all
Defined in:
lib/heimdall_tools/cli.rb

Instance Method Summary collapse

Methods inherited from Command

dispatch

Instance Method Details

#asff_mapperObject



163
164
165
166
167
168
# File 'lib/heimdall_tools/cli.rb', line 163

def asff_mapper
  hdf = HeimdallTools::ASFFMapper.new(File.read(options[:json]), securityhub_standards_json_array: options[:securityhub_standards].nil? ? nil : options[:securityhub_standards].map { |filename| File.read(filename) }).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#aws_config_mapperObject



117
118
119
120
121
122
# File 'lib/heimdall_tools/cli.rb', line 117

def aws_config_mapper
  hdf = HeimdallTools::AwsConfigMapper.new(options[:custom_mapping]).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#burpsuite_mapperObject



39
40
41
42
# File 'lib/heimdall_tools/cli.rb', line 39

def burpsuite_mapper
  hdf = HeimdallTools::BurpSuiteMapper.new(File.read(options[:xml])).to_hdf
  File.write(options[:output], hdf)
end

#dbprotect_mapperObject



106
107
108
109
110
111
# File 'lib/heimdall_tools/cli.rb', line 106

def dbprotect_mapper
  hdf = HeimdallTools::DBProtectMapper.new(File.read(options[:xml])).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#fortify_mapperObject



9
10
11
12
# File 'lib/heimdall_tools/cli.rb', line 9

def fortify_mapper
  hdf = HeimdallTools::FortifyMapper.new(File.read(options[:fvdl])).to_hdf
  File.write(options[:output], hdf)
end

#jfrog_xray_mapperObject



95
96
97
98
99
100
# File 'lib/heimdall_tools/cli.rb', line 95

def jfrog_xray_mapper
  hdf = HeimdallTools::JfrogXrayMapper.new(File.read(options[:json])).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#nessus_mapperObject



57
58
59
60
61
62
63
64
65
# File 'lib/heimdall_tools/cli.rb', line 57

def nessus_mapper
  hdfs = HeimdallTools::NessusMapper.new(File.read(options[:xml])).to_hdf

  puts "\nHDF Generated:"
  hdfs.each_key do |host|
    File.write("#{options[:output_prefix]}-#{host}.json", hdfs[host])
    puts "#{options[:output_prefix]}-#{host}.json"
  end
end

#netsparker_mapperObject



128
129
130
131
132
133
# File 'lib/heimdall_tools/cli.rb', line 128

def netsparker_mapper
  hdf = HeimdallTools::NetsparkerMapper.new(File.read(options[:xml])).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#nikto_mapperObject



84
85
86
87
88
89
# File 'lib/heimdall_tools/cli.rb', line 84

def nikto_mapper
  hdf = HeimdallTools::NiktoMapper.new(File.read(options[:json])).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#prowler_mapperObject



174
175
176
177
178
179
# File 'lib/heimdall_tools/cli.rb', line 174

def prowler_mapper
  hdf = HeimdallTools::ProwlerMapper.new(File.read(options[:json])).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#sarif_mapperObject



140
141
142
143
144
145
# File 'lib/heimdall_tools/cli.rb', line 140

def sarif_mapper
  hdf = HeimdallTools::SarifMapper.new(File.read(options[:json])).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#scoutsuite_mapperObject



151
152
153
154
155
156
# File 'lib/heimdall_tools/cli.rb', line 151

def scoutsuite_mapper
  hdf = HeimdallTools::ScoutSuiteMapper.new(File.read(options[:javascript])).to_hdf
  File.write(options[:output], hdf)
  puts "\rHDF Generated:\n"
  puts options[:output].to_s
end

#snyk_mapperObject



71
72
73
74
75
76
77
78
# File 'lib/heimdall_tools/cli.rb', line 71

def snyk_mapper
  hdfs = HeimdallTools::SnykMapper.new(File.read(options[:json]), options[:name]).to_hdf
  puts "\rHDF Generated:\n"
  hdfs.each_key do |host|
    File.write("#{options[:output_prefix]}-#{host}.json", hdfs[host])
    puts "#{options[:output_prefix]}-#{host}.json"
  end
end

#sonarqube_mapperObject



30
31
32
33
# File 'lib/heimdall_tools/cli.rb', line 30

def sonarqube_mapper
  hdf = HeimdallTools::SonarQubeMapper.new(options[:name], options[:api_url], options[:auth]).to_hdf
  File.write(options[:output], hdf)
end

#versionObject



182
183
184
# File 'lib/heimdall_tools/cli.rb', line 182

def version
  puts VERSION
end

#xccdf_results_mapperObject



48
49
50
51
# File 'lib/heimdall_tools/cli.rb', line 48

def xccdf_results_mapper
  hdf = HeimdallTools::XCCDFResultsMapper.new(File.read(options[:xml])).to_hdf
  File.write(options[:output], hdf)
end

#zap_mapperObject



19
20
21
22
# File 'lib/heimdall_tools/cli.rb', line 19

def zap_mapper
  hdf = HeimdallTools::ZapMapper.new(File.read(options[:json]), options[:name]).to_hdf
  File.write(options[:output], hdf)
end