INNER CODE UNIT · Ruby

validate_options

stelligent/cfn_nag · lib/cfn-nag/cfn_nag_executor.rb:76

  def validate_options(opts)
    unless opts[:output_format].nil? || %w[colortxt txt json sarif].include?(opts[:output_format])
      Optimist.die(:output_format,
                   'Must be colortxt, txt, json or sarif')
    end

    opts[:rule_arguments]&.each do |rule_argument|
      unless rule_argument.include?(':')
        Optimist.die(:rule_arguments, 'Must be of form name:value')
      end
    end
  end

  def execute_io_options(opts)
    @profile_definition = read_conditionally(opts[:profile_path])

    @deny_list_definition = read_conditionally(opts[:deny_list_path]) || read_conditionally(opts[:blacklist_path])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…