Class: CfnNagExecutor

Inherits:
Object show all
Defined in:
lib/cfn-nag/cfn_nag_executor.rb

Instance Method Summary collapse

Constructor Details

#initializeCfnNagExecutor

Returns a new instance of CfnNagExecutor.


8
9
10
11
12
13
14
15
# File 'lib/cfn-nag/cfn_nag_executor.rb', line 8

def initialize
  @profile_definition = nil
  @blacklist_definition = nil
  @parameter_values_string = nil
  @condition_values_string = nil
  @rule_repository_definitions = []
  @rule_arguments_string = nil
end

Instance Method Details

#scan(options_type:) ⇒ Object


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cfn-nag/cfn_nag_executor.rb', line 17

def scan(options_type:)
  @total_failure_count = 0

  options = Options.for(options_type)
  validate_options(options)
  execute_io_options(options)

  CfnNagLogging.configure_logging(options)

  cfn_nag = CfnNag.new(
    config: cfn_nag_config(options)
  )

  options_type == 'scan' ? execute_aggregate_scan(cfn_nag, options) : execute_file_or_piped_scan(cfn_nag, options)
end