How to make secure connection between Winlogbeat and Logstash server. Tell how to edit…
- User
How to make secure connection between Winlogbeat and Logstash server. Tell how to edit winlogbeat.yml and logstash config winlogbeat.conf
- Assistant
How to make secure connection between Winlogbeat and Logstash server. Tell how to edit winlogbeat.yml and logstash config winlogbeat.conf
To make a secure connection between Winlogbeat and the Logstash server, you need to enable SSL/TLS encryption. Here are the steps to achieve this by editing the winlogbeat.yml and Logstash configuration files:
You can generate SSL certificates using a tool like OpenSSL or through your organization’s Certificate Authority (CA). Here is how you can create a self-signed certificate for testing purposes:
openssl req -x509 -batch -nodes -newkey rsa:4096 -keyout logstash.key -out logstash.crt -days 365
logstash.key: The private key.logstash.crt: The public certificate.Edit your Logstash configuration file (e.g., winlogbeat.conf) to enable SSL/TLS for the Beats input plugin:
input {
beats {
port => 5044
ssl => true
ssl_certificate => "/path/to/logstash.crt"
ssl_key => "/path/to/logstash.key"
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "winlogbeat-%{+YYYY.MM.dd}"
}
}
Make sure to replace /path/to/logstash.crt and /path/to/logstash.key with the actual paths to your certificate and key files.
Edit your winlogbeat.yml configuration file to set up SSL/TLS for the Logstash output:
winlogbeat.event_logs:
- name: Application
- name: Security
- name: System
output.logstash:
hosts: ["your-logstash-server:5044"]
ssl.certificate_authorities: ["C:\\path\\to\\logstash.crt"]
ssl.verification_mode: full
# Optional settings for client certificate authentication
# ssl.certificate: "C:\\path\\to\\client.crt"
# ssl.key: "C:\\path\\to\\client.key"
Replace your-logstash-server with the hostname or IP address of your Logstash server and C:\\path\\to\\logstash.crt with the Windows path to your Logstash server’s certificate.
Restart the Logstash service to apply changes:
sudo systemctl restart logstash
Restart the Winlogbeat service to apply changes:
net stop winlogbeat
net start winlogbeat
By configuring both Winlogbeat and Logstash to use SSL/TLS, you ensure that the data sent from Winlogbeat to Logstash is encrypted, protecting it from possible interception or tampering during transit. Always make sure to use strong certificates and configure verification modes according to your security requirements.