tcell_agent 1.1.10 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -97
- data/lib/tcell_agent/rust/libtcellagent-1.3.2.dylib +0 -0
- data/lib/tcell_agent/rust/{libtcellagent-1.3.1.so → libtcellagent-1.3.2.so} +0 -0
- data/lib/tcell_agent/rust/libtcellagent-alpine-1.3.2.so +0 -0
- data/lib/tcell_agent/rust/tcellagent-1.3.2.dll +0 -0
- data/lib/tcell_agent/rust/whisperer.rb +1 -1
- data/lib/tcell_agent/tcell_context.rb +17 -17
- data/lib/tcell_agent/version.rb +1 -1
- metadata +6 -6
- data/lib/tcell_agent/rust/libtcellagent-1.3.1.dylib +0 -0
- data/lib/tcell_agent/rust/libtcellagent-alpine-1.3.1.so +0 -0
- data/lib/tcell_agent/rust/tcellagent-1.3.1.dll +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 551e5d85f546219d1832b6392e84881eb019b670fc51f86d28be6dfa1b0f94ae
|
4
|
+
data.tar.gz: 2cc3d40b2ae1d360cc19c39c86428019c656e257ba55be60c39bc8235657fabf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b5e2c2ef86eba52860ff5101508ac80fd55621b8381ff06e58a5cc19086bdc893b47103bc2c50c5d02ade6a8fb6a033058ec1df3c114d1f8ca6632c8b0d56a
|
7
|
+
data.tar.gz: c683422e7bc12498a73d1276df558be9b96e46e4882874e5d949a4fd390c63f351ab682b36a880b097d02390ff07e52a198e5b82a2c16cba101b6be3ec4f8d94
|
data/README.md
CHANGED
@@ -1,120 +1,48 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
## Release Process Checklist
|
6
|
-
|
7
|
-
Open a jira with the following checklist (sample: https://jira.tcell.io/browse/RA-98)
|
8
|
-
|
9
|
-
|
10
|
-
[ X ] unit tests pass
|
11
|
-
[ X ] integration tests pass
|
12
|
-
[ X ] test-kit tests pass (all variants)
|
13
|
-
[ X ] check test-kit logs for any unexpected errors
|
14
|
-
[ X ] performance tests pass (https://github.com/tcellio/load-testing/tree/master/agents)
|
15
|
-
[ X ] update changelog and version (sample https://github.com/tcellio/rubyagent-tcell/pull/275)
|
16
|
-
|
17
|
-
[ X ] manual install verified working (`make build`, install gem globally: `gem install tcell_agent-x.x.x.gem` works properly)
|
18
|
-
[ X ] run `tcell_agent test` command (might not be needed, since this is run in test-kit for every test-app)
|
19
|
-
|
20
|
-
[ X ] Update Master Branch
|
21
|
-
|
22
|
-
[ X ] ensure unknown_options accounts for any new keys (check `lib/tcell_agent/config/unknown_options.rb` file for logic)
|
23
|
-
[ X ] update support page in wiki with any new support (https://tcellio.atlassian.net/wiki/spaces/EN/pages/54460460/Server+Agent+Support)
|
24
|
-
|
25
|
-
Repeat if any bugs are found and patched
|
1
|
+
# RubyAgent
|
2
|
+
A Ruby security agent to instrument Ruby web applications. Additional docs can be found [here](https://docs.tcell.io/docs/ruby-agent-install)
|
3
|
+
## Installation
|
26
4
|
|
27
|
-
|
5
|
+
Add this line to your Gemfile to install the gem directly from [RubyGems](https://rubygems.org)
|
28
6
|
|
29
|
-
|
30
|
-
[ X ] run `make build` on release branch (`gem unpack tcell_agent-x.x.x.gem` and manually inspect .gem file to make sure no files are missing and no extra files are included)
|
31
|
-
[ X ] upload to rubygems (`gem push tcell_agent-x.x.x.gem`)
|
32
|
-
[ X ] confirm upload worked by running a test app that installs latest version from rubygems and smoke test
|
7
|
+
$ gem 'tcell_agent'
|
33
8
|
|
34
|
-
|
9
|
+
or to use a local version directly,
|
35
10
|
|
36
|
-
|
11
|
+
$ gem 'tcell_agent', :path => '<path-to-gem-repo'
|
37
12
|
|
38
|
-
|
13
|
+
and to install the gem,
|
39
14
|
|
40
|
-
|
15
|
+
$ bundle install
|
41
16
|
|
42
|
-
|
17
|
+
## Usage
|
43
18
|
|
44
|
-
|
19
|
+
Download the config file from the tCell dashboard and move it to the `config` directory of the application.
|
45
20
|
|
46
|
-
|
21
|
+
$ cp ~/Downloads/tcell_agent.config config/
|
47
22
|
|
48
|
-
|
23
|
+
When the server is started, tCell will be running. The log files will be created in the `tcell` directory of the project.
|
49
24
|
|
25
|
+
Alternatively, Rails initializers can be used instead of adding the `tcell_agent.config` file. The values for the fields can be found in `tcell_agent.config`. Here's a sample `config/initializers/tcell.rb`:
|
50
26
|
```
|
51
27
|
if defined?(TCellAgent)
|
52
28
|
TCellAgent.configure do |config|
|
53
29
|
config.app_id = "---APP_ID---"
|
54
30
|
config.api_key = "---API_KEY---"
|
55
|
-
config.agent_log_dir = "
|
56
|
-
config.agent_home_dir = "
|
57
|
-
config.tcell_api_url = "
|
58
|
-
config.tcell_input_url = "
|
31
|
+
config.agent_log_dir = "---path-to-logs-dir---"
|
32
|
+
config.agent_home_dir = "--path-to-tcell-dir---"
|
33
|
+
config.tcell_api_url = ""
|
34
|
+
config.tcell_input_url = ""
|
59
35
|
config.allow_payloads = true
|
60
|
-
# Removed for ruby 2.0
|
61
|
-
# config.agent_home_owner = "boris"
|
62
|
-
config.enabled = true
|
63
|
-
config.logging_options = {"enabled" => true, "level" => "DEBUG"}
|
64
|
-
config.host_identifier = "foomyserver"
|
65
|
-
config.log_tag = "TCELL_LOGS"
|
66
|
-
# Removed for ruby 2.0
|
67
|
-
# config.logger can no longer be supported after rubyagent v1.1.4 since logging is now handled by libtcellagent
|
68
|
-
# config.logger = Rails.logger
|
69
|
-
# or
|
70
|
-
# config.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT))
|
71
36
|
end
|
72
37
|
end
|
73
38
|
```
|
74
39
|
|
75
|
-
|
76
|
-
|
77
|
-
Log Tag (see above for example `log_tag` set in config) - Since rubyagent log can be printed to STDOUT along with all the other logging, `log_tag` is a custom string added to every log line to be able to filter just tcell log lines.
|
78
|
-
|
79
|
-
Logger object - Up until rubyagent v1.1.4 you could set a Rails.logger for the rubyagent to use for its logging. With the migration to have libtcellagent handle logging, that use case can no longer be supported. This feature was mainly used to get the rubyagent to log to STDOUT in heroku deployments. So as long as the agent supports some config to allow to log to STDOUT, this won't be missed.
|
80
|
-
|
81
|
-
## Installation
|
82
|
-
|
83
|
-
Download the GEM file and unpack it:
|
40
|
+
## Troubleshooting
|
84
41
|
|
85
|
-
|
86
|
-
|
87
|
-
In your rails directory
|
88
|
-
|
89
|
-
$ mv tcell_agent-0.2.0.gem vendor/cache/
|
90
|
-
$ bundle install
|
91
|
-
|
92
|
-
Add this line to your application's Gemfile:
|
93
|
-
|
94
|
-
|
95
|
-
```ruby
|
96
|
-
gem 'tcell_agent', '0.2.0'
|
97
|
-
```
|
98
|
-
or if you're using the repository directly.
|
99
|
-
```ruby
|
100
|
-
gem "tcell_agent", :path => "<path to your tcell_agent repo>"
|
42
|
+
Log level can be customized in `tcell_agent.config` by adding a block such as:
|
101
43
|
```
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
## Usage
|
108
|
-
|
109
|
-
You can download the config file from the Agents section of the application then move it to the config directory
|
110
|
-
|
111
|
-
$ cp ~/Downloads/tcell_agent.config config/
|
112
|
-
|
113
|
-
Or run the helper command
|
114
|
-
|
115
|
-
$ bundle exec tcell_agent setup
|
116
|
-
|
117
|
-
Or if running from the repo:
|
118
|
-
|
119
|
-
$ bundle exec <path to repo>/rubyagent-tcell/bin/tcell_agent
|
120
|
-
|
44
|
+
"logging_options": {
|
45
|
+
"enabled": true,
|
46
|
+
"level": "INFO"
|
47
|
+
}
|
48
|
+
```
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -4,7 +4,7 @@ require 'tcell_agent/logger'
|
|
4
4
|
require 'tcell_agent/utils/params'
|
5
5
|
require 'cgi'
|
6
6
|
|
7
|
-
TCELL_MAX_BODY_LENGTH =
|
7
|
+
TCELL_MAX_BODY_LENGTH = 50_000
|
8
8
|
|
9
9
|
# TODO(ralba): move TCellData from instrumentation.rb here
|
10
10
|
# and merge both models into one and drop usage of MetaData.
|
@@ -100,14 +100,13 @@ module TCellAgent
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def headers_dict=(value)
|
103
|
-
headers_dict = value.select do |
|
104
|
-
|
105
|
-
|
106
|
-
%w[content_type content_length].include?(header_downcased)
|
103
|
+
headers_dict = value.select do |header_key, _v|
|
104
|
+
(header_key != 'HTTP_COOKIE' && header_key.start_with?('HTTP_')) ||
|
105
|
+
%w[CONTENT_TYPE CONTENT_LENGTH].include?(header_key)
|
107
106
|
end
|
108
107
|
|
109
108
|
headers_dict = headers_dict.each_with_object({}) do |(k, v), memo|
|
110
|
-
memo[k.
|
109
|
+
memo[k.sub(/^HTTP_/, '').tr('_', '-').downcase] = v
|
111
110
|
end
|
112
111
|
@flattened_headers_dict = TCellAgent::Utils::Params.flatten(headers_dict)
|
113
112
|
end
|
@@ -121,18 +120,19 @@ module TCellAgent
|
|
121
120
|
end
|
122
121
|
|
123
122
|
def get_raw_post_data(request)
|
124
|
-
if request.
|
125
|
-
|
126
|
-
|
127
|
-
body = request.body
|
128
|
-
# Positions strio to the beginning of input, resetting lineno to zero.
|
129
|
-
# rails 4.1 seems to read the stringIO directly and so body.gets is empty
|
130
|
-
# this is called
|
131
|
-
body.rewind if body.respond_to?(:rewind)
|
132
|
-
raw_post_data = body.read(request.content_length.to_i) if request.content_length
|
133
|
-
body.rewind if body.respond_to?(:rewind)
|
123
|
+
content_length = request.content_length.to_i if request.content_length
|
124
|
+
if !content_length.nil? && content_length > TCELL_MAX_BODY_LENGTH || request.content_type.nil?
|
125
|
+
return nil
|
134
126
|
end
|
135
|
-
raw_post_data
|
127
|
+
raw_post_data = nil
|
128
|
+
# Positions strio to the beginning of input, resetting lineno to zero.
|
129
|
+
# rails 4.1 seems to read the stringIO directly and so body.gets is empty
|
130
|
+
# this is called
|
131
|
+
body.rewind if body.respond_to?(:rewind)
|
132
|
+
body = request.body
|
133
|
+
raw_post_data = body.read(request.content_length.to_i) if request.content_length
|
134
|
+
body.rewind if body.respond_to?(:rewind)
|
135
|
+
raw_post_data
|
136
136
|
end
|
137
137
|
|
138
138
|
def set_parameter_dicts(request)
|
data/lib/tcell_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tcell_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -160,11 +160,11 @@ files:
|
|
160
160
|
- lib/tcell_agent/rails/settings_reporter.rb
|
161
161
|
- lib/tcell_agent/rails/tcell_body_proxy.rb
|
162
162
|
- lib/tcell_agent/routes/table.rb
|
163
|
-
- lib/tcell_agent/rust/libtcellagent-1.3.
|
164
|
-
- lib/tcell_agent/rust/libtcellagent-1.3.
|
165
|
-
- lib/tcell_agent/rust/libtcellagent-alpine-1.3.
|
163
|
+
- lib/tcell_agent/rust/libtcellagent-1.3.2.dylib
|
164
|
+
- lib/tcell_agent/rust/libtcellagent-1.3.2.so
|
165
|
+
- lib/tcell_agent/rust/libtcellagent-alpine-1.3.2.so
|
166
166
|
- lib/tcell_agent/rust/models.rb
|
167
|
-
- lib/tcell_agent/rust/tcellagent-1.3.
|
167
|
+
- lib/tcell_agent/rust/tcellagent-1.3.2.dll
|
168
168
|
- lib/tcell_agent/rust/whisperer.rb
|
169
169
|
- lib/tcell_agent/sensor_events/app_config.rb
|
170
170
|
- lib/tcell_agent/sensor_events/appsensor_event.rb
|
Binary file
|
Binary file
|
Binary file
|