I have recently sucessfully connected my winlogbeat to logstash, however now I am trying to connect it to elastic in order to do the --setup dashboards and --setup index. I was trying to disable logstash and connect it to elasticsearch directly but I am getting the error ERROR x509: certificate signed by unknown authority when I try and test my config. I am testing this on a development server that has had certificates and xpack settings enabled.
C:\winlogbeats> .\winlogbeat.exe -c .\winlogbeat.yml test output
elasticsearch: https://x.251.10.68:9200...
parse url... OK
connection...
parse host... OK
dns lookup... OK
addresses: x.251.10.68
dial up... OK
TLS...
security: server's certificate chain verification is enabled
handshake... ERROR x509: certificate signed by unknown authority
Do I need to import a certificate from kibana in order to make a connection to elasticsearch? ANy thoughts to get winlogbeat to coperate with elasticsearch so I can setup dashboards and indexes?
This is a result of how your Elasticsearch http certificate has been generated/signed.
You didn't provide your elasticsearch.yml, so we can't tell what certificate you're using there, and how it was configured.
In elasticsearch, you will have settings for one or more of:
Those control which certificate your ES node presents on the http port (9200). They will have been issued by a certificate authority. If you created them using the elasticsearch-certutil tool, then you will probably have your own certificate authority, and you will need to export it into a PEM format that winlogbeat can read, and configure it in output.elasticsearch.ssl.certificate_authorities
Alternatively, if you got the certificate from an existing Certificate Authority (a commercial CA, or your own corporate CA) then you will need to get a copy of the CA in PEM format and use it for output.elasticsearch.ssl.certificate_authorities.
As a temporary workaround, you could set output.elasticsearch.ssl.verification_mode: none but this is a dangerous setting, and will disable many of the intended benefits of using SSL. We strongly advise against configuring that on a production server.
As a separate issue:
We don't recommend using the elastic user for data ingest. That user has full superuser privileges and can do everything on your cluster (delete data, change cluster settings, change user passwords, etc). If someone gets access to the password (which is stored in plaintext in your beats config) then they have full control of your cluster.
You should create a new user specifically for beat ingest, and give it a role that only has access to the indices you want winlogbeat to write to
Thanks for the reply, that was very informative. Right now this system is just a dev cluster and is only used for testing purposes and no real logs are being sent to it, but I definitely understand those security risks of using the elastic account.
I copied the settings from my elasticsearch.yml and it is below. Would I need to just copy these certs to the winlogbeat host and add the path to the winlogbeat.yml? Would one of these need to be recreated as a pem file?
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.