logstash-input-kafka 6.0.1 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c54ee25acbf97f706e6a59a5d946a81ceb0443f
4
- data.tar.gz: c9f1d094e875c1afabd550c7b5e919ad4360e276
3
+ metadata.gz: ca18508e563e481b0e21452577fd2ab764126df5
4
+ data.tar.gz: f5d951ba0229244db1a08eae618c99caea32b9e9
5
5
  SHA512:
6
- metadata.gz: 28bd504868f79e74bfb24913b701220a3a17cc86fee147fd59120ab58d10d8dbccac413ee987b4e6a61158871a5c7490c2c520a4314b21ee01ec71d8a3fdbfeb
7
- data.tar.gz: ebc024bc32719ce6796107ac87f8eb84c7a16a0efb0d6f91c4d59ef638677e22be9fa1e851dd473108ce371df785a9b6f91f2dcb94edf9812c0c3042e0a685dd
6
+ metadata.gz: 92df3686bcac5a2056acaf6ae59fe6ee185174568250d298e1158678708ff9da47700b85600b301f31435c550411c6495d838499009fbc088da826aa62ff33ea
7
+ data.tar.gz: 5675c2530563e407aec9bd3a15554b9644d4d9f393b6c5d9ac8e1b49985c27439415a4468704ff204890bef124fb92d88b09553a6e87ea569f0ef9cc5a47b64f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 6.1.0
2
+ - Add Kerberos authentication support.
3
+
1
4
  ## 6.0.1
2
5
  - default `poll_timeout_ms` to 100ms
3
6
 
@@ -146,15 +146,49 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
146
146
  # Time kafka consumer will wait to receive new messages from topics
147
147
  config :poll_timeout_ms, :validate => :number, :default => 100
148
148
  # Enable SSL/TLS secured communication to Kafka broker.
149
- config :ssl, :validate => :boolean, :default => false
149
+ config :ssl, :validate => :boolean, :default => false, :deprecated => "Use security_protocol => 'ssl'"
150
+ # The truststore type.
151
+ config :ssl_truststore_type, :validate => :string
150
152
  # The JKS truststore path to validate the Kafka broker's certificate.
151
153
  config :ssl_truststore_location, :validate => :path
152
154
  # The truststore password
153
155
  config :ssl_truststore_password, :validate => :password
156
+ # The keystore type.
157
+ config :ssl_keystore_type, :validate => :string
154
158
  # If client authentication is required, this setting stores the keystore path.
155
159
  config :ssl_keystore_location, :validate => :path
156
160
  # If client authentication is required, this setting stores the keystore password
157
161
  config :ssl_keystore_password, :validate => :password
162
+ # The password of the private key in the key store file.
163
+ config :ssl_key_password, :validate => :password
164
+ # Security protocol to use, which can be either of PLAINTEXT,SSL,SASL_PLAINTEXT,SASL_SSL
165
+ config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT"
166
+ # http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections.
167
+ # This may be any mechanism for which a security provider is available.
168
+ # GSSAPI is the default mechanism.
169
+ config :sasl_mechanism, :validate => :string, :default => "GSSAPI"
170
+ # The Kerberos principal name that Kafka broker runs as.
171
+ # This can be defined either in Kafka's JAAS config or in Kafka's config.
172
+ config :sasl_kerberos_service_name, :validate => :string
173
+ # The Java Authentication and Authorization Service (JAAS) API supplies user authentication and authorization
174
+ # services for Kafka. This setting provides the path to the JAAS file. Sample JAAS file for Kafka client:
175
+ # [source,java]
176
+ # ----------------------------------
177
+ # KafkaClient {
178
+ # com.sun.security.auth.module.Krb5LoginModule required
179
+ # useTicketCache=true
180
+ # renewTicket=true
181
+ # serviceName="kafka";
182
+ # };
183
+ # ----------------------------------
184
+ #
185
+ # Please note that specifying `jaas_path` and `kerberos_config` in the config file will add these
186
+ # to the global JVM system properties. This means if you have multiple Kafka inputs, all of them would be sharing the same
187
+ # `jaas_path` and `kerberos_config`. If this is not desirable, you would have to run separate instances of Logstash on
188
+ # different JVM instances.
189
+ config :jaas_path, :validate => :path
190
+ # Optional path to kerberos config file. This is krb5.conf style as detailed in https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html
191
+ config :kerberos_config, :validate => :path
158
192
  # Option to add Kafka metadata like topic, message size to the event.
159
193
  # This will add a field named `kafka` to the logstash event containing the following attributes:
160
194
  # `topic`: The topic this message is associated with
@@ -253,14 +287,15 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
253
287
  props.put(kafka::SESSION_TIMEOUT_MS_CONFIG, session_timeout_ms) unless session_timeout_ms.nil?
254
288
  props.put(kafka::VALUE_DESERIALIZER_CLASS_CONFIG, value_deserializer_class)
255
289
 
256
- if ssl
257
- props.put("security.protocol", "SSL")
258
- props.put("ssl.truststore.location", ssl_truststore_location)
259
- props.put("ssl.truststore.password", ssl_truststore_password.value) unless ssl_truststore_password.nil?
290
+ props.put("security.protocol", security_protocol) unless security_protocol.nil?
260
291
 
261
- #Client auth stuff
262
- props.put("ssl.keystore.location", ssl_keystore_location) unless ssl_keystore_location.nil?
263
- props.put("ssl.keystore.password", ssl_keystore_password.value) unless ssl_keystore_password.nil?
292
+ if security_protocol == "SSL"
293
+ set_trustore_keystore_config(props)
294
+ elsif security_protocol == "SASL_PLAINTEXT"
295
+ set_sasl_config(props)
296
+ elsif security_protocol == "SASL_SSL"
297
+ set_trustore_keystore_config
298
+ set_sasl_config
264
299
  end
265
300
 
266
301
  org.apache.kafka.clients.consumer.KafkaConsumer.new(props)
@@ -269,4 +304,28 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
269
304
  throw e
270
305
  end
271
306
  end
307
+
308
+ def set_trustore_keystore_config(props)
309
+ props.put("ssl.truststore.type", ssl_truststore_type) unless ssl_truststore_type.nil?
310
+ props.put("ssl.truststore.location", ssl_truststore_location)
311
+ props.put("ssl.truststore.password", ssl_truststore_password.value) unless ssl_truststore_password.nil?
312
+
313
+ # Client auth stuff
314
+ props.put("ssl.keystore.type", ssl_keystore_type) unless ssl_keystore_type.nil?
315
+ props.put("ssl.key.password", ssl_key_password.value) unless ssl_key_password.nil?
316
+ props.put("ssl.keystore.location", ssl_keystore_location) unless ssl_keystore_location.nil?
317
+ props.put("ssl.keystore.password", ssl_keystore_password.value) unless ssl_keystore_password.nil?
318
+ end
319
+
320
+ def set_sasl_config(props)
321
+ java.lang.System.setProperty("java.security.auth.login.config",jaas_path) unless jaas_path.nil?
322
+ java.lang.System.setProperty("java.security.krb5.conf",kerberos_config) unless kerberos_config.nil?
323
+
324
+ props.put("sasl.mechanism",sasl_mechanism)
325
+ if sasl_mechanism == "GSSAPI" && sasl_kerberos_service_name.nil?
326
+ raise LogStash::ConfigurationError, "sasl_kerberos_service_name must be specified when SASL mechanism is GSSAPI"
327
+ end
328
+
329
+ props.put("sasl.kerberos.service.name",sasl_kerberos_service_name)
330
+ end
272
331
  end #class LogStash::Inputs::Kafka
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-kafka'
3
- s.version = '6.0.1'
3
+ s.version = '6.1.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'This input will read events from a Kafka topic. It uses the high level consumer API provided by Kafka to read messages from the broker'
6
6
  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"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elasticsearch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement