Sha256: 5971ff4bee9c92b878525fab796d87f7835d58d96dc189f3f64a72d472e8d031

Contents?: true

Size: 1.42 KB

Versions: 12

Compression:

Stored size: 1.42 KB

Contents

# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/agent/reporting/reporting_events/server_reporting_event'

module Contrast
  module Agent
    module Reporting
      # This class will initialize empty ServerActivity body to be send to TS. The server activity endpoint records
      # actions taken on the server or process as a whole. It currently only reports the number of times a defensive
      # action was taken and is most likely not populated by most agents. The main purpose of sending this message is
      # for its response, which contains any updated server feature settings from TeamServer. The new Server Settings
      # endpoint should let us remove this.
      class ServerActivity < Contrast::Agent::Reporting::ServerReportingEvent
        def initialize
          @event_method = :PUT
          @event_endpoint = "#{ Contrast::API.api_url }/api/ng/activity/server"
          super
        end

        def file_name
          'server-activity'
        end

        # Convert the instance variables on the class, and other information, into the identifiers required for
        # TeamServer to process the JSON form of this message.
        #
        # @return [Hash]
        # @raise [ArgumentError]
        def to_controlled_hash
          { lastUpdate: since_last_update }
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
contrast-agent-6.8.0 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.7.0 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.6.5 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.6.4 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.6.3 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.6.2 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.6.1 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.6.0 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.5.1 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.5.0 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.4.0 lib/contrast/agent/reporting/reporting_events/server_activity.rb
contrast-agent-6.3.0 lib/contrast/agent/reporting/reporting_events/server_activity.rb