Sha256: 9ea8387668c09fcde3581e3e0a0dd632c793e9bd9c8647632025b2091a591bd5

Contents?: true

Size: 1.6 KB

Versions: 12

Compression:

Stored size: 1.6 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({
            :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

12 entries across 12 versions & 1 rubygems

Version Path
newrelic_rpm-6.3.0.355 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-6.2.0.354 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-6.1.0.352 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-6.0.0.351 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.7.0.350 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.6.0.349 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.5.0.348 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.4.0.347 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.3.0.346 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.2.0.345 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.1.0.344 lib/new_relic/agent/configuration/high_security_source.rb
newrelic_rpm-5.0.0.342 lib/new_relic/agent/configuration/high_security_source.rb