I am setting up and Elasticsearch server on a system that uses letsencrypt certificates.
The certificates and keys live under /etc/letsencrypt. There are several applications that need to access those key and rather than make copies of them I have created a new group called letsencrypt to which the users that need access to the keys belong.
I then created a sym link:
lrwxrwxrwx 1 root letsencrypt 52 Nov 10 13:43 /etc/elasticsearch/ssl -> /etc/letsencrypt/live/secmonprd08.its.auckland.ac.nz
on user Elasticsearch:
sudo su - elasticsearch
elasticsearch@secmonprd08:~$ ls -lL /etc/elasticsearch/ssl
total 24
-rw-r----- 1 root letsencrypt 2305 Nov 2 15:58 cert.pem
-rw-r----- 1 root letsencrypt 3750 Nov 2 15:58 chain.pem
-rw-r----- 1 root letsencrypt 6055 Nov 2 15:58 fullchain.pem
-rw-r----- 1 root letsencrypt 3272 Nov 2 15:58 privkey.pem
-rw-r--r-- 2 root root 682 Nov 16 2020 README
elasticsearch@secmonprd08:~$ head /etc/elasticsearch/ssl/cert.pem
-----BEGIN CERTIFICATE-----
MIIGeTCCBWGgAwIBAgISBP7MuB1v+rytye62clRw/sVqMA0GCSqGSIb3DQEBCwUA
MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD
EwJSMzAeFw0yMTExMDIwMTU4NDBaFw0yMjAxMzEwMTU4MzlaMCkxJzAlBgNVBAMT
HnNlY21vbnByZDA4Lml0cy5hdWNrbGFuZC5hYy5uejCCAiIwDQYJKoZIhvcNAQEB
BQADggIPADCCAgoCggIBAKkvl55CY+aPr0Qi5t4nZgsj3WXIpQd0feO1JOsbNptN
lgdM3Rv/Q7W2MJmqB7dReieOQYwGswE9ge8F5o6stkvwnSkH3NzefxKut/ZTplD2
awxhhC7+p2PVzqH8yKYm81oOmRpYI0viaAcueE1mAwkC6R6ECJg7gFWbK7JmScHS
A3huIJBTFyVOMvKK2oiTfEd6mULqhv8XLOy0I0mJm7pY6eongEmoecFyMcyPu/Wu
mpJrgznQDfQndZGIE2lijN56oDkQsHiHPDnDXNB5T9pZNPIsVq8Y8SMq7n+YgVdp
ES appears to have full access to the files.
When I start Elasticsearch I get:
[2021-11-16T13:00:01,096][ERROR][o.e.x.c.s.SSLConfigurationReloader] [secmonprd08] failed to start watching directory [/etc/elasticsearch/ssl] for ssl configurations [[SSLConfiguration{keyConfig=[keyPath=[/etc/elasticsearch/ssl/privkey.pem], certPaths=[/etc/elasticsearch/ssl/fullchain.pem]], trustConfig=Combining Trust Config{JDK trusted certs, keyPath=[/etc/elasticsearch/ssl/privkey.pem], certPaths=[/etc/elasticsearch/ssl/fullchain.pem]}], cipherSuites=[[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA]], supportedProtocols=[[TLSv1.3, TLSv1.2, TLSv1.1]], sslClientAuth=[REQUIRED], verificationMode=[FULL]}, SSLConfiguration{keyConfig=[keyPath=[/etc/elasticsearch/ssl/privkey.pem], certPaths=[/etc/elasticsearch/ssl/fullchain.pem]], trustConfig=Combining Trust Config{JDK trusted certs, keyPath=[/etc/elasticsearch/ssl/privkey.pem], certPaths=[/etc/elasticsearch/ssl/fullchain.pem]}], cipherSuites=[[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA]], supportedProtocols=[[TLSv1.3, TLSv1.2, TLSv1.1]], sslClientAuth=[NONE], verificationMode=[FULL]}]] - java.security.AccessControlException: access denied ("java.io.FilePermission" "/etc/elasticsearch/ssl" "read")
It would appear that java can not read "/etc/Elasticsearch/ssl"
Any ideas what the problem is?
Russell