logstash-filter-cipher 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +10 -1
- data/LICENSE +1 -1
- data/README.md +12 -3
- data/docs/index.asciidoc +243 -0
- data/logstash-filter-cipher.gemspec +3 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbca0f8a8e9f7238c622ddddd6b3bea364bc7593
|
4
|
+
data.tar.gz: 25501d5359ee6bd2294ef782c9d24845fe0a7880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 356b67cc860424b7da5c28f865de3faea3d1db4fdafee60cabcc64c960762319d39d6d8050cdcb182d0fea116d8893f476b1a14301558b9b37b2ed97eadc24ba
|
7
|
+
data.tar.gz: 9686860078d4b348ed59d19643cbc4d30dfbc60b13a604da32e41f0341e616031eef0c4e0e17cd92871a0aa0689cfa28921e60602ed88533c8da7cc77739ea3a
|
data/Gemfile
CHANGED
@@ -1,2 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
|
6
|
+
use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
|
7
|
+
|
8
|
+
if Dir.exist?(logstash_path) && use_logstash_source
|
9
|
+
gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
|
10
|
+
gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
|
11
|
+
end
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
-
[![Build
|
4
|
-
Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-cipher-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-cipher-unit/)
|
3
|
+
[![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-cipher.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-cipher)
|
5
4
|
|
6
5
|
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
7
6
|
|
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
|
56
55
|
```
|
57
56
|
- Install plugin
|
58
57
|
```sh
|
58
|
+
# Logstash 2.3 and higher
|
59
|
+
bin/logstash-plugin install --no-verify
|
60
|
+
|
61
|
+
# Prior to Logstash 2.3
|
59
62
|
bin/plugin install --no-verify
|
63
|
+
|
60
64
|
```
|
61
65
|
- Run Logstash with your plugin
|
62
66
|
```sh
|
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
|
|
74
78
|
```
|
75
79
|
- Install the plugin from the Logstash home
|
76
80
|
```sh
|
77
|
-
|
81
|
+
# Logstash 2.3 and higher
|
82
|
+
bin/logstash-plugin install --no-verify
|
83
|
+
|
84
|
+
# Prior to Logstash 2.3
|
85
|
+
bin/plugin install --no-verify
|
86
|
+
|
78
87
|
```
|
79
88
|
- Start Logstash and proceed to test the plugin
|
80
89
|
|
data/docs/index.asciidoc
ADDED
@@ -0,0 +1,243 @@
|
|
1
|
+
:plugin: cipher
|
2
|
+
:type: filter
|
3
|
+
|
4
|
+
///////////////////////////////////////////
|
5
|
+
START - GENERATED VARIABLES, DO NOT EDIT!
|
6
|
+
///////////////////////////////////////////
|
7
|
+
:version: %VERSION%
|
8
|
+
:release_date: %RELEASE_DATE%
|
9
|
+
:changelog_url: %CHANGELOG_URL%
|
10
|
+
:include_path: ../../../../logstash/docs/include
|
11
|
+
///////////////////////////////////////////
|
12
|
+
END - GENERATED VARIABLES, DO NOT EDIT!
|
13
|
+
///////////////////////////////////////////
|
14
|
+
|
15
|
+
[id="plugins-{type}-{plugin}"]
|
16
|
+
|
17
|
+
=== Cipher filter plugin
|
18
|
+
|
19
|
+
include::{include_path}/plugin_header.asciidoc[]
|
20
|
+
|
21
|
+
==== Description
|
22
|
+
|
23
|
+
This filter parses a source and apply a cipher or decipher before
|
24
|
+
storing it in the target.
|
25
|
+
|
26
|
+
|
27
|
+
[id="plugins-{type}s-{plugin}-options"]
|
28
|
+
==== Cipher Filter Configuration Options
|
29
|
+
|
30
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
31
|
+
|
32
|
+
[cols="<,<,<",options="header",]
|
33
|
+
|=======================================================================
|
34
|
+
|Setting |Input type|Required
|
35
|
+
| <<plugins-{type}s-{plugin}-algorithm>> |<<string,string>>|Yes
|
36
|
+
| <<plugins-{type}s-{plugin}-base64>> |<<boolean,boolean>>|No
|
37
|
+
| <<plugins-{type}s-{plugin}-cipher_padding>> |<<string,string>>|No
|
38
|
+
| <<plugins-{type}s-{plugin}-iv_random_length>> |<<number,number>>|No
|
39
|
+
| <<plugins-{type}s-{plugin}-key>> |<<string,string>>|No
|
40
|
+
| <<plugins-{type}s-{plugin}-key_pad>> |<<,>>|No
|
41
|
+
| <<plugins-{type}s-{plugin}-key_size>> |<<number,number>>|No
|
42
|
+
| <<plugins-{type}s-{plugin}-max_cipher_reuse>> |<<number,number>>|No
|
43
|
+
| <<plugins-{type}s-{plugin}-mode>> |<<string,string>>|Yes
|
44
|
+
| <<plugins-{type}s-{plugin}-source>> |<<string,string>>|No
|
45
|
+
| <<plugins-{type}s-{plugin}-target>> |<<string,string>>|No
|
46
|
+
|=======================================================================
|
47
|
+
|
48
|
+
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
49
|
+
filter plugins.
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
[id="plugins-{type}s-{plugin}-algorithm"]
|
54
|
+
===== `algorithm`
|
55
|
+
|
56
|
+
* This is a required setting.
|
57
|
+
* Value type is <<string,string>>
|
58
|
+
* There is no default value for this setting.
|
59
|
+
|
60
|
+
The cipher algorithm
|
61
|
+
|
62
|
+
A list of supported algorithms can be obtained by
|
63
|
+
[source,ruby]
|
64
|
+
puts OpenSSL::Cipher.ciphers
|
65
|
+
|
66
|
+
[id="plugins-{type}s-{plugin}-base64"]
|
67
|
+
===== `base64`
|
68
|
+
|
69
|
+
* Value type is <<boolean,boolean>>
|
70
|
+
* Default value is `true`
|
71
|
+
|
72
|
+
Do we have to perform a `base64` decode or encode?
|
73
|
+
|
74
|
+
If we are decrypting, `base64` decode will be done before.
|
75
|
+
If we are encrypting, `base64` will be done after.
|
76
|
+
|
77
|
+
|
78
|
+
[id="plugins-{type}s-{plugin}-cipher_padding"]
|
79
|
+
===== `cipher_padding`
|
80
|
+
|
81
|
+
* Value type is <<string,string>>
|
82
|
+
* There is no default value for this setting.
|
83
|
+
|
84
|
+
Cipher padding to use. Enables or disables padding.
|
85
|
+
|
86
|
+
By default encryption operations are padded using standard block padding
|
87
|
+
and the padding is checked and removed when decrypting. If the pad
|
88
|
+
parameter is zero then no padding is performed, the total amount of data
|
89
|
+
encrypted or decrypted must then be a multiple of the block size or an
|
90
|
+
error will occur.
|
91
|
+
|
92
|
+
See EVP_CIPHER_CTX_set_padding for further information.
|
93
|
+
|
94
|
+
We are using Openssl jRuby which uses default padding to PKCS5Padding
|
95
|
+
If you want to change it, set this parameter. If you want to disable
|
96
|
+
it, Set this parameter to 0
|
97
|
+
[source,ruby]
|
98
|
+
filter { cipher { cipher_padding => 0 }}
|
99
|
+
|
100
|
+
[id="plugins-{type}s-{plugin}-iv"]
|
101
|
+
===== `iv` (DEPRECATED)
|
102
|
+
|
103
|
+
* DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
|
104
|
+
* Value type is <<string,string>>
|
105
|
+
* There is no default value for this setting.
|
106
|
+
|
107
|
+
The initialization vector to use (statically hard-coded). For
|
108
|
+
a random IV see the iv_random_length property
|
109
|
+
|
110
|
+
NOTE: If iv_random_length is set, it takes precedence over any value set for "iv"
|
111
|
+
|
112
|
+
The cipher modes CBC, CFB, OFB and CTR all need an "initialization
|
113
|
+
vector", or short, IV. ECB mode is the only mode that does not require
|
114
|
+
an IV, but there is almost no legitimate use case for this mode
|
115
|
+
because of the fact that it does not sufficiently hide plaintext patterns.
|
116
|
+
|
117
|
+
For AES algorithms set this to a 16 byte string.
|
118
|
+
[source,ruby]
|
119
|
+
filter { cipher { iv => "1234567890123456" }}
|
120
|
+
|
121
|
+
Deprecated: Please use `iv_random_length` instead
|
122
|
+
|
123
|
+
[id="plugins-{type}s-{plugin}-iv_random_length"]
|
124
|
+
===== `iv_random_length`
|
125
|
+
|
126
|
+
* Value type is <<number,number>>
|
127
|
+
* There is no default value for this setting.
|
128
|
+
|
129
|
+
Force an random IV to be used per encryption invocation and specify
|
130
|
+
the length of the random IV that will be generated via:
|
131
|
+
|
132
|
+
OpenSSL::Random.random_bytes(int_length)
|
133
|
+
|
134
|
+
If iv_random_length is set, it takes precedence over any value set for "iv"
|
135
|
+
|
136
|
+
Enabling this will force the plugin to generate a unique
|
137
|
+
random IV for each encryption call. This random IV will be prepended to the
|
138
|
+
encrypted result bytes and then base64 encoded. On decryption "iv_random_length" must
|
139
|
+
also be set to utilize this feature. Random IV's are better than statically
|
140
|
+
hardcoded IVs
|
141
|
+
|
142
|
+
For AES algorithms you can set this to a 16
|
143
|
+
[source,ruby]
|
144
|
+
filter { cipher { iv_random_length => 16 }}
|
145
|
+
|
146
|
+
[id="plugins-{type}s-{plugin}-key"]
|
147
|
+
===== `key`
|
148
|
+
|
149
|
+
* Value type is <<string,string>>
|
150
|
+
* There is no default value for this setting.
|
151
|
+
|
152
|
+
The key to use
|
153
|
+
|
154
|
+
NOTE: If you encounter an error message at runtime containing the following:
|
155
|
+
|
156
|
+
"java.security.InvalidKeyException: Illegal key size: possibly you need to install
|
157
|
+
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your JRE"
|
158
|
+
|
159
|
+
Please read the following: https://github.com/jruby/jruby/wiki/UnlimitedStrengthCrypto
|
160
|
+
|
161
|
+
|
162
|
+
[id="plugins-{type}s-{plugin}-key_pad"]
|
163
|
+
===== `key_pad`
|
164
|
+
|
165
|
+
* Value type is <<string,string>>
|
166
|
+
* Default value is `"\u0000"`
|
167
|
+
|
168
|
+
The character used to pad the key
|
169
|
+
|
170
|
+
[id="plugins-{type}s-{plugin}-key_size"]
|
171
|
+
===== `key_size`
|
172
|
+
|
173
|
+
* Value type is <<number,number>>
|
174
|
+
* Default value is `16`
|
175
|
+
|
176
|
+
The key size to pad
|
177
|
+
|
178
|
+
It depends of the cipher algorithm. If your key doesn't need
|
179
|
+
padding, don't set this parameter
|
180
|
+
|
181
|
+
Example, for AES-128, we must have 16 char long key. AES-256 = 32 chars
|
182
|
+
[source,ruby]
|
183
|
+
filter { cipher { key_size => 16 }
|
184
|
+
|
185
|
+
|
186
|
+
[id="plugins-{type}s-{plugin}-max_cipher_reuse"]
|
187
|
+
===== `max_cipher_reuse`
|
188
|
+
|
189
|
+
* Value type is <<number,number>>
|
190
|
+
* Default value is `1`
|
191
|
+
|
192
|
+
If this is set the internal Cipher instance will be
|
193
|
+
re-used up to @max_cipher_reuse times before being
|
194
|
+
reset() and re-created from scratch. This is an option
|
195
|
+
for efficiency where lots of data is being encrypted
|
196
|
+
and decrypted using this filter. This lets the filter
|
197
|
+
avoid creating new Cipher instances over and over
|
198
|
+
for each encrypt/decrypt operation.
|
199
|
+
|
200
|
+
This is optional, the default is no re-use of the Cipher
|
201
|
+
instance and max_cipher_reuse = 1 by default
|
202
|
+
[source,ruby]
|
203
|
+
filter { cipher { max_cipher_reuse => 1000 }}
|
204
|
+
|
205
|
+
[id="plugins-{type}s-{plugin}-mode"]
|
206
|
+
===== `mode`
|
207
|
+
|
208
|
+
* This is a required setting.
|
209
|
+
* Value type is <<string,string>>
|
210
|
+
* There is no default value for this setting.
|
211
|
+
|
212
|
+
Encrypting or decrypting some data
|
213
|
+
|
214
|
+
Valid values are encrypt or decrypt
|
215
|
+
|
216
|
+
[id="plugins-{type}s-{plugin}-source"]
|
217
|
+
===== `source`
|
218
|
+
|
219
|
+
* Value type is <<string,string>>
|
220
|
+
* Default value is `"message"`
|
221
|
+
|
222
|
+
The field to perform filter
|
223
|
+
|
224
|
+
Example, to use the @message field (default) :
|
225
|
+
[source,ruby]
|
226
|
+
filter { cipher { source => "message" } }
|
227
|
+
|
228
|
+
[id="plugins-{type}s-{plugin}-target"]
|
229
|
+
===== `target`
|
230
|
+
|
231
|
+
* Value type is <<string,string>>
|
232
|
+
* Default value is `"message"`
|
233
|
+
|
234
|
+
The name of the container to put the result
|
235
|
+
|
236
|
+
Example, to place the result into crypt :
|
237
|
+
[source,ruby]
|
238
|
+
filter { cipher { target => "crypt" } }
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
[id="plugins-{type}s-{plugin}-common-options"]
|
243
|
+
include::{include_path}/{type}.asciidoc[]
|
@@ -1,17 +1,17 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-cipher'
|
4
|
-
s.version = '2.0.
|
4
|
+
s.version = '2.0.6'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This filter parses a source and apply a cipher or decipher before storing it in the target"
|
7
|
-
s.description = "This gem is a
|
7
|
+
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
8
8
|
s.authors = ["Elastic"]
|
9
9
|
s.email = 'info@elastic.co'
|
10
10
|
s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
|
11
11
|
s.require_paths = ["lib"]
|
12
12
|
|
13
13
|
# Files
|
14
|
-
s.files = Dir[
|
14
|
+
s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
|
15
15
|
|
16
16
|
# Tests
|
17
17
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-cipher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description: This gem is a
|
41
|
+
description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
|
42
42
|
email: info@elastic.co
|
43
43
|
executables: []
|
44
44
|
extensions: []
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- LICENSE
|
51
51
|
- NOTICE.TXT
|
52
52
|
- README.md
|
53
|
+
- docs/index.asciidoc
|
53
54
|
- lib/logstash/filters/cipher.rb
|
54
55
|
- logstash-filter-cipher.gemspec
|
55
56
|
- spec/filters/cipher_spec.rb
|