Class: TCellAgent::SensorEvents::PatchesEvent

Inherits:
TCellSensorEvent show all
Defined in:
lib/tcell_agent/sensor_events/patches.rb

Instance Attribute Summary

Attributes inherited from TCellSensorEvent

#ensure, #flush, #send

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculateOffset, #post_process

Constructor Details

#initialize(rust_response, appsensor_meta) ⇒ PatchesEvent

Returns a new instance of PatchesEvent.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tcell_agent/sensor_events/patches.rb', line 7

def initialize(rust_response, appsensor_meta)
  super("patches")

  self["patches_pid"] = rust_response["patches_policy_id"]
  self["rule_id"] = rust_response["rule_id"]
  self["action"] = "blocked"
  self["sz"] = appsensor_meta.request_content_bytes_len if appsensor_meta.request_content_bytes_len
  self["m"] = appsensor_meta.method if appsensor_meta.method
  self["remote_addr"] = appsensor_meta.remote_address if appsensor_meta.remote_address
  self["uri"] = TCellAgent::SensorEvents::Util.strip_uri_values(appsensor_meta.location) if appsensor_meta.location
  self["regex_pid"] = rust_response["regex_pid"] if rust_response["regex_pid"]
  self["payload"] = rust_response["payload"] if rust_response["payload"]
end