Class: Contrast::Agent::Reporting::Settings::Keyword

Inherits:
Object
  • Object
show all
Defined in:
lib/contrast/agent/reporting/settings/keyword.rb

Overview

The words to search for in input that indicate an attack

Direct Known Subclasses

Pattern

Constant Summary collapse

ATTRIBUTES =
%i[id value case_sensitive score prohibited_features mandatory_features].cs__freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#case_sensitiveObject

Returns the value of attribute case_sensitive.



19
20
21
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 19

def case_sensitive
  @case_sensitive
end

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 15

def id
  @id
end

#scoreObject

higher meaning more likely to be an attack



22
23
24
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 22

def score
  @score
end

#valueObject

Returns the value of attribute value.



17
18
19
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 17

def value
  @value
end

Instance Method Details

#mandatory_featuresArray<String>

Disable this pattern or keyword if agent implements one of the specified features

Returns:



36
37
38
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 36

def mandatory_features
  @_mandatory_features ||= []
end

#mandatory_features=(features) ⇒ Array<String>

Set the features.

Parameters:

  • features (Array)

Returns:



52
53
54
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 52

def mandatory_features= features
  @_mandatory_features = features if features.is_a?(Array)
end

#prohibited_featuresArray<String>

Disable this pattern or keyword if agent implements one of the specified features

Returns:



28
29
30
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 28

def prohibited_features
  @_prohibited_features ||= []
end

#prohibited_features=(features) ⇒ Array<String>

Set the features.

Parameters:

  • features (Array)

Returns:



44
45
46
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 44

def prohibited_features= features
  @_prohibited_features = features if features.is_a?(Array)
end

#to_controlled_hashObject



56
57
58
59
60
61
62
63
64
65
# File 'lib/contrast/agent/reporting/settings/keyword.rb', line 56

def to_controlled_hash
  {
      id: id,
      value: value,
      caseSensitive: case_sensitive,
      score: score,
      prohibitedFeatures: prohibited_features,
      mandatoryFeatures: mandatory_features
  }
end