Hi @ddpowers,
I have conf file like:
input {
tcp {
mode => "server"
host => "****"
port => "****"
ssl_enable => "true"
ssl_cert => "/usr/share/logstash/config/server.crt"
ssl_key => "/usr/share/logstash/config/privateKey.key"
ssl_key_passphrase => "****"
ssl_verify => "false"
ssl_cipher_suites => ['TLS_AES_256_GCM_SHA384', 'TLS_AES_128_GCM_SHA256', 'TLS_CHACHA20_POLY1305_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256', 'TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384', 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256']
ssl_supported_protocols => ['TLSv1.2', 'TLSv1.3']
codec => "json_lines"
tags => "ssl_TCPinput"}}
filter..
output {
opensearch {
hosts => ["***:9200","***:9200","***:9200"]
ssl => true
ssl_certificate_verification => false
user => "logstash-account"
password => "****"
index => "%{[@metadata][target_index]}-temporary-%{+YYYY-MM-dd}"
manage_template => false
}
}
I tried to find out way to use certs but I find out problem that I generated bad certificates for http I think.
Bcs my Opensearch.yml and certs there are:
plugins.security.ssl.transport.pemcert_filepath: esnode.pem
plugins.security.ssl.transport.pemkey_filepath: esnode-key.pem
plugins.security.ssl.transport.pemtrustedcas_filepath: root-ca.pem
plugins.security.ssl.transport.enforce_hostname_verification: false
plugins.security.ssl.http.enabled: true
plugins.security.ssl.http.pemcert_filepath: server-opensearch-cert.pem
plugins.security.ssl.http.pemkey_filepath: server-opensearch-key8.pem
plugins.security.ssl.http.pemtrustedcas_filepath: cacert-all.pem
And when I try to use them in curl for some authentication:
curl -k https://localhost:9200 --cacert /etc/pki/opensearch/http/certs/cacert-all.pem --key /etc/pki/opensearch/http/keys/server-opensearch-key8.pem --cert /etc/pki/opensearch/http/certs/server-opensearch-cert.pem
I get an error : curl: (56) OpenSSL SSL_read: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown, errno 0
, which means Exception: Exception during establishing a SSL connecti
on: javax.net.ssl.SSLHandshakeException: Extended key usage does not permit use for TLS client authentication
so: This indicates that the client certificate has Extended Key Usage defined, which does NOT support client authentication. This error message indicates that the certificate is being for client authentication but the Extended Key Value indicates it can only be used for server authentication. Thus, you would go back to the CA to ask to get this fixed. SEAS always does client authentication and there is no way around it. You should get a certificate from your CA with both the server and client flags turned on.
So: I have to regenerate certs and 1) dont specify a key usage extension or 2) specify both “serverAuth” and “clientAuth” in there…
but my question is can Logstash use these certs to authenticate then?