Hello Felipe,
Ok so we have two Logstash instances and one Filebeat instance which will send data using ssl to our Logstash instances.
The main idea behind this is to share the CA file (certificate authorities) but having different certificates. Each component has
its own certificate and its own key but all of them have a common CA file.
Filebeat instance
output.logstash:
hosts: ["logstash01","logstash02"]
ssl.certificate_authorities: ["/etc/ca.crt"]
ssl.certificate: "/etc/client.crt"
ssl.key: "/etc/client.key"
- /etc/ca.crt is the CA file, it's generated only one time in one machine and copied to the three machines
- /etc/client.crt and /etc/client.key is generated in the Filebeat machine and they are used only by the Filebeat machine
Logstash instances
input {
beats {
port => 5044
ssl => true
ssl_certificate_authorities => ["/etc/ca.crt"]
ssl_certificate => "/etc/server.crt"
ssl_key => "/etc/server.key"
ssl_verify_mode => "force_peer"
}
}
This configuration will be the same in each Logstash instance but changing the files as I described below.
- /etc/ca.crt is the CA file and is the same in the three machines
- /etc/client.crt and /etc/client.key is generated in each Logstash machine, so each Logstash instance has its own client.crt and its own client.key
-
force_peer is telling Logstash to close the connection if the incoming certificate from Filebeat is invalid against the CA file.
about securing Filebeat and Logstash, really well explained. As final note: review the ports from output/input connections on each configuration file.
I hope it helps Felipe!
Regards,
Jesús