Filebeat에서 Logstash로 데이터 전송 시 ssl 설정

Create instance file for elasticsearch-certutil

logstash 노드에서 elasticsearch-certutil 명령어와 instance 파일을 사용하여 p12 파일 생성

# vi instance.yml

instances:
  - name: "logstash"
    ip:
      - "192.168.1.2"

Create p12 cert file from elasticsearch-certutil and instance.yml

# /usr/share/elasticsearch/bin/elasticsearch-certutil cert --in instance.yml --silent --out certs.zip
# cd /DIR_TO_LOGSTASH/cert && unzip ~/certs.zip -d ./
# ls
logstash.p12

Create key and crt file from p12

openssl 명령어로 crt, key 파일 생성

# openssl pkcs12 -in logstash.p12 -out logstash.crt -clcerts -nokeys
# openssl pkcs12 -in logstash.p12 -out logstash.key -nocerts -nodes

Edit each configuration

Logstash
vi logstash.yml
input {
  beats {
...
    ssl => true
    ssl_certificate => "/[LOGSTASH]/cert/logstash.crt"
    ssl_key => "/[LOGSTASH]/cert/logstash.key"
...

Filebeat
vi filebeat.yml
output.logstash:
...
  ssl.certificate: "/[FILEBEAT]cert/logstash.crt"
  ssl.key: "/[FILEBEAT]/cert/logstash.key"
  ssl.certificate_authorities: ["/[FILEBEAT]/cert/logstash.crt"]
...

 

Restart logstash and filebeat service on each server

In logstash server
# sudo kill -SIGHUP [PID_OF_$(ps aux |grep logstash)]

In filebeat server
# sudo service filebeat restart

Check each logstash and filebeat log for connection establishment

'System Engineering > Linux' 카테고리의 다른 글

Nginx: How to purge the proxy cache  (0) 2020.05.25
Ubuntu apt-get upgrade  (0) 2019.12.13
Buffers and cache in memory (Linux)  (0) 2019.11.11
Check the disk type in linux (ubuntu)  (0) 2019.11.07
Bash: sed  (0) 2019.05.07

SSL / TLS Intermediate CA

Ref: https://www.thesslstore.com/blog/root-certificates-intermediate/

 

각 CA는 하나 이상의 루트 CA를 가질 수 있으며, 실제 대부분의 CA는 여러개의 루트를 가지고 있다.

 

사용자 시스템에서 리프 인증서가 인증이 되면, 그 인증서의 루트에서 발급 된 모든 인증서는 사용자의 시스템에서 자동으로 신뢰하도록 설계되어 있다.

 

Certificate chain

인증서 발급을 위해서는 CSR (Certificate Signing Request)와 Private key를 생성하며, 인증 기관 루트에서 개인 키로 인증서를 서명함으로 인증 체인이 완성된다.

 

 

루트 CA에서 직접 모든 인증서를 발급하고 관리하는 것은 보안상 많은 리스크를 수반하므로, 중간 CA를 두어 보안 및 관리에 용이하도록 한다.

'System Engineering > Security' 카테고리의 다른 글

VDI  (0) 2018.06.18
IPS & IDS (feat. FW)  (0) 2018.06.18

+ Recent posts