Top Level Namespace

Includes:
REXML

Defined Under Namespace

Modules: AWS, HTTP_FINGERPRINT, NessusXMLRPC, Net, SSH_FINGERPRINT, SSH_Fingerprint2, StateTransitionHelper, VCloudTransitionHelper Classes: AbstractCommand, AbstractCommandResult, Ami2EbsConversion, AmiConnection, Array, AttachFileCommand, AttachFileCommandResult, Audit, AuditBenchmark, AuditFacade, AuditViaSsh, AutomaticDependencies, BadItemClassException, BenchmarkFactory, BenchmarkResult, Check, CheckFinishedCommand, CheckFinishedCommandResult, CloudyScripts, ConnectionFactory, CopyAmi, CopyMsWindowsAmi, CopyMsWindowsSnapshot, CopySnapshot, CpeNameCommand, CpeNameCommandResult, CriticalPortsAudit, DataCommand, DataCommandResult, DmCryptHelper, DmEncrypt, Done, DownloadSnapshot, EC2_Utils, Ec2Helper, Ec2Script, FailedState, Group, ItemException, ItemNotFoundException, Lazy, LinearScriptGenerator, ListeningPortCommand, ListeningPortCommandResult, MessageCommand, MessageCommandResult, MyOptionParser, Nessus, OpenPortChecker, OpenPortCheckerVm, ParseException, PortRangeDetector, ProgramNameCommand, ProgramNameCommandResult, ProgressMessageListener, RandomString, RemoteCommandHandler, ResultCode, ResultType, RuleResult, RuleRole, RuleSeverity, SSH_Utils, ScriptExecutionState, ScriptOutputParser, SnapshotOptimization, SshConnection, StateChangeListener, StdoutLineBuffer, VCloudApiHandler, VCloudScript, Version, VpcCriticalPortsAudit, WebViewTransformer, YamlBenchmark, YamlTransformer

Instance Method Summary collapse

Instance Method Details

#check_aws_desc(str) ⇒ Object

Check description for AWS AMI registration Constraints: Up to 255 characters



31
32
33
34
35
36
37
# File 'lib/help/helper.rb', line 31

def check_aws_desc(str)
  if str.size <= 255
    return true
  else
    return false
  end
end

#check_aws_name(str) ⇒ Object

API Reference (API Version 2012-07-20): docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-RegisterImage.html Check name for AWS AMI registration Constraints: 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_)



20
21
22
23
24
25
26
27
# File 'lib/help/helper.rb', line 20

def check_aws_name(str)
  if str.match(/^[0-9a-z\-\_\(\)\/\,]{1,128}$/i)
    return true
  else
    return false
  end
  return true 
end

#check_ssh_key(key) ⇒ Object

Check SSH key for connecting AWS instance Constraints: A RSA Private Key



41
42
43
44
45
46
# File 'lib/help/helper.rb', line 41

def check_ssh_key(key)
  priv_key = OpenSSL::PKey::RSA.new(key)
  if !priv_key.private?()
    raise Exception.new("Invalid SSH Key")
  end
end

#check_string_alnum(str) ⇒ Object

Check if string is not more than 255 character and contains wide char



7
8
9
10
11
12
13
14
# File 'lib/help/helper.rb', line 7

def check_string_alnum(str)
  if str.match(/^[0-9a-z\-\_\ ]{1,255}$/i)
    return true
  else
    return false
  end
  return true
end