Hi,
I am trying to collect syslogs from a juniper router. I have configured the router to send logs to the IP where Logstash is running.
I have written the input config for Logstash as:
input {
syslog {
type => "syslog"
port => 514
}
}
I find these errors:
May 05 14:36:24 ubuntu logstash[7187]: [2020-05-05T14:36:24,423][INFO ][logstash.inputs.syslog ][main] Starting syslog tcp listener {:address=>"0.0.0.0:514"}
May 05 14:36:24 ubuntu logstash[7187]: [2020-05-05T14:36:24,425][WARN ][logstash.inputs.syslog ][main] syslog listener died {:protocol=>:udp, :address=>"0.0.0.0:514", :exception=>#<Errno::EACCES: Permission denied - bind(2) for "0.0.0.0" port 514>, :backtrace=>["org/jruby/ext/socket/RubyUDPSocket.java:213:in `bind'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:149:in `udp_listener'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:130:in `server'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:110:in `block in run'"]}
May 05 14:36:24 ubuntu logstash[7187]: [2020-05-05T14:36:24,428][WARN ][logstash.inputs.syslog ][main] syslog listener died {:protocol=>:tcp, :address=>"0.0.0.0:514", :exception=>#<Errno::EACCES: Permission denied - bind(2)>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:133:in `initialize'", "org/jruby/RubyIO.java:878:in `new'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:167:in `tcp_listener'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:130:in `server'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-syslog-3.4.1/lib/logstash/inputs/syslog.rb:114:in `block in run'"]}
you can, though it’s generally not recommended. should there is vuln in logstash, exploiting the vuln will give the attacker root privileges.
if you have to use port 514, there are a couple of alternatives. you could run standard syslog on that forward and forward, have logstash listen on another port, then use syslog forwarding to forward incoming packets to your logstash instance. you can also use iptables for forwarding. there is also a utility called authbind that allows low privileged user to bind to privileged ports.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.