Method: InspecPlugins::InspecToolsPlugin::CliCommand#generate_ckl_metadata

Defined in:
lib/inspec_tools/plugin_cli.rb

#generate_ckl_metadataObject



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/inspec_tools/plugin_cli.rb', line 162

def 
   = {}

  ['stigid'] = ask('STID ID: ')
  ['role'] = ask('Role: ')
  ['type'] = ask('Type: ')
  ['hostname'] = ask('Hostname: ')
  ['ip'] = ask('IP Address: ')
  ['mac'] = ask('MAC Address: ')
  ['fqdn'] = ask('FQDN: ')
  ['tech_area'] = ask('Tech Area: ')
  ['target_key'] = ask('Target Key: ')
  ['web_or_database'] = ask('Web or Database: ')
  ['web_db_site'] = ask('Web DB Site: ')
  ['web_db_instance'] = ask('Web DB Instance: ')

  .delete_if { |_key, value| value.empty? }
  File.open('metadata.json', 'w') do |f|
    f.write(.to_json)
  end
end