fluent-plugin-anonymizer 0.2.1 → 0.2.2
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 +7 -0
- data/.travis.yml +1 -1
- data/fluent-plugin-anonymizer.gemspec +1 -1
- data/lib/fluent/plugin/out_anonymizer.rb +9 -4
- data/test/plugin/test_out_anonymizer.rb +0 -1
- metadata +17 -27
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 45564782ff7fbdd7681ead462d17b18801158616
|
4
|
+
data.tar.gz: bec14d50db16b39fa28a9a9faa5c408606f31db6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e4a058101e442e58acfabfd0b372cb48bf60b4e9110041daa26b86e39a24a33cc43592156218f6f850b8a488900bef4c41d932dfcef9c496e1af8d56a71f7eb3
|
7
|
+
data.tar.gz: 24eff682117a35d166d9da9738203d794e8a8646479c8314389b870e624127a9a71836ed2ca5f174b5d5db402e0ebd5b8fd09e062c0230ff58fdaf8dd3054d45
|
data/.travis.yml
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-anonymizer"
|
7
|
-
spec.version = "0.2.
|
7
|
+
spec.version = "0.2.2"
|
8
8
|
spec.authors = ["Kentaro Yoshida"]
|
9
9
|
spec.email = ["y.ken.studio@gmail.com"]
|
10
10
|
spec.summary = %q{Fluentd filter output plugin to anonymize records with HMAC of MD5/SHA1/SHA256/SHA384/SHA512 algorithms. This data masking plugin protects privacy data such as UserID, Email, Phone number, IPv4/IPv6 address and so on.}
|
@@ -3,6 +3,11 @@ require 'fluent/mixin/rewrite_tag_name'
|
|
3
3
|
class Fluent::AnonymizerOutput < Fluent::Output
|
4
4
|
Fluent::Plugin.register_output('anonymizer', self)
|
5
5
|
|
6
|
+
# To support log_level option since Fluentd v0.10.43
|
7
|
+
unless method_defined?(:log)
|
8
|
+
define_method(:log) { $log }
|
9
|
+
end
|
10
|
+
|
6
11
|
HASH_ALGORITHM = %w(md5 sha1 sha256 sha384 sha512 ipaddr_mask)
|
7
12
|
config_param :tag, :string, :default => nil
|
8
13
|
config_param :hash_salt, :string, :default => ''
|
@@ -43,7 +48,7 @@ class Fluent::AnonymizerOutput < Fluent::Output
|
|
43
48
|
if @hash_keys.count < 1
|
44
49
|
raise Fluent::ConfigError, "anonymizer: missing hash keys setting."
|
45
50
|
end
|
46
|
-
|
51
|
+
log.info "anonymizer: adding anonymize rules for each field. #{@hash_keys}"
|
47
52
|
|
48
53
|
if ( !@tag && !@remove_tag_prefix && !@remove_tag_suffix && !@add_tag_prefix && !@add_tag_suffix )
|
49
54
|
raise Fluent::ConfigError, "anonymizer: missing remove_tag_prefix, remove_tag_suffix, add_tag_prefix or add_tag_suffix."
|
@@ -72,8 +77,8 @@ class Fluent::AnonymizerOutput < Fluent::Output
|
|
72
77
|
data = anonymize(data, hash_algorithm, @hash_salt)
|
73
78
|
end
|
74
79
|
rescue StandardError => e
|
75
|
-
|
76
|
-
|
80
|
+
log.error "anonymizer: failed to anonymize record. :message=>#{e.message} :data=>#{data}"
|
81
|
+
log.error e.backtrace.join("\n")
|
77
82
|
end
|
78
83
|
data
|
79
84
|
end
|
@@ -87,7 +92,7 @@ class Fluent::AnonymizerOutput < Fluent::Output
|
|
87
92
|
subnet = address.ipv4? ? @ipv4_mask_subnet : @ipv6_mask_subnet
|
88
93
|
address.mask(subnet).to_s
|
89
94
|
else
|
90
|
-
|
95
|
+
log.warn "anonymizer: unknown algorithm #{algorithm} has called."
|
91
96
|
end
|
92
97
|
end
|
93
98
|
end
|
metadata
CHANGED
@@ -1,78 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-anonymizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kentaro Yoshida
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: fluentd
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: fluent-mixin-rewrite-tag-name
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
description:
|
@@ -82,8 +73,8 @@ executables: []
|
|
82
73
|
extensions: []
|
83
74
|
extra_rdoc_files: []
|
84
75
|
files:
|
85
|
-
- .gitignore
|
86
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
87
78
|
- Gemfile
|
88
79
|
- LICENSE
|
89
80
|
- README.md
|
@@ -95,27 +86,26 @@ files:
|
|
95
86
|
homepage: https://github.com/y-ken/fluent-plugin-anonymizer
|
96
87
|
licenses:
|
97
88
|
- Apache License, Version 2.0
|
89
|
+
metadata: {}
|
98
90
|
post_install_message:
|
99
91
|
rdoc_options: []
|
100
92
|
require_paths:
|
101
93
|
- lib
|
102
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
-
none: false
|
104
95
|
requirements:
|
105
|
-
- -
|
96
|
+
- - ">="
|
106
97
|
- !ruby/object:Gem::Version
|
107
98
|
version: '0'
|
108
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
100
|
requirements:
|
111
|
-
- -
|
101
|
+
- - ">="
|
112
102
|
- !ruby/object:Gem::Version
|
113
103
|
version: '0'
|
114
104
|
requirements: []
|
115
105
|
rubyforge_project:
|
116
|
-
rubygems_version:
|
106
|
+
rubygems_version: 2.2.2
|
117
107
|
signing_key:
|
118
|
-
specification_version:
|
108
|
+
specification_version: 4
|
119
109
|
summary: Fluentd filter output plugin to anonymize records with HMAC of MD5/SHA1/SHA256/SHA384/SHA512
|
120
110
|
algorithms. This data masking plugin protects privacy data such as UserID, Email,
|
121
111
|
Phone number, IPv4/IPv6 address and so on.
|