fluent-plugin-sanitizer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +87 -95
- data/fluent-plugin-sanitizer.gemspec +1 -1
- data/lib/fluent/plugin/filter_sanitizer.rb +53 -11
- metadata +2 -12
- data/test/Gemfile +0 -3
- data/test/LICENSE +0 -202
- data/test/README.md +0 -43
- data/test/Rakefile +0 -13
- data/test/fluent-plugin-sanitizer.gemspec +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e6b8ad479091eb0d7ce2f1539ec4966648907f638d5d8e5676d408ea0d4c3ad
|
4
|
+
data.tar.gz: 21a0001319b6b8ec60b478bd60897a20fcca5a068879a0c73531ffb360cd576f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b30b9bec5a8ccc8bf16fcbd3f66bc7ecce7de97778521530eae226b10653b30505f07de47f37246851e6b727152bbd95488614e8d76c96fd0ac3bec3ac2848f0
|
7
|
+
data.tar.gz: 3f31d9ace5c57a733a956e659e3c80c078e3f447d2b9d705c5d9f1e740be6eb214fd21c6750185f89d920b4cbbec51ac8d8f716fad8021a79286ed9e958bf7d0
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# fluent-plugin-sanitizer
|
2
|
+
Sanitizeris [Fluentd](https://fluentd.org/) filter plugin to mask sensitive information. With Sanitizer, you can mask based on key-value pairs on the fly in between Fluentd processes. Sanitizer provides options which enable you to mask values with custom rules. In custom rules, you can specify patterns such as IP addresses, hostnames in FQDN style, regular expressions and keywords. In terms of IP addresses and hostnames, Sanitizer delivers useful options which allows you to easily mask IP addresses and hostnames in complex messages.
|
3
3
|
|
4
4
|
## Installation
|
5
5
|
When you are using OSS Fluentd :
|
@@ -13,15 +13,17 @@ td-agent-gem install fluent-plugin-sanitizer
|
|
13
13
|
|
14
14
|
## Configuration
|
15
15
|
### Parameters
|
16
|
-
- hash_salt :
|
17
|
-
- rule options
|
18
|
-
- keys :
|
19
|
-
- pattern_ipv4 :
|
20
|
-
- pattern_fqdn :
|
21
|
-
- pattern_regex :
|
22
|
-
-
|
16
|
+
- hash_salt (optional) : hash salt used when calculating hash value with original information.
|
17
|
+
- rule options :
|
18
|
+
- keys (mandatory) : Name of keys whose values will be masked. You can specify multiple keys. When keys are nested, you can use {parent key}.{child key} like "kubernetes.master_url".
|
19
|
+
- pattern_ipv4 (optional) : Mask IP addresses in IPv4 format. You can use “true” or “false”. (defalt: false)
|
20
|
+
- pattern_fqdn (optional) : Mask hostname in FQDN style. You can use “true” or “false”. (defalt: false)
|
21
|
+
- pattern_regex (optional) : Mask value mactches custom regular expression. You need to provide a regular expression in these options.
|
22
|
+
- pattern_regex_prefix (optional) : Define prefix used for masking vales. (default: Regex)
|
23
|
+
- pattern_keywords (optional) : Mask values match custom keywords. You can specify multiple keywords.
|
24
|
+
- pattern_keywords_prefix (optional) : Define prefix used for masking vales. (default: Keyword)
|
23
25
|
|
24
|
-
You can specify multiple options in a single rule like following sample
|
26
|
+
You can specify multiple rules in a single configuration. It is also possible to define multiple pattern options in a single rule like the following sample.
|
25
27
|
|
26
28
|
```
|
27
29
|
<filter **>
|
@@ -44,106 +46,96 @@ You can specify multiple options in a single rule like following sample configur
|
|
44
46
|
```
|
45
47
|
|
46
48
|
## Use cases
|
49
|
+
### Mask IP addresses and Hostnames
|
50
|
+
Masking IP addresses and hostnames is one of the typical use cases of security operations. You just need to specify the name of keys that potentially have IP addresses and hostnames in value. Here is a configuration sample as well as input and output samples.
|
47
51
|
|
48
|
-
|
49
|
-
Sample rule #1
|
52
|
+
**Configuration sample**
|
50
53
|
```
|
51
|
-
<
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
```
|
69
|
-
{
|
70
|
-
"ip":"IPv4_94712b06963e277fe28469388323665d",
|
71
|
-
"host":"FQDN_37de34e3d799de477c742d8d7bb35550"
|
72
|
-
}
|
73
|
-
```
|
74
|
-
|
75
|
-
### Sanitize IP addresses and hostnames in between URL and messages
|
76
|
-
You may sanitize IP addresses and hostnames in URL and messages. The "pattern_ipv4" and "pattern_fqdn" options can help you easily to sanitize information in such cases.
|
77
|
-
|
78
|
-
Sample rule #2
|
79
|
-
```
|
80
|
-
<rule>
|
81
|
-
keys system.url, system.log
|
82
|
-
pattern_ipv4 true
|
83
|
-
pattern_fqdn true
|
84
|
-
</rule>
|
85
|
-
```
|
86
|
-
Sample input #2
|
87
|
-
```
|
88
|
-
{
|
89
|
-
"tag":"test",
|
90
|
-
"system" :
|
91
|
-
{
|
92
|
-
"url":"https://test02.demo.com:8000/event",
|
93
|
-
"log":"access from 192.168.10.100 was blocked"
|
94
|
-
}
|
95
|
-
}
|
54
|
+
<filter **>
|
55
|
+
@type sanitizer
|
56
|
+
hash_salt mysalt
|
57
|
+
<rule>
|
58
|
+
keys ip
|
59
|
+
pattern_ipv4 true
|
60
|
+
</rule>
|
61
|
+
<rule>
|
62
|
+
keys host
|
63
|
+
pattern_fqdn true
|
64
|
+
</rule>
|
65
|
+
<rule>
|
66
|
+
keys system.url, system.log
|
67
|
+
pattern_ipv4 true
|
68
|
+
pattern_fqdn true
|
69
|
+
</rule>
|
70
|
+
</filter>
|
96
71
|
```
|
97
|
-
|
72
|
+
**Input sample**
|
98
73
|
```
|
99
|
-
{
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
74
|
+
{
|
75
|
+
"ip" : "192.168.10.10",
|
76
|
+
"host" : "test01.demo.com",
|
77
|
+
"system" : {
|
78
|
+
"url" : "https://test02.demo.com:8000/event",
|
79
|
+
"log" : "access from 192.168.10.100 was blocked"
|
80
|
+
}
|
104
81
|
}
|
105
|
-
}
|
106
|
-
```
|
107
|
-
### Sanitize keywords in between messages
|
108
|
-
When "pattern_keywords" option is selected, fluent-plugin-sanitizer splits messages and sanitizes blocks which match keywords.
|
109
|
-
Sample rule#3
|
110
|
-
```
|
111
|
-
<rule>
|
112
|
-
keys message
|
113
|
-
pattern_keywords user1, application1
|
114
|
-
</rule>
|
115
82
|
```
|
116
|
-
|
83
|
+
**Output sample**
|
117
84
|
```
|
118
|
-
{
|
119
|
-
|
120
|
-
|
85
|
+
{
|
86
|
+
"ip" : "IPv4_94712b06963e277fe28469388323665d",
|
87
|
+
"host" : "FQDN_37de34e3d799de477c742d8d7bb35550",
|
88
|
+
"system" : {
|
89
|
+
"url" : "https://FQDN_e9a59624f555d02f06209c9942dded19:8000/event"
|
90
|
+
"log" : "access from IPv4_f7374d61e6d21dc1105f70358a5f8e8f was blocked"
|
91
|
+
}
|
92
|
+
}
|
121
93
|
```
|
122
|
-
|
94
|
+
### Mask words match custom keyword and regular expression
|
95
|
+
In case log messages including sensitive information such as SSN and phone number, Sanitizer could also help you. If you know the exact keyword that needs to be masked, you can use the keyword option. You can also use the regex option if you like to mask information which matches custom a regular expression.
|
96
|
+
|
97
|
+
**Configuration sample**
|
123
98
|
```
|
124
|
-
|
125
|
-
|
126
|
-
|
99
|
+
<filter **>
|
100
|
+
@type sanitizer
|
101
|
+
hash_salt mysalt
|
102
|
+
<rule>
|
103
|
+
keys user.ssn
|
104
|
+
pattern_regex /^(?!(000|666|9))\d{3}-(?!00)\d{2}-(?!0000)\d{4}$/
|
105
|
+
pattern_regex_prefix SSN
|
106
|
+
</rule>
|
107
|
+
<rule>
|
108
|
+
keys user.phone
|
109
|
+
pattern_regex /^\d{3}-?\d{3}-?\d{4}$/
|
110
|
+
pattern_regex_prefix Phone
|
111
|
+
</rule>
|
112
|
+
</filter>
|
127
113
|
```
|
128
|
-
|
129
|
-
Sample rule #4
|
114
|
+
**Input sample**
|
130
115
|
```
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
116
|
+
{
|
117
|
+
"user" : {
|
118
|
+
"ssn" : "123-45-6789"
|
119
|
+
"phone" : "123-456-7890"
|
120
|
+
}
|
121
|
+
}
|
135
122
|
```
|
136
|
-
|
123
|
+
**Output sample**
|
137
124
|
```
|
138
|
-
{
|
139
|
-
|
140
|
-
|
125
|
+
{
|
126
|
+
"user" : {
|
127
|
+
"ssn" : "SSN_f6b6430343a9a749e12db8a112ca74e9"
|
128
|
+
"phone" : "Phone_0a25187902a0cf755627397eb085d736"
|
129
|
+
}
|
130
|
+
}
|
141
131
|
```
|
142
|
-
|
132
|
+
### Tips : Debug how sanitizer works
|
133
|
+
When you design custom rules in a configuration file, you might need information about how Sanitizer masks original values into hash values for debugging purposes. You can check that information if you run td-agent/Fluentd with debug option enabled. The debug information is shown in the log file of td-agent/Fluentd like the following log message sample.
|
134
|
+
|
135
|
+
**Log message sample**
|
143
136
|
```
|
144
|
-
{
|
145
|
-
|
146
|
-
}
|
137
|
+
YYYY-MM-DD Time fluent.debug: {"message":"[pattern_regex] sanitize '123-45-6789' to 'SSN_f6b6430343a9a749e12db8a112ca74e9'"}
|
138
|
+
YYYY-MM-DD Time fluent.debug: {"message":"[pattern_regex] sanitize '123-456-7890' to 'Phone_0a25187902a0cf755627397eb085d736'"}
|
147
139
|
```
|
148
140
|
## Contribute
|
149
141
|
Contribution to fluent-plugin-sanitizer is always welcomed.
|
@@ -36,6 +36,8 @@ module Fluent
|
|
36
36
|
desc "Sanitize if values mactch custom regular expression (optional)"
|
37
37
|
config_param :pattern_regex, :regexp, default: /^$/
|
38
38
|
desc "Prefix for pattern_regex (optional)"
|
39
|
+
config_param :regex_capture_group, :string, default:""
|
40
|
+
desc "Target capture group name to be masked (optional)"
|
39
41
|
config_param :pattern_regex_prefix, :string, default: "Regex"
|
40
42
|
desc "Sanitize if values mactch custom keywords (optional)"
|
41
43
|
config_param :pattern_keywords, :array, default: []
|
@@ -73,6 +75,7 @@ module Fluent
|
|
73
75
|
|
74
76
|
if rule.pattern_regex.class == Regexp
|
75
77
|
pattern_regex = rule.pattern_regex
|
78
|
+
regex_capture_group = rule.regex_capture_group
|
76
79
|
else
|
77
80
|
raise Fluent::ConfigError, "Your need to specify Regexp for pattern_fqdn option."
|
78
81
|
end
|
@@ -87,18 +90,30 @@ module Fluent
|
|
87
90
|
regex_prefix = rule.pattern_regex_prefix
|
88
91
|
keywords_prefix = rule.pattern_keywords_prefix
|
89
92
|
|
90
|
-
@sanitizerules.push([keys, pattern_ipv4, pattern_fqdn, pattern_regex, pattern_keywords, regex_prefix, keywords_prefix])
|
93
|
+
@sanitizerules.push([keys, pattern_ipv4, pattern_fqdn, pattern_regex, regex_capture_group, pattern_keywords, regex_prefix, keywords_prefix])
|
91
94
|
end
|
92
95
|
end
|
93
96
|
|
94
97
|
def filter(tag, time, record)
|
95
|
-
@sanitizerules.each do |keys, pattern_ipv4, pattern_fqdn, pattern_regex, pattern_keywords, regex_prefix, keywords_prefix|
|
98
|
+
@sanitizerules.each do |keys, pattern_ipv4, pattern_fqdn, pattern_regex, regex_capture_group, pattern_keywords, regex_prefix, keywords_prefix|
|
96
99
|
keys.each do |key|
|
97
100
|
accessor = record_accessor_create("$."+key.to_s)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
101
|
+
if pattern_ipv4 && accessor.call(record)
|
102
|
+
accessor.set(record, sanitize_ipv4_val(accessor.call(record).to_s))
|
103
|
+
end
|
104
|
+
if pattern_fqdn && accessor.call(record)
|
105
|
+
accessor.set(record, sanitize_fqdn_val(accessor.call(record).to_s))
|
106
|
+
end
|
107
|
+
if pattern_regex && accessor.call(record)
|
108
|
+
if regex_capture_group.empty?
|
109
|
+
accessor.set(record, sanitize_regex_val(accessor.call(record).to_s, regex_prefix, pattern_regex))
|
110
|
+
else
|
111
|
+
accessor.set(record, sanitize_regex_val_capture(accessor.call(record).to_s, regex_prefix, pattern_regex, regex_capture_group))
|
112
|
+
end
|
113
|
+
end
|
114
|
+
if !pattern_keywords.empty? && accessor.call(record)
|
115
|
+
accessor.set(record, sanitize_keywords_val(accessor.call(record).to_s, pattern_keywords, keywords_prefix))
|
116
|
+
end
|
102
117
|
end
|
103
118
|
end
|
104
119
|
record
|
@@ -144,8 +159,29 @@ module Fluent
|
|
144
159
|
return "FQDN_"+Digest::MD5.hexdigest(@salt + str)
|
145
160
|
end
|
146
161
|
|
147
|
-
def sanitize_regex(str, prefix)
|
148
|
-
|
162
|
+
def sanitize_regex(str, prefix, regex)
|
163
|
+
if str.to_s.match?(regex)
|
164
|
+
return prefix + "_" + Digest::MD5.hexdigest(@salt + str)
|
165
|
+
else
|
166
|
+
$log.debug "[pattern_regex] #{str} does not match given regex #{regex}. skip this rule."
|
167
|
+
return str
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def sanitize_regex_capture(str, prefix, regex, capture_group)
|
172
|
+
if str.match?(regex)
|
173
|
+
if str.match(regex).names.include?(capture_group)
|
174
|
+
cg = str.match(regex)[capture_group]
|
175
|
+
mask = prefix + "_" + Digest::MD5.hexdigest(@salt + cg)
|
176
|
+
return str.split(cg)[0] + mask + str.split(cg)[1]
|
177
|
+
else
|
178
|
+
$log.debug "[pattern_regex] regex pattern matched but capture group '#{capture_group}' does not exist. Skip this rule."
|
179
|
+
return str
|
180
|
+
end
|
181
|
+
else
|
182
|
+
$log.debug "[pattern_regex] #{str} does not match given regex #{regex}. Skip this rule."
|
183
|
+
return str
|
184
|
+
end
|
149
185
|
end
|
150
186
|
|
151
187
|
def sanitize_keyword(str, prefix)
|
@@ -278,9 +314,15 @@ module Fluent
|
|
278
314
|
end
|
279
315
|
end
|
280
316
|
|
281
|
-
def sanitize_regex_val(v, prefix)
|
282
|
-
s = sanitize_regex(v, prefix)
|
283
|
-
$log.debug "[
|
317
|
+
def sanitize_regex_val(v, prefix, regex)
|
318
|
+
s = sanitize_regex(v, prefix, regex)
|
319
|
+
$log.debug "[pattern_regex] sanitize '#{v}' to '#{s}'" if v != s
|
320
|
+
return s
|
321
|
+
end
|
322
|
+
|
323
|
+
def sanitize_regex_val_capture(v, prefix, regex, capture_group)
|
324
|
+
s = sanitize_regex_capture(v, prefix, regex, capture_group)
|
325
|
+
$log.debug "[pattern_regex] sanitize '#{v}' to '#{s}'" if v != s
|
284
326
|
return s
|
285
327
|
end
|
286
328
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-sanitizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TK Kubota
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,11 +89,6 @@ files:
|
|
89
89
|
- Rakefile
|
90
90
|
- fluent-plugin-sanitizer.gemspec
|
91
91
|
- lib/fluent/plugin/filter_sanitizer.rb
|
92
|
-
- test/Gemfile
|
93
|
-
- test/LICENSE
|
94
|
-
- test/README.md
|
95
|
-
- test/Rakefile
|
96
|
-
- test/fluent-plugin-sanitizer.gemspec
|
97
92
|
- test/helper.rb
|
98
93
|
- test/lib/fluent/plugin/filter_sanitizer.rb
|
99
94
|
- test/plugin/test_filter_sanitizer.rb
|
@@ -122,11 +117,6 @@ signing_key:
|
|
122
117
|
specification_version: 4
|
123
118
|
summary: Filter plugin of Fluentd which sanitize sensitive information.
|
124
119
|
test_files:
|
125
|
-
- test/Gemfile
|
126
|
-
- test/LICENSE
|
127
|
-
- test/README.md
|
128
|
-
- test/Rakefile
|
129
|
-
- test/fluent-plugin-sanitizer.gemspec
|
130
120
|
- test/helper.rb
|
131
121
|
- test/lib/fluent/plugin/filter_sanitizer.rb
|
132
122
|
- test/plugin/test_filter_sanitizer.rb
|
data/test/Gemfile
DELETED
data/test/LICENSE
DELETED
@@ -1,202 +0,0 @@
|
|
1
|
-
|
2
|
-
Apache License
|
3
|
-
Version 2.0, January 2004
|
4
|
-
http://www.apache.org/licenses/
|
5
|
-
|
6
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
-
|
8
|
-
1. Definitions.
|
9
|
-
|
10
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
-
|
13
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
-
the copyright owner that is granting the License.
|
15
|
-
|
16
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
-
other entities that control, are controlled by, or are under common
|
18
|
-
control with that entity. For the purposes of this definition,
|
19
|
-
"control" means (i) the power, direct or indirect, to cause the
|
20
|
-
direction or management of such entity, whether by contract or
|
21
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
-
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
-
exercising permissions granted by this License.
|
26
|
-
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
28
|
-
including but not limited to software source code, documentation
|
29
|
-
source, and configuration files.
|
30
|
-
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
32
|
-
transformation or translation of a Source form, including but
|
33
|
-
not limited to compiled object code, generated documentation,
|
34
|
-
and conversions to other media types.
|
35
|
-
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
37
|
-
Object form, made available under the License, as indicated by a
|
38
|
-
copyright notice that is included in or attached to the work
|
39
|
-
(an example is provided in the Appendix below).
|
40
|
-
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
-
the Work and Derivative Works thereof.
|
48
|
-
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
50
|
-
the original version of the Work and any modifications or additions
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
-
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
65
|
-
subsequently incorporated within the Work.
|
66
|
-
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
73
|
-
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
-
where such license applies only to those patent claims licensable
|
80
|
-
by such Contributor that are necessarily infringed by their
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
83
|
-
institute patent litigation against any entity (including a
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
86
|
-
or contributory patent infringement, then any patent licenses
|
87
|
-
granted to You under this License for that Work shall terminate
|
88
|
-
as of the date such litigation is filed.
|
89
|
-
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
92
|
-
modifications, and in Source or Object form, provided that You
|
93
|
-
meet the following conditions:
|
94
|
-
|
95
|
-
(a) You must give any other recipients of the Work or
|
96
|
-
Derivative Works a copy of this License; and
|
97
|
-
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
99
|
-
stating that You changed the files; and
|
100
|
-
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
103
|
-
attribution notices from the Source form of the Work,
|
104
|
-
excluding those notices that do not pertain to any part of
|
105
|
-
the Derivative Works; and
|
106
|
-
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
109
|
-
include a readable copy of the attribution notices contained
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
112
|
-
of the following places: within a NOTICE text file distributed
|
113
|
-
as part of the Derivative Works; within the Source form or
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
115
|
-
within a display generated by the Derivative Works, if and
|
116
|
-
wherever such third-party notices normally appear. The contents
|
117
|
-
of the NOTICE file are for informational purposes only and
|
118
|
-
do not modify the License. You may add Your own attribution
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
121
|
-
that such additional attribution notices cannot be construed
|
122
|
-
as modifying the License.
|
123
|
-
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
125
|
-
may provide additional or different license terms and conditions
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
129
|
-
the conditions stated in this License.
|
130
|
-
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
134
|
-
this License, without any additional terms or conditions.
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
-
the terms of any separate license agreement you may have executed
|
137
|
-
with Licensor regarding such Contributions.
|
138
|
-
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
141
|
-
except as required for reasonable and customary use in describing the
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
-
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
153
|
-
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
159
|
-
incidental, or consequential damages of any character arising as a
|
160
|
-
result of this License or out of the use or inability to use the
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
163
|
-
other commercial damages or losses), even if such Contributor
|
164
|
-
has been advised of the possibility of such damages.
|
165
|
-
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
-
or other liability obligations and/or rights consistent with this
|
170
|
-
License. However, in accepting such obligations, You may act only
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
175
|
-
of your accepting any such warranty or additional liability.
|
176
|
-
|
177
|
-
END OF TERMS AND CONDITIONS
|
178
|
-
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
180
|
-
|
181
|
-
To apply the Apache License to your work, attach the following
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
-
replaced with your own identifying information. (Don't include
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
185
|
-
comment syntax for the file format. We also recommend that a
|
186
|
-
file or class name and description of purpose be included on the
|
187
|
-
same "printed page" as the copyright notice for easier
|
188
|
-
identification within third-party archives.
|
189
|
-
|
190
|
-
Copyright [yyyy] [name of copyright owner]
|
191
|
-
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
-
you may not use this file except in compliance with the License.
|
194
|
-
You may obtain a copy of the License at
|
195
|
-
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
-
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
-
See the License for the specific language governing permissions and
|
202
|
-
limitations under the License.
|
data/test/README.md
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# fluent-plugin-sanitizer
|
2
|
-
|
3
|
-
[Fluentd](https://fluentd.org/) filter plugin to do something.
|
4
|
-
|
5
|
-
TODO: write description for you plugin.
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
### RubyGems
|
10
|
-
|
11
|
-
```
|
12
|
-
$ gem install fluent-plugin-sanitizer
|
13
|
-
```
|
14
|
-
|
15
|
-
### Bundler
|
16
|
-
|
17
|
-
Add following line to your Gemfile:
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
gem "fluent-plugin-sanitizer"
|
21
|
-
```
|
22
|
-
|
23
|
-
And then execute:
|
24
|
-
|
25
|
-
```
|
26
|
-
$ bundle
|
27
|
-
```
|
28
|
-
|
29
|
-
## Configuration
|
30
|
-
|
31
|
-
You can generate configuration template:
|
32
|
-
|
33
|
-
```
|
34
|
-
$ fluent-plugin-config-format filter sanitizer
|
35
|
-
```
|
36
|
-
|
37
|
-
You can copy and paste generated documents here.
|
38
|
-
|
39
|
-
## Copyright
|
40
|
-
|
41
|
-
* Copyright(c) 2021- TODO: Write your name
|
42
|
-
* License
|
43
|
-
* Apache License, Version 2.0
|
data/test/Rakefile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require "bundler"
|
2
|
-
Bundler::GemHelper.install_tasks
|
3
|
-
|
4
|
-
require "rake/testtask"
|
5
|
-
|
6
|
-
Rake::TestTask.new(:test) do |t|
|
7
|
-
t.libs.push("lib", "test")
|
8
|
-
t.test_files = FileList["test/**/test_*.rb"]
|
9
|
-
t.verbose = true
|
10
|
-
t.warning = true
|
11
|
-
end
|
12
|
-
|
13
|
-
task default: [:test]
|
@@ -1,27 +0,0 @@
|
|
1
|
-
lib = File.expand_path("../lib", __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = "fluent-plugin-sanitizer"
|
6
|
-
spec.version = "0.1.0"
|
7
|
-
spec.authors = ["TODO: Write your name"]
|
8
|
-
spec.email = ["TODO: Write your email"]
|
9
|
-
|
10
|
-
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
|
11
|
-
spec.description = %q{TODO: Write a longer description or delete this line.}
|
12
|
-
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
13
|
-
spec.license = "Apache-2.0"
|
14
|
-
|
15
|
-
test_files, files = `git ls-files -z`.split("\x0").partition do |f|
|
16
|
-
f.match(%r{^(test|spec|features)/})
|
17
|
-
end
|
18
|
-
spec.files = files
|
19
|
-
spec.executables = files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
-
spec.test_files = test_files
|
21
|
-
spec.require_paths = ["lib"]
|
22
|
-
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.14"
|
24
|
-
spec.add_development_dependency "rake", "~> 12.0"
|
25
|
-
spec.add_development_dependency "test-unit", "~> 3.0"
|
26
|
-
spec.add_runtime_dependency "fluentd", [">= 0.14.10", "< 2"]
|
27
|
-
end
|