blouson 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -13
- data/CHANGELOG.md +3 -0
- data/README.md +29 -0
- data/gemfiles/{rails_4.0.gemfile → rails_5.2.gemfile} +1 -2
- data/lib/blouson.rb +1 -0
- data/lib/blouson/engine.rb +8 -0
- data/lib/blouson/sensitive_mail_log_filter.rb +17 -0
- data/lib/blouson/version.rb +1 -1
- metadata +5 -6
- data/gemfiles/rails_4.1.gemfile +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ad669af9102968f46d5359d6d286e7abe8a67f377c66dc59c42ea58e25082c1
|
4
|
+
data.tar.gz: dd62f6ea3a7bc021dbe9ea22aef53ad1208f954f5a9dcfbe795126eb4fd31d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f43a624ded7239bd0651503a2893f9a7a8e7a10aa178cf06fd6520dda27b534374d35fcbd539d8c6d6bd0113ddcc2132c87d87fcefe83d8a0e3b2ce2cfdaa627
|
7
|
+
data.tar.gz: b645e860e18ddf99e36bc758a3982cf40796fc73c10eabb2229bed0d0a964b7ed3b9046841ad1ac8e6d7063225d9913d8aced500913fdfb71ddd7249f133db0c
|
data/.travis.yml
CHANGED
@@ -1,20 +1,17 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
|
+
services:
|
4
|
+
- mysql
|
3
5
|
gemfile:
|
4
|
-
- gemfiles/rails_4.0.gemfile
|
5
|
-
- gemfiles/rails_4.1.gemfile
|
6
6
|
- gemfiles/rails_4.2.gemfile
|
7
7
|
- gemfiles/rails_5.0.gemfile
|
8
8
|
- gemfiles/rails_5.1.gemfile
|
9
|
+
- gemfiles/rails_5.2.gemfile
|
9
10
|
rvm:
|
10
|
-
- 2.
|
11
|
-
- 2.
|
12
|
-
- 2.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
gemfile: gemfiles/rails_4.0.gemfile
|
18
|
-
- rvm: 2.4.1
|
19
|
-
gemfile: gemfiles/rails_4.1.gemfile
|
20
|
-
before_install: gem install --no-document bundler
|
11
|
+
- 2.3.8
|
12
|
+
- 2.4.6
|
13
|
+
- 2.5.5
|
14
|
+
- 2.6.3
|
15
|
+
before_install:
|
16
|
+
- "[[ $BUNDLE_GEMFILE =~ rails_4\\.2 ]] && gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true"
|
17
|
+
- "[[ $BUNDLE_GEMFILE =~ rails_4\\.2 ]] && gem install bundler -v '< 2' || true"
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,6 +8,7 @@ Blouson is a filter tool for Rails to conceal sensitive data from various logs.
|
|
8
8
|
- SQL query in Rails log
|
9
9
|
- Exception messages in `ActiveRecord::StatementInvalid`
|
10
10
|
- Sentry Raven parameters
|
11
|
+
- Mail parameters in Rails log
|
11
12
|
|
12
13
|
## Installation
|
13
14
|
|
@@ -80,6 +81,34 @@ Raven.configure do |config|
|
|
80
81
|
end
|
81
82
|
```
|
82
83
|
|
84
|
+
### SensitiveMailLogFilter
|
85
|
+
ActionMailer outputs email address, all headers, and body text to the log when sending email.
|
86
|
+
|
87
|
+
```
|
88
|
+
D, [2019-08-08T08:40:15.939251 #67674] DEBUG -- : UserMailer#hello: processed outbound mail in 43.0ms
|
89
|
+
I, [2019-08-08T08:40:15.946281 #67674] INFO -- : Sent mail to xxx@example.com (6.3ms)
|
90
|
+
D, [2019-08-08T08:40:15.946432 #67674] DEBUG -- : Date: Thu, 08 Aug 2019 08:40:15 +0900
|
91
|
+
From: from@example.com
|
92
|
+
To: xxx@example.com
|
93
|
+
Message-ID: <xxx>
|
94
|
+
Subject: Hello
|
95
|
+
Mime-Version: 1.0
|
96
|
+
Content-Type: text/plain; charset=UTF-8
|
97
|
+
Content-Transfer-Encoding: 7bit
|
98
|
+
|
99
|
+
Example mail.
|
100
|
+
```
|
101
|
+
|
102
|
+
Blouson filters such logs.
|
103
|
+
|
104
|
+
Example:
|
105
|
+
|
106
|
+
```
|
107
|
+
D, [2019-08-08T08:47:06.524182 #67886] DEBUG -- : UserMailer#hello: processed outbound mail in 23.2ms
|
108
|
+
I, [2019-08-08T08:47:06.530849 #67886] INFO -- : Sent mail to [FILTERED] (6.4ms)
|
109
|
+
D, [2019-08-08T08:47:06.530953 #67886] DEBUG -- : [Blouson::SensitiveMailLogFilter] Mail data is filtered for sensitive data
|
110
|
+
```
|
111
|
+
|
83
112
|
## Contributing
|
84
113
|
|
85
114
|
Bug reports and pull requests are welcome on GitHub at https://github.com/cookpad/blouson.
|
data/lib/blouson.rb
CHANGED
data/lib/blouson/engine.rb
CHANGED
@@ -22,5 +22,13 @@ module Blouson
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
initializer 'blouson.set_sensitive_mail_log_filter' do |app|
|
27
|
+
if Rails.env.production? || ENV['ENABLE_SENSITIVE_MAIL_LOG_FILTER'] == '1'
|
28
|
+
ActiveSupport.on_load(:action_mailer) do
|
29
|
+
ActionMailer::LogSubscriber.prepend Blouson::SensitiveMailLogFilter
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
25
33
|
end
|
26
34
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Blouson
|
2
|
+
module SensitiveMailLogFilter
|
3
|
+
def deliver(event)
|
4
|
+
e = ActiveSupport::Notifications::Event.new(
|
5
|
+
event.name,
|
6
|
+
event.time,
|
7
|
+
event.end,
|
8
|
+
event.transaction_id,
|
9
|
+
event.payload.merge(
|
10
|
+
to: Blouson::FILTERED,
|
11
|
+
mail: "[Blouson::SensitiveMailLogFilter] Mail data is filtered for sensitive data"
|
12
|
+
)
|
13
|
+
)
|
14
|
+
super(e)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/blouson/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blouson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cookpad Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -155,14 +155,14 @@ files:
|
|
155
155
|
- bin/console
|
156
156
|
- bin/setup
|
157
157
|
- blouson.gemspec
|
158
|
-
- gemfiles/rails_4.0.gemfile
|
159
|
-
- gemfiles/rails_4.1.gemfile
|
160
158
|
- gemfiles/rails_4.2.gemfile
|
161
159
|
- gemfiles/rails_5.0.gemfile
|
162
160
|
- gemfiles/rails_5.1.gemfile
|
161
|
+
- gemfiles/rails_5.2.gemfile
|
163
162
|
- lib/blouson.rb
|
164
163
|
- lib/blouson/engine.rb
|
165
164
|
- lib/blouson/raven_parameter_filter_processor.rb
|
165
|
+
- lib/blouson/sensitive_mail_log_filter.rb
|
166
166
|
- lib/blouson/sensitive_params_silener.rb
|
167
167
|
- lib/blouson/sensitive_query_filter.rb
|
168
168
|
- lib/blouson/sensitive_table_query_log_silencer.rb
|
@@ -187,8 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
|
-
|
191
|
-
rubygems_version: 2.7.6
|
190
|
+
rubygems_version: 3.0.3
|
192
191
|
signing_key:
|
193
192
|
specification_version: 4
|
194
193
|
summary: Filter tools to mask sensitive data in various logs
|