Class: Contrast::Components::Assess::Interface

Inherits:
Object
  • Object
show all
Includes:
ComponentBase, Interface
Defined in:
lib/contrast/components/assess.rb

Overview

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.

Instance Method Summary collapse

Methods included from Interface

included

Methods included from ComponentBase

included

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
# File 'lib/contrast/components/assess.rb', line 17

def enabled?
  # config overrides if forcibly set
  return false if forcibly_disabled?
  return true  if forcibly_enabled?

  SETTINGS.assess_enabled?
end

#forcibly_disabled?Boolean

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/contrast/components/assess.rb', line 29

def forcibly_disabled?
  @_forcibly_disabled = false?(CONFIG.root.assess.enable) if @_forcibly_disabled.nil?
  @_forcibly_disabled
end

#require_scan?Boolean

Returns:

  • (Boolean)


48
49
50
51
# File 'lib/contrast/components/assess.rb', line 48

def require_scan?
  @_require_scan = !false?(CONFIG.root.agent.ruby.require_scan) if @_require_scan.nil?
  @_require_scan
end

#rule_disabled?(name) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/contrast/components/assess.rb', line 34

def rule_disabled? name
  disabled_rules.include?(name)
end

#rulesObject



57
58
59
# File 'lib/contrast/components/assess.rb', line 57

def rules
  SETTINGS.assess_rules
end

#scan_response?Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/contrast/components/assess.rb', line 38

def scan_response?
  @_scan_response = !false?(CONFIG.root.assess.enable_scan_response) if @_scan_response.nil?
  @_scan_response
end

#tagsObject



53
54
55
# File 'lib/contrast/components/assess.rb', line 53

def tags
  CONFIG.root.assess&.tags
end

#tainted_columnsObject



25
26
27
# File 'lib/contrast/components/assess.rb', line 25

def tainted_columns
  SETTINGS.tainted_columns
end

#track_frozen_sources?Boolean

Returns:

  • (Boolean)


43
44
45
46
# File 'lib/contrast/components/assess.rb', line 43

def track_frozen_sources?
  @_track_frozen_sources = !false?(CONFIG.root.agent.ruby.track_frozen_sources) if @_track_frozen_sources.nil?
  @_track_frozen_sources
end