fluentd 1.9.0-x86-mingw32 → 1.9.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd might be problematic. Click here for more details.

Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +2 -1
  3. data/CHANGELOG.md +24 -0
  4. data/Gemfile +0 -2
  5. data/appveyor.yml +5 -14
  6. data/fluentd.gemspec +2 -1
  7. data/lib/fluent/config/section.rb +4 -0
  8. data/lib/fluent/plugin/in_monitor_agent.rb +1 -1
  9. data/lib/fluent/plugin/in_tail.rb +12 -139
  10. data/lib/fluent/plugin/in_tail/position_file.rb +171 -0
  11. data/lib/fluent/plugin/out_forward.rb +3 -2
  12. data/lib/fluent/plugin/out_http.rb +10 -4
  13. data/lib/fluent/plugin/output.rb +1 -1
  14. data/lib/fluent/plugin/parser_syslog.rb +5 -2
  15. data/lib/fluent/plugin_helper/cert_option.rb +5 -2
  16. data/lib/fluent/plugin_helper/http_server.rb +62 -2
  17. data/lib/fluent/plugin_helper/http_server/compat/server.rb +14 -3
  18. data/lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb +52 -0
  19. data/lib/fluent/plugin_helper/http_server/server.rb +14 -8
  20. data/lib/fluent/plugin_helper/http_server/ssl_context_builder.rb +41 -0
  21. data/lib/fluent/plugin_helper/server.rb +5 -10
  22. data/lib/fluent/plugin_helper/socket.rb +4 -8
  23. data/lib/fluent/tls.rb +81 -0
  24. data/lib/fluent/version.rb +1 -1
  25. data/test/config/test_section.rb +0 -2
  26. data/test/plugin/in_tail/test_position_file.rb +192 -0
  27. data/test/plugin/test_in_tail.rb +13 -0
  28. data/test/plugin/test_out_http.rb +15 -2
  29. data/test/plugin/test_output_as_buffered_backup.rb +2 -1
  30. data/test/plugin/test_parser_syslog.rb +36 -0
  31. data/test/plugin_helper/data/cert/generate_cert.rb +87 -0
  32. data/test/plugin_helper/data/cert/with_ca/ca-cert-key-pass.pem +30 -0
  33. data/test/plugin_helper/data/cert/with_ca/ca-cert-key.pem +27 -0
  34. data/test/plugin_helper/data/cert/with_ca/ca-cert-pass.pem +20 -0
  35. data/test/plugin_helper/data/cert/with_ca/ca-cert.pem +20 -0
  36. data/test/plugin_helper/data/cert/with_ca/cert-key-pass.pem +30 -0
  37. data/test/plugin_helper/data/cert/with_ca/cert-key.pem +27 -0
  38. data/test/plugin_helper/data/cert/with_ca/cert-pass.pem +21 -0
  39. data/test/plugin_helper/data/cert/with_ca/cert.pem +21 -0
  40. data/test/plugin_helper/data/cert/without_ca/cert-key-pass.pem +30 -0
  41. data/test/plugin_helper/data/cert/without_ca/cert-key.pem +27 -0
  42. data/test/plugin_helper/data/cert/without_ca/cert-pass.pem +20 -0
  43. data/test/plugin_helper/data/cert/without_ca/cert.pem +20 -0
  44. data/test/plugin_helper/test_http_server_helper.rb +168 -7
  45. data/test/plugin_helper/test_server.rb +40 -9
  46. data/test/test_tls.rb +65 -0
  47. metadata +52 -4
@@ -303,7 +303,9 @@ class ServerPluginHelperTest < Test::Unit::TestCase
303
303
 
304
304
  data(
305
305
  'server_create tcp' => [:server_create, :tcp, {}],
306
- 'server_create udp' => [:server_create, :udp, {max_bytes: 128}],
306
+ # Disable udp test because the behaviour of SO_REUSEXXX option is different betweeen BSD, Linux and others...
307
+ # Need to find good way for testing on local, CI service and others.
308
+ #'server_create udp' => [:server_create, :udp, {max_bytes: 128}],
307
309
  'server_create tls' => [:server_create, :tls, {tls_options: {insecure: true}}],
308
310
  # 'server_create unix' => [:server_create, :unix, {}],
309
311
  'server_create_connection tcp' => [:server_create, :tcp, {}],
@@ -844,7 +846,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
844
846
  File.chmod(0600, cert_path, private_key_path)
845
847
  end
846
848
 
847
- def open_tls_session(addr, port, verify: true, cert_path: nil, selfsigned: true, hostname: nil)
849
+ def open_tls_session(addr, port, version: Fluent::TLS::DEFAULT_VERSION, verify: true, cert_path: nil, selfsigned: true, hostname: nil)
848
850
  context = OpenSSL::SSL::SSLContext.new
849
851
  context.set_params({})
850
852
  if verify
@@ -864,6 +866,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
864
866
  else
865
867
  context.verify_mode = OpenSSL::SSL::VERIFY_NONE
866
868
  end
869
+ Fluent::TLS.set_version_to_context(context, version, nil, nil)
867
870
 
868
871
  sock = OpenSSL::SSL::SSLSocket.new(TCPSocket.new(addr, port), context)
869
872
  sock.hostname = hostname if hostname && sock.respond_to?(:hostname)
@@ -906,7 +909,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
906
909
  # insecure
907
910
  tls_options = {
908
911
  protocol: :tls,
909
- version: 'TLSv1_2',
912
+ version: :'TLSv1_2',
910
913
  ciphers: 'ALL:!aNULL:!eNULL:!SSLv2',
911
914
  insecure: true,
912
915
  generate_private_key_length: 2048,
@@ -950,7 +953,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
950
953
 
951
954
  tls_options = {
952
955
  protocol: :tls,
953
- version: 'TLSv1_2',
956
+ version: :'TLSv1_2',
954
957
  ciphers: 'ALL:!aNULL:!eNULL:!SSLv2',
955
958
  insecure: false,
956
959
  cert_path: cert_path,
@@ -984,7 +987,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
984
987
 
985
988
  tls_options = {
986
989
  protocol: :tls,
987
- version: 'TLSv1_2',
990
+ version: :'TLSv1_2',
988
991
  ciphers: 'ALL:!aNULL:!eNULL:!SSLv2',
989
992
  insecure: false,
990
993
  ca_cert_path: ca_cert_path,
@@ -1024,7 +1027,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
1024
1027
 
1025
1028
  tls_options = {
1026
1029
  protocol: :tls,
1027
- version: 'TLSv1_2',
1030
+ version: :'TLSv1_2',
1028
1031
  ciphers: 'ALL:!aNULL:!eNULL:!SSLv2',
1029
1032
  insecure: false,
1030
1033
  cert_path: cert_path,
@@ -1054,7 +1057,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
1054
1057
 
1055
1058
  tls_options = {
1056
1059
  protocol: :tls,
1057
- version: 'TLSv1_2',
1060
+ version: :'TLSv1_2',
1058
1061
  ciphers: 'ALL:!aNULL:!eNULL:!SSLv2',
1059
1062
  insecure: false,
1060
1063
  cert_path: cert_path,
@@ -1251,7 +1254,7 @@ class ServerPluginHelperTest < Test::Unit::TestCase
1251
1254
 
1252
1255
  @tls_options = {
1253
1256
  protocol: :tls,
1254
- version: 'TLSv1_2',
1257
+ version: :'TLSv1_2',
1255
1258
  ciphers: 'ALL:!aNULL:!eNULL:!SSLv2',
1256
1259
  insecure: false,
1257
1260
  cert_path: @cert_path,
@@ -1452,6 +1455,35 @@ class ServerPluginHelperTest < Test::Unit::TestCase
1452
1455
  assert_equal ["yayfoo\n", "yayfoo\n", "yayfoo\n"], lines
1453
1456
  assert_equal ["closed", "closed", "closed"], callback_results
1454
1457
  end
1458
+
1459
+ sub_test_case 'TLS version connection check' do
1460
+ test "can't connect with different TLS version" do
1461
+ @d.server_create_tls(:s, PORT, tls_options: @tls_options) do |data, conn|
1462
+ end
1463
+ assert_raise(OpenSSL::SSL::SSLError, Errno::ECONNRESET) {
1464
+ open_tls_session('127.0.0.1', PORT, cert_path: @cert_path, version: :'TLS1_1') do |sock|
1465
+ end
1466
+ }
1467
+ end
1468
+
1469
+ test "can specify multiple TLS versions by min_version/max_version" do
1470
+ omit "min_version=/max_version= is not supported" unless Fluent::TLS::MIN_MAX_AVAILABLE
1471
+
1472
+ opts = @tls_options.merge(min_version: :'TLS1_1', max_version: :'TLSv1_2')
1473
+ @d.server_create_tls(:s, PORT, tls_options: opts) do |data, conn|
1474
+ end
1475
+ assert_raise(OpenSSL::SSL::SSLError, Errno::ECONNRESET) {
1476
+ open_tls_session('127.0.0.1', PORT, cert_path: @cert_path, version: :'TLS1') do |sock|
1477
+ end
1478
+ }
1479
+ [:'TLS1_1', :'TLS1_2'].each { |ver|
1480
+ assert_nothing_raised {
1481
+ open_tls_session('127.0.0.1', PORT, cert_path: @cert_path, version: ver) do |sock|
1482
+ end
1483
+ }
1484
+ }
1485
+ end
1486
+ end
1455
1487
  end
1456
1488
 
1457
1489
  sub_test_case '#server_create_unix' do
@@ -1736,5 +1768,4 @@ class ServerPluginHelperTest < Test::Unit::TestCase
1736
1768
  # pend "not implemented yet"
1737
1769
  end
1738
1770
  end
1739
-
1740
1771
  end
@@ -0,0 +1,65 @@
1
+ require_relative 'helper'
2
+ require 'fluent/tls'
3
+
4
+ class UniqueIdTest < Test::Unit::TestCase
5
+ TEST_TLS1_1_CASES = {
6
+ 'New TLS v1.1' => :'TLS1_1',
7
+ 'Old TLS v1.1' => :'TLSv1_1',
8
+ }
9
+ TEST_TLS1_2_CASES = {
10
+ 'New TLS v1.2' => :'TLS1_2',
11
+ 'Old TLS v1.2' => :'TLSv1_2'
12
+ }
13
+ TEST_TLS_CASES = TEST_TLS1_1_CASES.merge(TEST_TLS1_2_CASES)
14
+
15
+ sub_test_case 'constants' do
16
+ test 'default version' do
17
+ assert_equal :'TLSv1_2', Fluent::TLS::DEFAULT_VERSION
18
+ end
19
+
20
+ data(TEST_TLS_CASES)
21
+ test 'supported versions' do |ver|
22
+ assert_include Fluent::TLS::SUPPORTED_VERSIONS, ver
23
+ end
24
+
25
+ test 'default ciphers' do
26
+ assert_equal "ALL:!aNULL:!eNULL:!SSLv2", Fluent::TLS::CIPHERS_DEFAULT
27
+ end
28
+ end
29
+
30
+ sub_test_case 'set_version_to_context' do
31
+ setup do
32
+ @ctx = OpenSSL::SSL::SSLContext.new
33
+ end
34
+
35
+ # TODO: After openssl module supports min_version/max_version accessor, add assert for it.
36
+
37
+ data(TEST_TLS_CASES)
38
+ test 'with version' do |ver|
39
+ assert_nothing_raised {
40
+ Fluent::TLS.set_version_to_context(@ctx, ver, nil, nil)
41
+ }
42
+ end
43
+
44
+ data(TEST_TLS_CASES)
45
+ test 'can specify old/new syntax to min_version/max_version' do |ver|
46
+ omit "min_version=/max_version= is not supported" unless Fluent::TLS::MIN_MAX_AVAILABLE
47
+
48
+ assert_nothing_raised {
49
+ Fluent::TLS.set_version_to_context(@ctx, Fluent::TLS::DEFAULT_VERSION, ver, ver)
50
+ }
51
+ end
52
+
53
+ test 'raise ConfigError when either one of min_version/max_version is not specified' do
54
+ omit "min_version=/max_version= is not supported" unless Fluent::TLS::MIN_MAX_AVAILABLE
55
+
56
+ ver = Fluent::TLS::DEFAULT_VERSION
57
+ assert_raise(Fluent::ConfigError) {
58
+ Fluent::TLS.set_version_to_context(@ctx, ver, ver, nil)
59
+ }
60
+ assert_raise(Fluent::ConfigError) {
61
+ Fluent::TLS.set_version_to_context(@ctx, ver, nil, ver)
62
+ }
63
+ end
64
+ end
65
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-22 00:00:00.000000000 Z
11
+ date: 2020-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -380,7 +380,7 @@ dependencies:
380
380
  requirements:
381
381
  - - ">="
382
382
  - !ruby/object:Gem::Version
383
- version: 0.1.1
383
+ version: 0.1.2
384
384
  - - "<"
385
385
  - !ruby/object:Gem::Version
386
386
  version: '0.2'
@@ -390,10 +390,24 @@ dependencies:
390
390
  requirements:
391
391
  - - ">="
392
392
  - !ruby/object:Gem::Version
393
- version: 0.1.1
393
+ version: 0.1.2
394
394
  - - "<"
395
395
  - !ruby/object:Gem::Version
396
396
  version: '0.2'
397
+ - !ruby/object:Gem::Dependency
398
+ name: async-http
399
+ requirement: !ruby/object:Gem::Requirement
400
+ requirements:
401
+ - - ">="
402
+ - !ruby/object:Gem::Version
403
+ version: '0'
404
+ type: :development
405
+ prerelease: false
406
+ version_requirements: !ruby/object:Gem::Requirement
407
+ requirements:
408
+ - - ">="
409
+ - !ruby/object:Gem::Version
410
+ version: '0'
397
411
  description: Fluentd is an open source data collector designed to scale and simplify
398
412
  log management. It can collect, process and ship many kinds of data in near real-time.
399
413
  email:
@@ -590,6 +604,7 @@ files:
590
604
  - lib/fluent/plugin/in_object_space.rb
591
605
  - lib/fluent/plugin/in_syslog.rb
592
606
  - lib/fluent/plugin/in_tail.rb
607
+ - lib/fluent/plugin/in_tail/position_file.rb
593
608
  - lib/fluent/plugin/in_tcp.rb
594
609
  - lib/fluent/plugin/in_udp.rb
595
610
  - lib/fluent/plugin/in_unix.rb
@@ -649,11 +664,13 @@ files:
649
664
  - lib/fluent/plugin_helper/http_server.rb
650
665
  - lib/fluent/plugin_helper/http_server/app.rb
651
666
  - lib/fluent/plugin_helper/http_server/compat/server.rb
667
+ - lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb
652
668
  - lib/fluent/plugin_helper/http_server/compat/webrick_handler.rb
653
669
  - lib/fluent/plugin_helper/http_server/methods.rb
654
670
  - lib/fluent/plugin_helper/http_server/request.rb
655
671
  - lib/fluent/plugin_helper/http_server/router.rb
656
672
  - lib/fluent/plugin_helper/http_server/server.rb
673
+ - lib/fluent/plugin_helper/http_server/ssl_context_builder.rb
657
674
  - lib/fluent/plugin_helper/inject.rb
658
675
  - lib/fluent/plugin_helper/parser.rb
659
676
  - lib/fluent/plugin_helper/record_accessor.rb
@@ -698,6 +715,7 @@ files:
698
715
  - lib/fluent/test/startup_shutdown.rb
699
716
  - lib/fluent/time.rb
700
717
  - lib/fluent/timezone.rb
718
+ - lib/fluent/tls.rb
701
719
  - lib/fluent/unique_id.rb
702
720
  - lib/fluent/variable_store.rb
703
721
  - lib/fluent/version.rb
@@ -759,6 +777,7 @@ files:
759
777
  - test/plugin/data/sd_file/config.yaml
760
778
  - test/plugin/data/sd_file/config.yml
761
779
  - test/plugin/data/sd_file/invalid_config.yml
780
+ - test/plugin/in_tail/test_position_file.rb
762
781
  - test/plugin/out_forward/test_ack_handler.rb
763
782
  - test/plugin/out_forward/test_connection_manager.rb
764
783
  - test/plugin/out_forward/test_handshake_protocol.rb
@@ -846,6 +865,19 @@ files:
846
865
  - test/plugin_helper/data/cert/cert-key.pem
847
866
  - test/plugin_helper/data/cert/cert-with-no-newline.pem
848
867
  - test/plugin_helper/data/cert/cert.pem
868
+ - test/plugin_helper/data/cert/generate_cert.rb
869
+ - test/plugin_helper/data/cert/with_ca/ca-cert-key-pass.pem
870
+ - test/plugin_helper/data/cert/with_ca/ca-cert-key.pem
871
+ - test/plugin_helper/data/cert/with_ca/ca-cert-pass.pem
872
+ - test/plugin_helper/data/cert/with_ca/ca-cert.pem
873
+ - test/plugin_helper/data/cert/with_ca/cert-key-pass.pem
874
+ - test/plugin_helper/data/cert/with_ca/cert-key.pem
875
+ - test/plugin_helper/data/cert/with_ca/cert-pass.pem
876
+ - test/plugin_helper/data/cert/with_ca/cert.pem
877
+ - test/plugin_helper/data/cert/without_ca/cert-key-pass.pem
878
+ - test/plugin_helper/data/cert/without_ca/cert-key.pem
879
+ - test/plugin_helper/data/cert/without_ca/cert-pass.pem
880
+ - test/plugin_helper/data/cert/without_ca/cert.pem
849
881
  - test/plugin_helper/http_server/test_app.rb
850
882
  - test/plugin_helper/http_server/test_route.rb
851
883
  - test/plugin_helper/service_discovery/test_manager.rb
@@ -901,6 +933,7 @@ files:
901
933
  - test/test_test_drivers.rb
902
934
  - test/test_time_formatter.rb
903
935
  - test/test_time_parser.rb
936
+ - test/test_tls.rb
904
937
  - test/test_unique_id.rb
905
938
  - test/test_variable_store.rb
906
939
  homepage: https://www.fluentd.org/
@@ -966,6 +999,7 @@ test_files:
966
999
  - test/plugin/data/sd_file/config.yaml
967
1000
  - test/plugin/data/sd_file/config.yml
968
1001
  - test/plugin/data/sd_file/invalid_config.yml
1002
+ - test/plugin/in_tail/test_position_file.rb
969
1003
  - test/plugin/out_forward/test_ack_handler.rb
970
1004
  - test/plugin/out_forward/test_connection_manager.rb
971
1005
  - test/plugin/out_forward/test_handshake_protocol.rb
@@ -1053,6 +1087,19 @@ test_files:
1053
1087
  - test/plugin_helper/data/cert/cert-key.pem
1054
1088
  - test/plugin_helper/data/cert/cert-with-no-newline.pem
1055
1089
  - test/plugin_helper/data/cert/cert.pem
1090
+ - test/plugin_helper/data/cert/generate_cert.rb
1091
+ - test/plugin_helper/data/cert/with_ca/ca-cert-key-pass.pem
1092
+ - test/plugin_helper/data/cert/with_ca/ca-cert-key.pem
1093
+ - test/plugin_helper/data/cert/with_ca/ca-cert-pass.pem
1094
+ - test/plugin_helper/data/cert/with_ca/ca-cert.pem
1095
+ - test/plugin_helper/data/cert/with_ca/cert-key-pass.pem
1096
+ - test/plugin_helper/data/cert/with_ca/cert-key.pem
1097
+ - test/plugin_helper/data/cert/with_ca/cert-pass.pem
1098
+ - test/plugin_helper/data/cert/with_ca/cert.pem
1099
+ - test/plugin_helper/data/cert/without_ca/cert-key-pass.pem
1100
+ - test/plugin_helper/data/cert/without_ca/cert-key.pem
1101
+ - test/plugin_helper/data/cert/without_ca/cert-pass.pem
1102
+ - test/plugin_helper/data/cert/without_ca/cert.pem
1056
1103
  - test/plugin_helper/http_server/test_app.rb
1057
1104
  - test/plugin_helper/http_server/test_route.rb
1058
1105
  - test/plugin_helper/service_discovery/test_manager.rb
@@ -1108,5 +1155,6 @@ test_files:
1108
1155
  - test/test_test_drivers.rb
1109
1156
  - test/test_time_formatter.rb
1110
1157
  - test/test_time_parser.rb
1158
+ - test/test_tls.rb
1111
1159
  - test/test_unique_id.rb
1112
1160
  - test/test_variable_store.rb