class SSHScan::Policy

Policy methods that deal with key exchange, macs, encryption methods, compression methods and more.

Attributes

auth_methods[R]
compression[R]
encryption[R]
kex[R]
macs[R]
name[R]
references[R]
ssh_version[R]

Public Class Methods

from_file(file) click to toggle source

Generate a {SSHScan::Policy} object from YAML file. @param file [String] filepath @return [SSHScan::Policy] new instance with parameters loaded

from YAML file
# File lib/ssh_scan/policy.rb, line 26
def self.from_file(file)
  opts = YAML.load_file(file)
  self.new(opts)
end
from_string(string) click to toggle source

Generate a {SSHScan::Policy} object from YAML string. @param string [String] YAML string @return [SSHScan::Policy] new instance with parameters loaded

from given string
# File lib/ssh_scan/policy.rb, line 51
def self.from_string(string)
  opts = YAML.load(string)
  self.new(opts)
end
new(opts = {}) click to toggle source
# File lib/ssh_scan/policy.rb, line 11
def initialize(opts = {})
  @name = opts['name'] || []
  @kex = opts['kex'] || []
  @macs = opts['macs'] || []
  @encryption = opts['encryption'] || []
  @compression = opts['compression'] || []
  @references = opts['references'] || []
  @auth_methods = opts['auth_methods'] || []
  @ssh_version = opts['ssh_version'] || nil
end

Public Instance Methods

compression_attributes() click to toggle source
# File lib/ssh_scan/policy.rb, line 43
def compression_attributes
  SSHScan.make_attributes(@compression)
end
encryption_attributes() click to toggle source
# File lib/ssh_scan/policy.rb, line 39
def encryption_attributes
  SSHScan.make_attributes(@encryption)
end
kex_attributes() click to toggle source
# File lib/ssh_scan/policy.rb, line 31
def kex_attributes
  SSHScan.make_attributes(@kex)
end
mac_attributes() click to toggle source
# File lib/ssh_scan/policy.rb, line 35
def mac_attributes
  SSHScan.make_attributes(@macs)
end