Class: TCellAgent::SensorEvents::AppSensorMetaEvent
- Inherits:
-
AppSensor::MetaData
- Object
- Hash
- TCellSensorEvent
- AppSensor::MetaData
- TCellAgent::SensorEvents::AppSensorMetaEvent
- Defined in:
- lib/tcell_agent/sensor_events/appsensor_meta_event.rb
Instance Attribute Summary collapse
-
#csrf_exception_name ⇒ Object
Returns the value of attribute csrf_exception_name.
-
#database_result_sizes ⇒ Object
Returns the value of attribute database_result_sizes.
-
#path ⇒ Object
Returns the value of attribute path.
-
#request_content_bytes_len ⇒ Object
Returns the value of attribute request_content_bytes_len.
-
#response_code ⇒ Object
Returns the value of attribute response_code.
-
#response_content_bytes_len ⇒ Object
Returns the value of attribute response_content_bytes_len.
-
#response_headers ⇒ Object
Returns the value of attribute response_headers.
-
#sql_exceptions ⇒ Object
Returns the value of attribute sql_exceptions.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Attributes inherited from AppSensor::MetaData
#body_dict, #cookie_dict, #get_dict, #headers_dict, #location, #method, #path_parameters, #post_dict, #remote_address, #route_id, #session_id, #transaction_id, #user_id
Attributes inherited from TCellSensorEvent
Class Method Summary collapse
- .build(request, response_content_length, response_code, response_headers) ⇒ Object
- .build_basic(appsensor_meta) ⇒ Object
Instance Method Summary collapse
- #flattened_post_dict ⇒ Object
-
#initialize(method, remote_address, route_id, session_id, user_id, transaction_id, location) ⇒ AppSensorMetaEvent
constructor
A new instance of AppSensorMetaEvent.
- #post_process ⇒ Object
Methods inherited from AppSensor::MetaData
#flattened_body_dict, #flattened_cookie_dict, #flattened_get_dict, #flattened_headers_dict, #flattened_path_parameters, #set_body_dict, #set_headers_dict
Methods inherited from TCellSensorEvent
Constructor Details
#initialize(method, remote_address, route_id, session_id, user_id, transaction_id, location) ⇒ AppSensorMetaEvent
Returns a new instance of AppSensorMetaEvent.
92 93 94 95 96 97 98 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 92 def initialize(method, remote_address, route_id, session_id, user_id, transaction_id, location) super(method, remote_address, route_id, session_id, user_id, transaction_id, location) @request_content_bytes_len = 0 @response_content_bytes_len = 0 @user_agent = nil end |
Instance Attribute Details
#csrf_exception_name ⇒ Object
Returns the value of attribute csrf_exception_name.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def csrf_exception_name @csrf_exception_name end |
#database_result_sizes ⇒ Object
Returns the value of attribute database_result_sizes.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def database_result_sizes @database_result_sizes end |
#path ⇒ Object
Returns the value of attribute path.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def path @path end |
#request_content_bytes_len ⇒ Object
Returns the value of attribute request_content_bytes_len.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def request_content_bytes_len @request_content_bytes_len end |
#response_code ⇒ Object
Returns the value of attribute response_code.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def response_code @response_code end |
#response_content_bytes_len ⇒ Object
Returns the value of attribute response_content_bytes_len.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def response_content_bytes_len @response_content_bytes_len end |
#response_headers ⇒ Object
Returns the value of attribute response_headers.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def response_headers @response_headers end |
#sql_exceptions ⇒ Object
Returns the value of attribute sql_exceptions.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def sql_exceptions @sql_exceptions end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 88 def user_agent @user_agent end |
Class Method Details
.build(request, response_content_length, response_code, response_headers) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 22 def build(request, response_content_length, response_code, response_headers) tcell_context = request.env[TCellAgent::Instrumentation::TCELL_ID] = AppSensorMetaEvent.new( tcell_context.request_method, tcell_context.ip_address, tcell_context.route_id, tcell_context.hmac_session_id, tcell_context.user_id, tcell_context.transaction_id, tcell_context.uri ) .csrf_exception_name = tcell_context.csrf_exception_name .user_agent = tcell_context.user_agent .request_content_bytes_len = (request.content_length || 0).to_i .response_content_bytes_len = response_content_length # use uri stored in tcell_context because # rails modifies original request.url # to always return /404 (or whatever error code # it encountered) .location = tcell_context.uri .path = tcell_context.path .get_dict = request.GET . = request. .set_headers_dict(request.env) # don't enqueue parameter values of unknown type to avoid any serialization issues .post_dict = TCellAgent::Utils::Params.flatten(request.POST) .path_parameters = tcell_context.path_parameters .response_code = response_code .response_headers = response_headers .sql_exceptions = tcell_context.sql_exceptions .database_result_sizes = tcell_context.database_result_sizes # Positions strio to the beginning of input, resetting lineno to zero. # rails 4.1 seems to read the stringIO directly and so body.gets is empty # this is called request.body.rewind .set_body_dict( .request_content_bytes_len, request.content_type, request.body.gets ) end |
.build_basic(appsensor_meta) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 74 def build_basic() AppSensorMetaEvent.new( .method, .remote_address, .route_id, .session_id, .user_id, .transaction_id, .location ) end |
Instance Method Details
#flattened_post_dict ⇒ Object
107 108 109 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 107 def flattened_post_dict @post_dict end |
#post_process ⇒ Object
100 101 102 103 104 105 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 100 def post_process rust_policies = TCellAgent.policy(TCellAgent::PolicyTypes::Rust) return unless rust_policies rust_policies.check_appfirewall_injections(self) end |