tcell_agent 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/tcell_agent +10 -2
- data/lib/tcell_agent.rb +3 -3
- data/lib/tcell_agent/agent.rb +42 -52
- data/lib/tcell_agent/agent/event_processor.rb +129 -162
- data/lib/tcell_agent/agent/fork_pipe_manager.rb +57 -62
- data/lib/tcell_agent/agent/policy_manager.rb +83 -104
- data/lib/tcell_agent/agent/policy_types.rb +24 -29
- data/lib/tcell_agent/agent/route_manager.rb +36 -46
- data/lib/tcell_agent/agent/static_agent.rb +19 -21
- data/lib/tcell_agent/api.rb +23 -28
- data/lib/tcell_agent/appsensor/injections_reporter.rb +7 -11
- data/lib/tcell_agent/authlogic.rb +7 -7
- data/lib/tcell_agent/cmdi.rb +22 -23
- data/lib/tcell_agent/config/unknown_options.rb +71 -69
- data/lib/tcell_agent/configuration.rb +187 -191
- data/lib/tcell_agent/devise.rb +13 -15
- data/lib/tcell_agent/hooks/login_fraud.rb +1 -1
- data/lib/tcell_agent/instrumentation.rb +120 -124
- data/lib/tcell_agent/logger.rb +29 -45
- data/lib/tcell_agent/patches.rb +5 -5
- data/lib/tcell_agent/policies/dataloss_policy.rb +263 -288
- data/lib/tcell_agent/policies/http_redirect_policy.rb +25 -37
- data/lib/tcell_agent/policies/http_tx_policy.rb +48 -52
- data/lib/tcell_agent/policies/login_fraud_policy.rb +15 -20
- data/lib/tcell_agent/policies/policy.rb +0 -2
- data/lib/tcell_agent/policies/rust_policies.rb +24 -29
- data/lib/tcell_agent/rails.rb +2 -3
- data/lib/tcell_agent/rails/auth/authlogic.rb +2 -2
- data/lib/tcell_agent/rails/auth/devise.rb +2 -2
- data/lib/tcell_agent/rails/auth/doorkeeper.rb +2 -2
- data/lib/tcell_agent/rails/better_ip.rb +12 -16
- data/lib/tcell_agent/rails/csrf_exception.rb +4 -7
- data/lib/tcell_agent/rails/dlp.rb +208 -107
- data/lib/tcell_agent/rails/dlp/process_request.rb +37 -47
- data/lib/tcell_agent/rails/dlp_handler.rb +9 -11
- data/lib/tcell_agent/rails/js_agent_insert.rb +11 -14
- data/lib/tcell_agent/rails/middleware/body_filter_middleware.rb +8 -7
- data/lib/tcell_agent/rails/middleware/context_middleware.rb +4 -5
- data/lib/tcell_agent/rails/middleware/global_middleware.rb +5 -8
- data/lib/tcell_agent/rails/middleware/headers_middleware.rb +24 -27
- data/lib/tcell_agent/rails/on_start.rb +5 -5
- data/lib/tcell_agent/rails/responses.rb +7 -9
- data/lib/tcell_agent/rails/routes.rb +62 -81
- data/lib/tcell_agent/rails/routes/grape.rb +25 -30
- data/lib/tcell_agent/rails/routes/route_id.rb +9 -14
- data/lib/tcell_agent/rails/settings_reporter.rb +44 -33
- data/lib/tcell_agent/rails/tcell_body_proxy.rb +15 -18
- data/lib/tcell_agent/routes/table.rb +31 -33
- data/lib/tcell_agent/rust/{libtcellagent-1.3.0.dylib → libtcellagent-1.3.1.dylib} +0 -0
- data/lib/tcell_agent/rust/{libtcellagent-1.3.0.so → libtcellagent-1.3.1.so} +0 -0
- data/lib/tcell_agent/rust/{libtcellagent-alpine-1.3.0.so → libtcellagent-alpine-1.3.1.so} +0 -0
- data/lib/tcell_agent/rust/models.rb +32 -37
- data/lib/tcell_agent/rust/tcellagent-1.3.1.dll +0 -0
- data/lib/tcell_agent/rust/whisperer.rb +101 -104
- data/lib/tcell_agent/sensor_events/app_config.rb +7 -7
- data/lib/tcell_agent/sensor_events/appsensor_event.rb +26 -27
- data/lib/tcell_agent/sensor_events/appsensor_meta_event.rb +20 -88
- data/lib/tcell_agent/sensor_events/command_injection.rb +52 -80
- data/lib/tcell_agent/sensor_events/discovery.rb +27 -27
- data/lib/tcell_agent/sensor_events/dlp.rb +50 -56
- data/lib/tcell_agent/sensor_events/honeytokens.rb +9 -9
- data/lib/tcell_agent/sensor_events/metrics.rb +20 -21
- data/lib/tcell_agent/sensor_events/patches.rb +10 -12
- data/lib/tcell_agent/sensor_events/sensor.rb +32 -36
- data/lib/tcell_agent/sensor_events/server_agent.rb +130 -127
- data/lib/tcell_agent/sensor_events/util/sanitizer_utilities.rb +60 -80
- data/lib/tcell_agent/sensor_events/util/utils.rb +3 -5
- data/lib/tcell_agent/servers/passenger.rb +5 -9
- data/lib/tcell_agent/servers/puma.rb +18 -27
- data/lib/tcell_agent/servers/rails_server.rb +5 -9
- data/lib/tcell_agent/servers/thin.rb +2 -4
- data/lib/tcell_agent/servers/unicorn.rb +18 -27
- data/lib/tcell_agent/servers/webrick.rb +2 -4
- data/lib/tcell_agent/settings_reporter.rb +126 -0
- data/lib/tcell_agent/sinatra.rb +24 -26
- data/lib/tcell_agent/start_background_thread.rb +21 -142
- data/lib/tcell_agent/system_info.rb +4 -3
- data/lib/tcell_agent/tcell_context.rb +150 -0
- data/lib/tcell_agent/userinfo.rb +3 -3
- data/lib/tcell_agent/utils/io.rb +19 -24
- data/lib/tcell_agent/utils/params.rb +9 -15
- data/lib/tcell_agent/utils/queue_with_timeout.rb +26 -32
- data/lib/tcell_agent/utils/strings.rb +4 -6
- data/lib/tcell_agent/version.rb +1 -1
- data/spec/lib/tcell_agent/agent/policy_manager_spec.rb +5 -5
- data/spec/lib/tcell_agent/agent/static_agent_spec.rb +7 -7
- data/spec/lib/tcell_agent/cmdi_spec.rb +21 -21
- data/spec/lib/tcell_agent/hooks/login_fraud_spec.rb +29 -24
- data/spec/lib/tcell_agent/instrumentation_spec.rb +4 -4
- data/spec/lib/tcell_agent/patches_spec.rb +8 -8
- data/spec/lib/tcell_agent/policies/appsensor_policy_spec.rb +23 -23
- data/spec/lib/tcell_agent/policies/patches_policy_spec.rb +2 -2
- data/spec/lib/tcell_agent/rails/csrf_exception_spec.rb +69 -0
- data/spec/lib/tcell_agent/rails/dlp_spec.rb +1039 -0
- data/spec/lib/tcell_agent/rails/js_agent_insert_spec.rb +271 -0
- data/spec/lib/tcell_agent/rails/logger_spec.rb +5 -5
- data/spec/lib/tcell_agent/rails/middleware/appsensor_middleware_spec.rb +3 -3
- data/spec/lib/tcell_agent/rails/middleware/dlp_middleware_spec.rb +4 -4
- data/spec/lib/tcell_agent/rails/middleware/global_middleware_spec.rb +5 -5
- data/spec/lib/tcell_agent/rails/middleware/redirect_middleware_spec.rb +1 -1
- data/spec/lib/tcell_agent/rails/middleware/tcell_body_proxy_spec.rb +11 -8
- data/spec/lib/tcell_agent/rails/responses_spec.rb +2 -2
- data/spec/lib/tcell_agent/rails/routes/grape_spec.rb +2 -2
- data/spec/lib/tcell_agent/rails/routes/route_id_spec.rb +1 -1
- data/spec/lib/tcell_agent/rails/routes/routes_spec.rb +4 -4
- data/spec/lib/tcell_agent/rust/models_spec.rb +83 -75
- data/spec/lib/tcell_agent/rust/whisperer_spec.rb +14 -14
- data/spec/lib/tcell_agent/sensor_events/appsensor_meta_event_spec.rb +19 -70
- data/spec/lib/tcell_agent/sensor_events/sessions_metric_spec.rb +1 -1
- data/spec/lib/tcell_agent/settings_reporter_spec.rb +162 -0
- data/spec/lib/tcell_agent/tcell_context_spec.rb +154 -0
- data/spec/spec_helper.rb +5 -0
- metadata +18 -10
- data/lib/tcell_agent/appsensor/meta_data.rb +0 -132
- data/lib/tcell_agent/patches/meta_data.rb +0 -59
- data/lib/tcell_agent/rust/tcellagent-1.3.0.dll +0 -0
- data/spec/lib/tcell_agent/appsensor/meta_data_spec.rb +0 -71
|
@@ -4,13 +4,13 @@ require 'tcell_agent/sensor_events/util/sanitizer_utilities'
|
|
|
4
4
|
require 'tcell_agent/sensor_events/sensor'
|
|
5
5
|
|
|
6
6
|
module TCellAgent
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
end
|
|
7
|
+
module SensorEvents
|
|
8
|
+
class HoneytokensSensorEvent < TCellSensorEvent
|
|
9
|
+
def initialize(request, token_id)
|
|
10
|
+
super('honeytoken')
|
|
11
|
+
self['id'] = token_id
|
|
12
|
+
self['ip'] = request.remote_ip
|
|
13
|
+
end
|
|
15
14
|
end
|
|
16
|
-
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -21,7 +21,7 @@ module TCellAgent
|
|
|
21
21
|
attr_accessor :route_id
|
|
22
22
|
attr_accessor :response_time
|
|
23
23
|
def initialize(route_id, response_time)
|
|
24
|
-
super(
|
|
24
|
+
super('RequestRouteTimer')
|
|
25
25
|
self.route_id = route_id
|
|
26
26
|
self.response_time = response_time
|
|
27
27
|
@send = false
|
|
@@ -29,11 +29,12 @@ module TCellAgent
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
class MetricsEvent < TCellSensorEvent
|
|
32
|
-
def initialize
|
|
33
|
-
super(
|
|
32
|
+
def initialize
|
|
33
|
+
super('metrics')
|
|
34
34
|
end
|
|
35
|
+
|
|
35
36
|
def set_route_count_table(route_count_table)
|
|
36
|
-
self[
|
|
37
|
+
self['rct'] = route_count_table
|
|
37
38
|
end
|
|
38
39
|
end
|
|
39
40
|
|
|
@@ -42,12 +43,12 @@ module TCellAgent
|
|
|
42
43
|
def initialize(object_counter, user_id)
|
|
43
44
|
@object_counter = object_counter
|
|
44
45
|
@user_agents = {}
|
|
45
|
-
self[
|
|
46
|
-
self[
|
|
46
|
+
self['uid'] = user_id
|
|
47
|
+
self['track'] = []
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
def add_user_agent_ip(truncated_agent, ip_address)
|
|
50
|
-
if @user_agents.
|
|
51
|
+
if @user_agents.key?(truncated_agent)
|
|
51
52
|
tracked_agents = @user_agents[truncated_agent]
|
|
52
53
|
ips = tracked_agents[1]
|
|
53
54
|
unless ips.include?(ip_address)
|
|
@@ -57,7 +58,7 @@ module TCellAgent
|
|
|
57
58
|
else
|
|
58
59
|
@object_counter.add_object
|
|
59
60
|
@user_agents[truncated_agent] = [truncated_agent, [ip_address]]
|
|
60
|
-
self[
|
|
61
|
+
self['track'].push(@user_agents[truncated_agent])
|
|
61
62
|
end
|
|
62
63
|
end
|
|
63
64
|
end
|
|
@@ -69,7 +70,7 @@ module TCellAgent
|
|
|
69
70
|
end
|
|
70
71
|
|
|
71
72
|
def add_user_id_user_agent_ip(user_id, truncated_agent, ip_address)
|
|
72
|
-
if @user_ids.
|
|
73
|
+
if @user_ids.key?(user_id)
|
|
73
74
|
user_id_info = @user_ids[user_id]
|
|
74
75
|
user_id_info.add_user_agent_ip(truncated_agent, ip_address)
|
|
75
76
|
else
|
|
@@ -78,41 +79,39 @@ module TCellAgent
|
|
|
78
79
|
@user_ids[user_id] = user_id_info = UserSessionTrackMetric.new(@object_counter, user_id)
|
|
79
80
|
user_id_info.add_user_agent_ip(truncated_agent, ip_address)
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
push(user_id_info)
|
|
82
83
|
end
|
|
83
84
|
end
|
|
84
85
|
end
|
|
85
86
|
|
|
86
|
-
def initialize
|
|
87
|
-
super(
|
|
87
|
+
def initialize
|
|
88
|
+
super('metrics')
|
|
88
89
|
@send = false
|
|
89
90
|
@flush = false
|
|
90
91
|
|
|
91
|
-
self[
|
|
92
|
+
self['sessions'] = {}
|
|
92
93
|
@has_sessions = false
|
|
93
94
|
@object_counter = Counter.new
|
|
94
95
|
end
|
|
95
96
|
|
|
96
|
-
def
|
|
97
|
+
def sessions?
|
|
97
98
|
@has_sessions
|
|
98
99
|
end
|
|
99
100
|
|
|
100
101
|
def add_session_info(hmac_session_id, user_id, ip_address, user_agent)
|
|
101
102
|
if @object_counter.counter >= 250
|
|
102
|
-
TCellAgent.logger.warn(
|
|
103
|
+
TCellAgent.logger.warn('Sessions Metric is full. Information dropped')
|
|
103
104
|
|
|
104
105
|
else
|
|
105
|
-
self[
|
|
106
|
-
self[
|
|
106
|
+
self['sessions'][hmac_session_id] =
|
|
107
|
+
self['sessions'].fetch(hmac_session_id, UserSessionMetric.new(@object_counter))
|
|
107
108
|
|
|
108
109
|
@has_sessions = true
|
|
109
110
|
|
|
110
111
|
truncated_agent = truncated_user_agent(user_agent)
|
|
111
|
-
self[
|
|
112
|
+
self['sessions'][hmac_session_id].add_user_id_user_agent_ip(user_id, truncated_agent, ip_address)
|
|
112
113
|
|
|
113
|
-
if @object_counter.counter >= 200
|
|
114
|
-
@flush = true
|
|
115
|
-
end
|
|
114
|
+
@flush = true if @object_counter.counter >= 200
|
|
116
115
|
end
|
|
117
116
|
end
|
|
118
117
|
|
|
@@ -2,22 +2,20 @@ require 'tcell_agent/sensor_events/sensor'
|
|
|
2
2
|
|
|
3
3
|
module TCellAgent
|
|
4
4
|
module SensorEvents
|
|
5
|
-
|
|
6
5
|
class PatchesEvent < TCellSensorEvent
|
|
7
6
|
def initialize(rust_response, appsensor_meta)
|
|
8
|
-
super(
|
|
7
|
+
super('patches')
|
|
9
8
|
|
|
10
|
-
self[
|
|
11
|
-
self[
|
|
12
|
-
self[
|
|
13
|
-
self[
|
|
14
|
-
self[
|
|
15
|
-
self[
|
|
16
|
-
self[
|
|
17
|
-
self[
|
|
18
|
-
self[
|
|
9
|
+
self['patches_pid'] = rust_response['patches_policy_id']
|
|
10
|
+
self['rule_id'] = rust_response['rule_id']
|
|
11
|
+
self['action'] = 'blocked'
|
|
12
|
+
self['sz'] = appsensor_meta.request_content_bytes_len if appsensor_meta.request_content_bytes_len
|
|
13
|
+
self['m'] = appsensor_meta.method if appsensor_meta.method
|
|
14
|
+
self['remote_addr'] = appsensor_meta.remote_address if appsensor_meta.remote_address
|
|
15
|
+
self['uri'] = TCellAgent::SensorEvents::Util.strip_uri_values(appsensor_meta.location) if appsensor_meta.location
|
|
16
|
+
self['regex_pid'] = rust_response['regex_pid'] if rust_response['regex_pid']
|
|
17
|
+
self['payload'] = rust_response['payload'] if rust_response['payload']
|
|
19
18
|
end
|
|
20
19
|
end
|
|
21
|
-
|
|
22
20
|
end
|
|
23
21
|
end
|
|
@@ -6,7 +6,6 @@ require 'uri'
|
|
|
6
6
|
|
|
7
7
|
module TCellAgent
|
|
8
8
|
module SensorEvents
|
|
9
|
-
|
|
10
9
|
class TCellSensorEvent < Hash
|
|
11
10
|
attr_accessor :send, :flush, :ensure
|
|
12
11
|
|
|
@@ -14,37 +13,35 @@ module TCellAgent
|
|
|
14
13
|
@send = true
|
|
15
14
|
@flush = false
|
|
16
15
|
@ensure = false
|
|
17
|
-
@timestamp =
|
|
18
|
-
self[
|
|
16
|
+
@timestamp = Time.now.to_i
|
|
17
|
+
self['event_type'] = event_type
|
|
19
18
|
end
|
|
20
19
|
|
|
21
|
-
def
|
|
22
|
-
self[
|
|
20
|
+
def calculate_offset(from_timestamp)
|
|
21
|
+
self['offset'] = from_timestamp - @timestamp
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
def post_process
|
|
26
25
|
# This is called in the background thread, so any
|
|
27
|
-
#
|
|
26
|
+
# santization, analysis, etc doesn't get in the way
|
|
28
27
|
end
|
|
29
28
|
|
|
30
29
|
def bucket_key
|
|
31
|
-
|
|
30
|
+
nil
|
|
32
31
|
end
|
|
33
32
|
end
|
|
34
33
|
|
|
35
34
|
class TCellHttpTxSensorEvent < TCellSensorEvent
|
|
36
35
|
def initialize(request, response)
|
|
37
|
-
super(
|
|
36
|
+
super('http_tx')
|
|
38
37
|
@raw_request = request
|
|
39
38
|
@raw_response = response
|
|
40
39
|
end
|
|
40
|
+
|
|
41
41
|
def post_process
|
|
42
|
-
if defined
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if defined?@raw_response
|
|
46
|
-
self["response"] = Util.response_sanitized_json(@raw_response)
|
|
47
|
-
end
|
|
42
|
+
self['request'] = Util.request_sanitized_json(@raw_request) if defined? @raw_request
|
|
43
|
+
|
|
44
|
+
self['response'] = Util.response_sanitized_json(@raw_response) if defined? @raw_response
|
|
48
45
|
end
|
|
49
46
|
end
|
|
50
47
|
|
|
@@ -56,38 +53,37 @@ module TCellAgent
|
|
|
56
53
|
route_id,
|
|
57
54
|
status_code,
|
|
58
55
|
remote_addr,
|
|
59
|
-
hmac_session_id=nil,
|
|
60
|
-
user_id=nil)
|
|
61
|
-
super(
|
|
62
|
-
self[
|
|
63
|
-
self[
|
|
64
|
-
self[
|
|
65
|
-
self[
|
|
66
|
-
self[
|
|
67
|
-
self[
|
|
68
|
-
self[
|
|
69
|
-
self[
|
|
70
|
-
self[
|
|
56
|
+
hmac_session_id = nil,
|
|
57
|
+
user_id = nil)
|
|
58
|
+
super('redirect')
|
|
59
|
+
self['method'] = method
|
|
60
|
+
self['from_domain'] = original_domain
|
|
61
|
+
self['status_code'] = status_code
|
|
62
|
+
self['remote_addr'] = remote_addr
|
|
63
|
+
self['to'] = redirect_domain
|
|
64
|
+
self['uid'] = user_id.to_s if user_id
|
|
65
|
+
self['from'] = Util.strip_uri_values(original_url)
|
|
66
|
+
self['rid'] = route_id if route_id
|
|
67
|
+
self['sid'] = hmac_session_id if hmac_session_id
|
|
71
68
|
end
|
|
72
69
|
end
|
|
73
70
|
|
|
74
71
|
class TCellFingerprintSensorEvent < TCellSensorEvent
|
|
75
|
-
def initialize(request, hmac_session_id, user_id=nil)
|
|
76
|
-
super(
|
|
72
|
+
def initialize(request, hmac_session_id, user_id = nil)
|
|
73
|
+
super('fingerprint')
|
|
77
74
|
@raw_request = request
|
|
78
75
|
@hmac_session_id = hmac_session_id
|
|
79
76
|
@user_id = user_id
|
|
80
77
|
end
|
|
78
|
+
|
|
81
79
|
def post_process
|
|
82
|
-
|
|
83
|
-
raise
|
|
84
|
-
end
|
|
85
|
-
self["ua"] = @raw_request.headers["HTTP_USER_AGENT"]
|
|
86
|
-
self["ip"] = @raw_request.remote_ip
|
|
87
|
-
self["sid"] = @hmac_session_id
|
|
88
|
-
if @user_id
|
|
89
|
-
self["uid"] = @user_id
|
|
80
|
+
unless @raw_request.headers.key?('HTTP_USER_AGENT')
|
|
81
|
+
raise 'User Agent not Found!'
|
|
90
82
|
end
|
|
83
|
+
self['ua'] = @raw_request.headers['HTTP_USER_AGENT']
|
|
84
|
+
self['ip'] = @raw_request.remote_ip
|
|
85
|
+
self['sid'] = @hmac_session_id
|
|
86
|
+
self['uid'] = @user_id if @user_id
|
|
91
87
|
end
|
|
92
88
|
end
|
|
93
89
|
end
|
|
@@ -7,141 +7,144 @@ require 'tcell_agent/sensor_events/util/utils'
|
|
|
7
7
|
require 'etc'
|
|
8
8
|
|
|
9
9
|
module TCellAgent
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
module SensorEvents
|
|
11
|
+
class FlushDummyEvent < TCellSensorEvent
|
|
12
|
+
def initialize
|
|
13
|
+
super('dummy')
|
|
14
|
+
@send = false
|
|
15
|
+
@flush = true
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class ServerAgentDetailsSensorEvent < TCellSensorEvent
|
|
20
|
+
def initialize
|
|
21
|
+
super('server_agent_details')
|
|
22
|
+
@flush = true
|
|
23
|
+
@ensure = true
|
|
24
|
+
|
|
25
|
+
self['user'] = 'unknown'
|
|
26
|
+
self['group'] = 'unknown'
|
|
27
|
+
|
|
28
|
+
begin
|
|
29
|
+
login = Etc.getlogin
|
|
30
|
+
if login
|
|
31
|
+
self['user'] = login
|
|
32
|
+
begin
|
|
33
|
+
info = Etc.getpwnam(login)
|
|
34
|
+
self['group'] = info.gid.to_s
|
|
35
|
+
rescue StandardError => te
|
|
36
|
+
TCellAgent.logger.warn("Exception finding group id: #{te.message}")
|
|
37
|
+
TCellAgent.logger.debug(te.backtrace)
|
|
38
|
+
end
|
|
16
39
|
end
|
|
40
|
+
rescue StandardError => to
|
|
41
|
+
TCellAgent.logger.warn("Exception finding user & group: #{to.message}")
|
|
42
|
+
TCellAgent.logger.debug(te.backtrace)
|
|
17
43
|
end
|
|
18
|
-
class ServerAgentDetailsSensorEvent < TCellSensorEvent
|
|
19
|
-
def initialize
|
|
20
|
-
super("server_agent_details")
|
|
21
|
-
@flush = true
|
|
22
|
-
@ensure = true
|
|
23
44
|
|
|
24
|
-
|
|
25
|
-
|
|
45
|
+
TCellAgent.logger.debug("User #{self['user']}")
|
|
46
|
+
TCellAgent.logger.debug("Group #{self['group']}")
|
|
47
|
+
end
|
|
48
|
+
end
|
|
26
49
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
TCellAgent.logger.debug(te.backtrace)
|
|
37
|
-
end
|
|
38
|
-
end
|
|
50
|
+
class ServerAgentDetailsLanguageEvent < TCellSensorEvent
|
|
51
|
+
def initialize(language, language_version)
|
|
52
|
+
super('server_agent_details')
|
|
53
|
+
@flush = true
|
|
54
|
+
@ensure = true
|
|
55
|
+
self['language'] = language
|
|
56
|
+
self['language_version'] = language_version
|
|
57
|
+
end
|
|
58
|
+
end
|
|
39
59
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
60
|
+
class ServerAgentAppFrameworkEvent < TCellSensorEvent
|
|
61
|
+
def initialize(framework_name, framework_version)
|
|
62
|
+
super('server_agent_details')
|
|
63
|
+
@flush = true
|
|
64
|
+
@ensure = true
|
|
65
|
+
self['app_framework'] = framework_name
|
|
66
|
+
self['app_framework_version'] = framework_version
|
|
67
|
+
end
|
|
68
|
+
end
|
|
44
69
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
class ServerAgentPackagesSensorEvent < TCellSensorEvent
|
|
71
|
+
def initialize
|
|
72
|
+
super('server_agent_packages')
|
|
73
|
+
@flush = true
|
|
74
|
+
@ensure = true
|
|
75
|
+
packages = []
|
|
76
|
+
Gem.loaded_specs.values.map do |x|
|
|
77
|
+
begin
|
|
78
|
+
if x.name
|
|
79
|
+
package = { 'n' => x.name, 'v' => x.version.version }
|
|
80
|
+
packages.push(package)
|
|
81
|
+
TCellAgent.logger.debug("Adding packages #{x.name}")
|
|
56
82
|
end
|
|
83
|
+
rescue StandardError => te
|
|
84
|
+
TCellAgent.logger.error("Exception adding package: #{te.message}")
|
|
85
|
+
TCellAgent.logger.debug(te.backtrace)
|
|
86
|
+
end
|
|
57
87
|
end
|
|
88
|
+
self['packages'] = packages
|
|
89
|
+
end
|
|
90
|
+
end
|
|
58
91
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
class AppCookie < TCellSensorEvent
|
|
118
|
-
def initialize(name, value, secure, http_only, session)
|
|
119
|
-
super("appserver_framework_setting")
|
|
120
|
-
@flush = false
|
|
121
|
-
@ensure = true
|
|
122
|
-
self["n"] = name
|
|
123
|
-
self["v"] = value
|
|
124
|
-
self["http_only"] = http_only
|
|
125
|
-
self["secure"] = secure
|
|
126
|
-
self["session"] = session
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
class AppRoutesSensorEvent < TCellSensorEvent
|
|
130
|
-
def initialize(uri, method, route_id, params=nil, destination=nil)
|
|
131
|
-
super("appserver_routes")
|
|
132
|
-
@flush = false
|
|
133
|
-
@ensure = true
|
|
134
|
-
method = method.downcase
|
|
135
|
-
self["uri"] = uri
|
|
136
|
-
self["method"] = method
|
|
137
|
-
self["rid"] = route_id
|
|
138
|
-
if (params)
|
|
139
|
-
self["params"] = params
|
|
140
|
-
end
|
|
141
|
-
if (destination)
|
|
142
|
-
self["destination"] = destination
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
end
|
|
92
|
+
class AppFramework < TCellSensorEvent
|
|
93
|
+
def initialize(name, version)
|
|
94
|
+
super('appserver_framework')
|
|
95
|
+
@flush = false
|
|
96
|
+
@ensure = true
|
|
97
|
+
self['n'] = name
|
|
98
|
+
self['v'] = version
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
class AppAuthFramework < TCellSensorEvent
|
|
103
|
+
def initialize(name, version)
|
|
104
|
+
super('appserver_auth_framework')
|
|
105
|
+
@flush = false
|
|
106
|
+
@ensure = true
|
|
107
|
+
self['n'] = name
|
|
108
|
+
self['v'] = version
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class AppFrameworkSetting < TCellSensorEvent
|
|
113
|
+
def initialize(framework_name, setting, value)
|
|
114
|
+
super('appserver_framework_setting')
|
|
115
|
+
@flush = false
|
|
116
|
+
@ensure = true
|
|
117
|
+
self['framework'] = framework_name
|
|
118
|
+
self['s'] = setting
|
|
119
|
+
self['v'] = value
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
class AppCookie < TCellSensorEvent
|
|
124
|
+
def initialize(name, value, secure, http_only, session)
|
|
125
|
+
super('appserver_framework_setting')
|
|
126
|
+
@flush = false
|
|
127
|
+
@ensure = true
|
|
128
|
+
self['n'] = name
|
|
129
|
+
self['v'] = value
|
|
130
|
+
self['http_only'] = http_only
|
|
131
|
+
self['secure'] = secure
|
|
132
|
+
self['session'] = session
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
class AppRoutesSensorEvent < TCellSensorEvent
|
|
137
|
+
def initialize(uri, method, route_id, params = nil, destination = nil)
|
|
138
|
+
super('appserver_routes')
|
|
139
|
+
@flush = false
|
|
140
|
+
@ensure = true
|
|
141
|
+
method = method.downcase
|
|
142
|
+
self['uri'] = uri
|
|
143
|
+
self['method'] = method
|
|
144
|
+
self['rid'] = route_id
|
|
145
|
+
self['params'] = params if params
|
|
146
|
+
self['destination'] = destination if destination
|
|
147
|
+
end
|
|
146
148
|
end
|
|
149
|
+
end
|
|
147
150
|
end
|