Class: VpcCriticalPortsAudit

Inherits:
Ec2Script show all
Defined in:
lib/scripts/ec2/vpc_critical_ports_audit.rb

Overview

Checks for all security groups if sensible ports are opened for the wide public.

Defined Under Namespace

Classes: CheckingSensiblePorts, CriticalPortsAuditState, Done, RetrievingSecurityGroups

Instance Method Summary collapse

Methods inherited from Ec2Script

#get_execution_result, #post_message, #register_progress_message_listener, #register_state_change_listener, #start_script

Constructor Details

#initialize(input_params) ⇒ VpcCriticalPortsAudit

Input parameters

  • ec2_api_handler => object that allows to access the EC2 API

  • :critical_ports => arrays of ports to be checked



17
18
19
# File 'lib/scripts/ec2/vpc_critical_ports_audit.rb', line 17

def initialize(input_params)
  super(input_params)
end

Instance Method Details

#check_input_parametersObject



21
22
23
24
25
26
27
28
# File 'lib/scripts/ec2/vpc_critical_ports_audit.rb', line 21

def check_input_parameters()
  if @input_params[:ec2_api_handler] == nil
    raise Exception.new("no EC2 handler specified")
  end
  #if @input_params[:critical_ports] == nil
  #  raise Exception.new("no ports specified")
  #end
end

#load_initial_stateObject



30
31
32
# File 'lib/scripts/ec2/vpc_critical_ports_audit.rb', line 30

def load_initial_state()
  CriticalPortsAuditState.load_state(@input_params)
end