Sha256: 283a39596b02608918d72d1d183717e515a070c7256e586315a0e758eecd3850

Contents?: true

Size: 1.55 KB

Versions: 8

Compression:

Stored size: 1.55 KB

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

module Contrast
  module Components
    module Assess
      # A wrapper build around the Common Agent Configuration project to allow
      # for access of the values contained in its
      # parent_configuration_spec.yaml.
      # Specifically, this allows for querying the state of the Assess product.
      class Interface
        include Contrast::Components::ComponentBase
        include Contrast::Components::Interface

        access_component :settings

        def enabled?
          return false unless defined?(Contrast::Agent::FeatureState)

          state.assess_enabled?
        end

        def tainted_columns
          SETTINGS.tainted_columns
        end

        def forcibly_disabled?
          state.assess_forcibly_disabled?
        end

        def rule_disabled? name
          state.assess_rule_disabled? name
        end

        def disabled_rules
          state.assess_disabled_rules
        end

        def scan_response?
          state.scan_response?
        end

        def track_frozen_sources?
          state.assess_track_frozen_sources?
        end

        def require_scan?
          state.require_scanning_enabled?
        end

        def tags
          state.assess_tags
        end

        def rules
          SETTINGS.assess_rules
        end

        def rule name
          SETTINGS.assess_rules[name]
        end
      end

      COMPONENT_INTERFACE = Interface.new
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
contrast-agent-3.11.0 lib/contrast/components/assess.rb
contrast-agent-3.10.2 lib/contrast/components/assess.rb
contrast-agent-3.10.1 lib/contrast/components/assess.rb
contrast-agent-3.10.0 lib/contrast/components/assess.rb
contrast-agent-3.9.1 lib/contrast/components/assess.rb
contrast-agent-3.9.0 lib/contrast/components/assess.rb
contrast-agent-3.8.5 lib/contrast/components/assess.rb
contrast-agent-3.8.4 lib/contrast/components/assess.rb