I just tried installing fleet server to a elasticsearch server secured by self-signed certificate. And I get an error message:
app@fs00:~/elastic-agent-7.14.0-linux-x86_64$ sudo ./elastic-agent install -f --fleet-server-es=https://10.1.26.70:9200 --fleet-server-service-token=......
....
....
cmd/enroll_cmd.go:701 Fleet Server - Error - x509: cannot validate certificate for 10.1.26.70 because it doesn't contain any IP SANs
I know a valid certificate is important for production env. But as I just want to do a POC test, is there a way to bypass this validation? For example, set "none" or "certificate" to certain ssl validation settings.
Thanks for your reply. I have tried --insecure but failed. As I understand, --insecure is used by agent to bypass the verification of the self-signed certs used by fleet server. It does not work for the communication between fleet server and elasticsearch. At least it does not work for the IP based access.
Update: I have seen other post mentioned that --insecure is worked for early versions. For 7.14 it seems does not work.
elastic-agent enroll --url=https://IP of the machine:9201
-f
--fleet-server-es=https://IP of the machine:9200
--fleet-server-service-token= token
--fleet-server-policy=policy ID
--certificate-authorities= path to CA (of fleet server in pem format)
--fleet-server-es-ca=path to CA (of elasticsearch in pem format)
--fleet-server-cert=path to cert in pem format
--fleet-server-cert-key=path to key in pem format
I've tried also with --insecure flag
But the same error persist Fleet Server - Error - x509: cannot validate certificate for *machine ip* because it doesn't contain any IP SANs
I've found a solution, the problem is on elasticsearch side.
When you create a certificate for elasticsearch you must specify a SAN (with IP or DNS record name).
I've followed this guide for creating a self signed certificate with SAN specified.
Hi Nick,
Thanks for your solution. A well-formed certificate together with customized certificate-authorities would fullfill the requirment of Fleet Server. But the requirement of a valid certificate still exist. And according to my experience, it is more strict than other components of Elastic Stack. The requirment rise the learning curve for fleet and agent.
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.