Class: Contrast::Agent::Reporting::Settings::SensitiveDataMasking
- Defined in:
- lib/contrast/agent/reporting/settings/sensitive_data_masking.rb
Overview
Protect level settings for the sensitive_data_masking_policy. Configuration of the masking parameters will be delivered dynamically from TeamServer during an ApplicationSettings response from requests to TS endpoints that return that structure. contrast.atlassian.net/wiki/spaces/~699189087/pages/807960614/Sensitive+Data+Masking+Design
Instance Method Summary collapse
-
#build_rules_form_settings(settings_rules) ⇒ Object
Build rules from hash.
-
#mask_attack_vector=(bool) ⇒ Object
Set the flag for using masking on attack vector.
-
#mask_attack_vector? ⇒ Boolean
Policy flag to enable the use of masking on attack vector.
-
#mask_http_body=(bool) ⇒ Object
Set the flag for request body masking.
-
#mask_http_body? ⇒ Boolean
Policy flag to enable the use of masking on request body Here is set to defaults to true.
-
#rules ⇒ Object
Rules to follow when using the masking.
-
#rules=(rules) ⇒ Object
Assign rules array.
- #to_controlled_hash ⇒ Object
Instance Method Details
#build_rules_form_settings(settings_rules) ⇒ Object
Build rules from hash
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 68 def build_rules_form_settings settings_rules return if settings_rules.nil? || settings_rules.empty? settings_rules.each do |rule| instance = Contrast::Agent::Reporting::Settings::SensitiveDataMaskingRule.new instance.rule_id = rule[:id] instance.keywords = rule[:keywords] rules << instance end rules end |
#mask_attack_vector=(bool) ⇒ Object
Set the flag for using masking on attack vector
45 46 47 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 45 def mask_attack_vector= bool @_mask_attack_vector = !!bool end |
#mask_attack_vector? ⇒ Boolean
Policy flag to enable the use of masking on attack vector. Here is set to defaults to false.
37 38 39 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 37 def mask_attack_vector? @_mask_attack_vector end |
#mask_http_body=(bool) ⇒ Object
Set the flag for request body masking
29 30 31 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 29 def mask_http_body= bool @_mask_http_body = bool.nil? ? true : !!bool end |
#mask_http_body? ⇒ Boolean
Policy flag to enable the use of masking on request body Here is set to defaults to true.
21 22 23 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 21 def mask_http_body? @_mask_http_body end |
#rules ⇒ Object
Rules to follow when using the masking
52 53 54 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 52 def rules @_rules ||= Contrast::Agent::Reporting::Settings::RulesArray.new end |
#rules=(rules) ⇒ Object
Assign rules array
60 61 62 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 60 def rules= rules @_rules = rules if rules_array?(rules) end |
#to_controlled_hash ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/contrast/agent/reporting/settings/sensitive_data_masking.rb', line 80 def to_controlled_hash { rules: rules.map(&:to_controlled_hash), mask_attack_vector: mask_attack_vector?, mask_http_body: mask_http_body? } end |