Class: CriticalPortsAudit
- Defined in:
- lib/scripts/ec2/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
- #check_input_parameters ⇒ Object
-
#initialize(input_params) ⇒ CriticalPortsAudit
constructor
Input parameters * ec2_api_handler => object that allows to access the EC2 API * :critical_ports => arrays of ports to be checked.
- #load_initial_state ⇒ Object
Methods inherited from Ec2Script
#get_execution_result, #post_message, #register_progress_message_listener, #register_state_change_listener, #start_script
Constructor Details
#initialize(input_params) ⇒ CriticalPortsAudit
Input parameters
-
ec2_api_handler => object that allows to access the EC2 API
-
:critical_ports => arrays of ports to be checked
16 17 18 |
# File 'lib/scripts/ec2/critical_ports_audit.rb', line 16 def initialize(input_params) super(input_params) end |
Instance Method Details
#check_input_parameters ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/scripts/ec2/critical_ports_audit.rb', line 20 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_state ⇒ Object
29 30 31 |
# File 'lib/scripts/ec2/critical_ports_audit.rb', line 29 def load_initial_state() CriticalPortsAuditState.load_state(@input_params) end |