Plugin installation fails when behind proxy with NTLM authentication
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 88
Description
It is impossible to reach out to external network when traffic is routed through proxy that requires NTLM authentication. When inspecting http.rb mentioned below I found that proxy authentication is hard-coded to Basic (on line 793), and as such, it's bound to fail on most of enterprise networks.
- Version: Logstash 5.2.0 and 5.5.1
- Operating System: Windows
- Config File (if you have sensitive info, please remove it):
- Sample Data:
- Steps to Reproduce:
1. install Logstash on a network behind proxy using NTLM authentication
2. try to install additional plugin, for example truncate
3. output is
C:\temp\elk\logstash-5.2.0>bin\logstash-plugin install logstash-filter-truncate
Looking if package named: logstash-filter-truncate exists at https://artifacts.elastic.co/downloads/logstash-plugins/logstash-filter-truncate/logstash-filter-truncate-5.2.0.zip
Net::HTTPServerException: 407 "Proxy Authentication Required"
error! at C:/temp/elk/logstash-5.2.0/vendor/jruby/lib/ruby/1.9/net/http.rb:2641
value at C:/temp/elk/logstash-5.2.0/vendor/jruby/lib/ruby/1.9/net/http.rb:2650
connect at C:/temp/elk/logstash-5.2.0/vendor/jruby/lib/ruby/1.9/net/http.rb:796
do_start at C:/temp/elk/logstash-5.2.0/vendor/jruby/lib/ruby/1.9/net/http.rb:756
start at C:/temp/elk/logstash-5.2.0/vendor/jruby/lib/ruby/1.9/net/http.rb:745
start at C:/temp/elk/logstash-5.2.0/vendor/jruby/lib/ruby/1.9/net/http.rb:557
start at C:/temp/elk/logstash-5.2.0/lib/pluginmanager/utils/http_client.rb:13
remote_file_exist? at C:/temp/elk/logstash-5.2.0/lib/pluginmanager/utils/http_client.rb:23
get_installer_for at C:/temp/elk/logstash-5.2.0/lib/pluginmanager/pack_fetch_strategy/repository.rb:27
create at C:/temp/elk/logstash-5.2.0/lib/pluginmanager/install_strategy_factory.rb:15
each at org/jruby/RubyArray.java:1613
create at C:/temp/elk/logstash-5.2.0/lib/pluginmanager/install_strategy_factory.rb:14
execute at C:/temp/elk/logstash-5.2.0/lib/pluginmanager/install.rb:30
run at C:/temp/elk/logstash-5.2.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67
execute at C:/temp/elk/logstash-5.2.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11
run at C:/temp/elk/logstash-5.2.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67
run at C:/temp/elk/logstash-5.2.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132
(root) at C:\temp\elk\logstash-5.2.0\lib\pluginmanager\main.rb:46
Contributor guide
Research direction
Start with lib/pluginmanager/utils/http_client.rb and the Net::HTTP connection path shown at vendor/jruby/lib/ruby/1.9/net/http.rb:793, then trace calls from lib/pluginmanager/pack_fetch_strategy/repository.rb. Reproduce plugin installation through an NTLM-authenticated proxy and verify that the truncate plugin can be reached without the 407 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100