Sha256: 982e5d6cd5e7b5aaa1989c32ce652d9d5d89858a7ddd671ecbd6c8289529d89c

Contents?: true

Size: 863 Bytes

Versions: 99

Compression:

Stored size: 863 Bytes

Contents

class Brakeman::CheckForceSSL < Brakeman::BaseCheck
  Brakeman::Checks.add_optional self

  @description = "Check that force_ssl setting is enabled in production"

  def run_check
    return if tracker.config.rails.empty? or tracker.config.rails_version.nil?
    return if tracker.config.rails_version < "3.1.0"

    force_ssl = tracker.config.rails[:force_ssl]

    if false? force_ssl or force_ssl.nil?
      line = if sexp? force_ssl
               force_ssl.line
             else
               1
             end

      warn :warning_type => "Missing Encryption",
        :warning_code => :force_ssl_disabled,
        :message => msg("The application does not force use of HTTPS: ", msg_code("config.force_ssl"), " is not enabled"),
        :confidence => :high,
        :file => "config/environments/production.rb",
        :line => line
    end
  end
end

Version data entries

99 entries across 85 versions & 4 rubygems

Version Path
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/brakeman-4.5.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/brakeman-4.6.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.6.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.5.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/lib/brakeman/checks/check_force_ssl.rb
brakeman-4.6.1 lib/brakeman/checks/check_force_ssl.rb
brakeman-lib-4.6.1 lib/brakeman/checks/check_force_ssl.rb
brakeman-min-4.6.1 lib/brakeman/checks/check_force_ssl.rb
brakeman-4.6.0 lib/brakeman/checks/check_force_ssl.rb
brakeman-min-4.6.0 lib/brakeman/checks/check_force_ssl.rb
brakeman-lib-4.6.0 lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/lib/brakeman/checks/check_force_ssl.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/lib/brakeman/checks/check_force_ssl.rb
brakeman-4.5.1 lib/brakeman/checks/check_force_ssl.rb
brakeman-lib-4.5.1 lib/brakeman/checks/check_force_ssl.rb
brakeman-min-4.5.1 lib/brakeman/checks/check_force_ssl.rb