Sha256: 34649665fc5c155649e302647520b7cd12a3951a8d71776df124a76c2d43f399

Contents?: true

Size: 1.63 KB

Versions: 30

Compression:

Stored size: 1.63 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

require 'new_relic/agent/configuration/dotted_hash'

module NewRelic
  module Agent
    module Configuration
      class HighSecuritySource < DottedHash
        def initialize(local_settings)
          super({
            :ssl => true,

            :capture_params           => false,
            :'resque.capture_params'  => false,
            :'sidekiq.capture_params' => false,

            :'transaction_tracer.record_sql' => record_sql_setting(local_settings, :'transaction_tracer.record_sql'),
            :'slow_sql.record_sql'           => record_sql_setting(local_settings, :'slow_sql.record_sql'),
            :'mongo.obfuscate_queries'       => true,
            :'transaction_tracer.record_redis_arguments' => false,

            :'custom_insights_events.enabled'   => false,
            :'strip_exception_messages.enabled' => true
          })
        end

        OFF = "off".freeze
        RAW = "raw".freeze
        OBFUSCATED = "obfuscated".freeze

        SET_TO_OBFUSCATED = [RAW, OBFUSCATED]

        def record_sql_setting(local_settings, key)
          original_value  = local_settings[key]
          result = if SET_TO_OBFUSCATED.include?(original_value)
            OBFUSCATED
          else
            OFF
          end

          if result != original_value
            NewRelic::Agent.logger.info("Disabling setting #{key}='#{original_value}' because high security mode is enabled. Value will be '#{result}'")
          end

          result
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
newrelic_rpm-4.8.0.341 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.7.1.340 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.7.0.339 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.6.0.338 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.5.0.337 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.4.0.336 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.3.0.335 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.2.0.334 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.1.0.333 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-4.0.0.332 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.18.1.330 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.18.0.329 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.17.2.327 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.17.1.326 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.17.0.325 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.16.3.323 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.16.2.321 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.16.1.320 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-3.16.0.318 lib/new_relic/agent/configuration/high_security_source.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/lib/new_relic/agent/configuration/high_security_source.rb