Class: TLSmap::CLI::Extended

Inherits:
App::Extended show all
Defined in:
lib/tls_map/cli/cli.rb

Overview

Offline version of App::Extended

Constant Summary collapse

INTEGRITY =

sha2-256

'bed565db6cc8da400c51bcc17107b68bce86f2c7bdf2495d43633679a295d0aa'

Constants inherited from App::Extended

App::Extended::API_ROOT, App::Extended::DICO, App::Extended::ROOT, App::Extended::SECURITY_LEVEL, App::Extended::TECH_DATA, App::Extended::VULN_DATA, App::Extended::VULN_SEVERITY

Instance Attribute Summary

Attributes inherited from App::Extended

#enhanced_data

Instance Method Summary collapse

Methods inherited from App::Extended

#enhance_all, #find_vuln, #translate_acronym

Constructor Details

#initialize(force = false) ⇒ Extended

Load and parse data from marshalized hash (data/extended.marshal). It must match the integrity check for security purpose.

Parameters:

  • force (Boolean) (defaults to: false)

    Force parsing even if integrity check failed (DANGEROUS, may result in command execution vulnerability)



65
66
67
68
69
70
71
# File 'lib/tls_map/cli/cli.rb', line 65

def initialize(force = false)
  @storage_location = 'data/'
  @extended_path = absolute_db_path('extended.marshal')
  @enhanced_data = {}
  extended_exists?
  parse(force)
end

Instance Method Details

#extend(iana_name) ⇒ Object

Same as App::Extended but loading data from offline database, so there is no caching option.

See Also:



108
109
110
# File 'lib/tls_map/cli/cli.rb', line 108

def extend(iana_name)
  @enhanced_data[iana_name]
end

#updateObject



99
100
101
102
103
# File 'lib/tls_map/cli/cli.rb', line 99

def update
  tmext = TLSmap::App::Extended.new
  tmext.enhance_all
  File.write(@extended_path, Marshal.dump(tmext.enhanced_data))
end