Class: Contrast::Agent::Reporting::Settings::ServerFeatures

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

Overview

All of the settings from TeamServer that apply at the server level. At least one, but not necessarily all, setting will differ from the agent’s current set. agents are able to replace all server settings with those in this message.

Instance Method Summary collapse

Instance Method Details

#assessObject



74
75
76
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 74

def assess
  @_assess ||= Contrast::Agent::Reporting::Settings::AssessServerFeature.new
end

#log_fileObject

Where to log the agent’s log file, if set by the user. Overridden by agent.logger.path if set in a local configuration.



38
39
40
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 38

def log_file
  @_log_file ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#log_file=(log_file) ⇒ Object

Set the log file

Parameters:



46
47
48
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 46

def log_file= log_file
  @_log_file = log_file if log_file.is_a?(String)
end

#log_levelObject

The level at which the agent should log. Overridden by agent.logger.level if set in a local configuration



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

def log_level
  @_log_level ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#log_level=(log_level) ⇒ Object

set the log level

Parameters:



30
31
32
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 30

def log_level= log_level
  @_log_level = log_level if log_level.is_a?(String)
end

#protectObject



79
80
81
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 79

def protect
  @_protect ||= Contrast::Agent::Reporting::Settings::ProtectServerFeature.new
end

#security_loggerContrast::Agent::Reporting::Settings::SecurityLogger

Class holding security logger settings:



53
54
55
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 53

def security_logger
  @_security_logger ||= Contrast::Agent::Reporting::Settings::SecurityLogger.new
end

#telemetryObject

Controls for the reporting of telemetry events from the agent to TeamServer. This is NOT for the agent telemetry feature collecting metrics sent to other services.



61
62
63
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 61

def telemetry
  @_telemetry
end

#telemetry=(telemetry) ⇒ Object

sets the telemetry value

Parameters:

  • telemetry (Boolean)


69
70
71
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 69

def telemetry= telemetry
  @_telemetry = telemetry if !!telemetry == telemetry
end

#to_controlled_hashObject



83
84
85
86
87
88
89
90
91
92
# File 'lib/contrast/agent/reporting/settings/server_features.rb', line 83

def to_controlled_hash
  {
      security_logger: security_logger.settings_blank? ? nil : security_logger.to_controlled_hash,
      assessment: @_assess ? assess.to_controlled_hash : {},
      defend: @_protect ? protect.to_controlled_hash : {},
      logLevel: log_level,
      logFile: log_file,
      telemetry: telemetry
  }.compact
end