# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true require 'contrast/agent/reporting/settings/assess' require 'contrast/agent/reporting/settings/protect' require 'contrast/agent/reporting/settings/exclusions' require 'contrast/agent/reporting/settings/reaction' require 'contrast/agent/reporting/settings/sensitive_data_masking' module Contrast module Agent module Reporting # This module will hold all the settings from the TS responce module Settings # All of the settings from TeamServer that apply at the application level. # At least one, but not necessarily all, setting will differ from the agent's current set. # Agents are able to replace all application settings with those in this message. class ApplicationSettings # Application level settings for the Assess featureset # # @return assess [Contrast::Agent::Reporting::Settings::Assess] def assess @_assess ||= Contrast::Agent::Reporting::Settings::Assess.new end # Application level settings for the Protect featureset # # @return protect [Contrast::Agent::Reporting::Settings::Protect] def protect @_protect ||= Contrast::Agent::Reporting::Settings::Protect.new end # Array of all the exclusions # # @return exclusions [Contrast::Agent::Reporting::Settings::Exclusions] def exclusions @_exclusions ||= Contrast::Agent::Reporting::Settings::Exclusions.new end # This object will hold the masking rules send from TS. # # @return sensitive_data_masking [Contrast::Agent::Reporting::Settings::SensitiveDataMasking] this object # includes mask_http_body flag and Array set of rules with keywords in them. def sensitive_data_masking @_sensitive_data_masking ||= Contrast::Agent::Reporting::Settings::SensitiveDataMasking.new end # Currently protect and assess are not covered with to_controlled_hash methods def to_controlled_hash { defend: {}, exceptions: exclusions.to_controlled_hash, assessment: {}, sensitive_data_masking_policy: sensitive_data_masking.to_controlled_hash } end end end end end end