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

#aws_config_mapperObject

[View source]

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 "\r\HDF Generated:\n"
  puts options[:output].to_s
end

#burpsuite_mapperObject

[View source]

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

[View source]

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 "\r\HDF Generated:\n"
  puts options[:output].to_s
end

#fortify_mapperObject

[View source]

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

[View source]

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 "\r\HDF Generated:\n"
  puts options[:output].to_s
end

#nessus_mapperObject

[View source]

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

[View source]

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 "\r\HDF Generated:\n"
  puts options[:output].to_s
end

#nikto_mapperObject

[View source]

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 "\r\HDF Generated:\n"
  puts options[:output].to_s
end

#sarif_mapperObject

[View source]

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 "\r\HDF Generated:\n"
  puts options[:output].to_s
end

#scoutsuite_mapperObject

[View source]

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

[View source]

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 "\r\HDF 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

[View source]

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

[View source]

159
160
161
# File 'lib/heimdall_tools/cli.rb', line 159

def version
  puts VERSION
end

#xccdf_results_mapperObject

[View source]

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

[View source]

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