Elasticsearch - Secure communication Logstash & File-beat - Part 3

For logging pipeline, Filebeat will establish a secure connection to Logstash. This article explains how to setup SSL mutual authentication using self signed certificate. 

Prerequisite

You should have docker and docker-compose installed in you machine. You may try Docker-Desktop in case you are using WINDOWS or MAC.

You need OpenSSL installed and configured in your machine.

Option1: You can install Git Bash in your machine and configure path in System environment variable. 

Environment Variables -> path -> "C:\Program Files\Git\usr\bin"

Option2: You can use Cmder is a software package. 

Add a custom domain in your host machine which points to localhost.

"host" File location - C:\Windows\System32\drivers\etc

#My custom domain

127.0.0.1 dev.experiment.com

#End of section

Creating Certificates

We will be using custom domain and self-signed certificates.

Create directory.

mkdir .\tls\certs

mkdir .\tls\private

openssl req -subj "/CN=dev.experiment.com/" -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout private/logstash.key -out certs/logstash.crt
openssl req -subj '/CN=dev.experiment.com/' -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout private/filebeat.key -out certs/filebeat.crt

We will configure these keys in both logstash and file-beat.

Configure logstash.conf file.


Configure filebeat yml file 

 

Comments

Popular posts from this blog

Python Development Environment : pyenv & VS Code

Open Distro for Elasticsearch - Installation - Part 2

WSL 2 on Windows - LINUX based development environment and Docker