Class: Vtk::Commands::Scan::Credentials

Inherits:
Vtk::Command show all
Defined in:
lib/vtk/commands/scan/credentials.rb

Overview

Audit credentials that may have been accessed by Shai-Hulud malware

Constant Summary collapse

OPTION_FLAGS =
{
  verbose: '--verbose',
  json: '--json'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Vtk::Command

#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which

Constructor Details

#initialize(options) ⇒ Credentials

Returns a new instance of Credentials.



13
14
15
16
# File 'lib/vtk/commands/scan/credentials.rb', line 13

def initialize(options)
  @options = options
  super()
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/vtk/commands/scan/credentials.rb', line 11

def options
  @options
end

Instance Method Details

#execute(output: $stdout) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/vtk/commands/scan/credentials.rb', line 23

def execute(output: $stdout)
  @output = output

  script_path, gem_root = find_script
  return script_not_found(output, gem_root) unless script_path

  run_script(script_path)
end