navigation_title | applies_to | mapped_pages | ||||
---|---|---|---|---|---|---|
Set up HTTPS |
|
% Scope: HTTP certificates setup / manual configuration / multi or single node cluster % original title: Set up basic security for the {{stack}} plus secured HTTPS traffic
Enabling TLS on the HTTP layer, widely known as HTTPS, ensures that all client communications with your cluster are encrypted, adding a critical layer of security.
This document focuses on the manual configuration of HTTPS for {{es}} and {{kib}}. Use this approach if you want to provide your own TLS certificates, generate them with Elastic’s tools, or have full control over the configuration.
Note that HTTPS configuration for {{kib}} is always manual. Alternatively, {{es}} supports automatic HTTPS setup, which can simplify the process if full customization isn't required.
In this guide, you will learn how to:
- Generate and configure TLS certificates for the HTTP endpoints of your {{es}} nodes.
- Configure {{kib}} to securely connect to {{es}} over HTTPS by trusting the Certificate Authority (CA) used by {{es}}.
- Generate and configure TLS certificates for the {{kib}} HTTP interface to secure {{kib}} access.
Refer to HTTP TLS/SSL settings for the complete list of available settings in {{es}}.
::::{note}
This guide uses the elasticsearch-certutil
tool to generate Certificate Authorities (CAs) and TLS certificates. However, using this tool is not required. You can use publicly trusted certificates, your organization's internal certificate management system, or any other method that produces valid certificates.
If you already have certificates available, you can skip the certificate generation steps and proceed directly to the {{es}} and {{kib}} configuration steps. ::::
::::{tip}
When running elasticsearch-certutil
in http
mode, the tool prompts you to choose how to generate the TLS certificates. One key question is whether you want to generate a Certificate Signing Request (CSR).
- Answer
n
to skip the CSR and sign your certificates using a Certificate Authority (CA) you previously created. You’ll be prompted to provide the path to your CA, which the tool will use to generate a.p12
certificate. The steps in this guide follow this workflow for {{es}} certificates. - Answer
y
to generate a CSR that can be signed by your organization's internal CA or external certificate provider. This is common in environments where trust is managed centrally. The steps in this guide follow this workflow for {{kib}} certificate.
Both workflows are supported. Choose the one that best fits your infrastructure and trust model. ::::
If security feature wasn't already enabled in your cluster, complete all steps in .
For multi-node clusters, ensure you have completed the transport TLS setup. As part of that process, you will have created a Certificate Authority (CA) that this guide reuses to issue HTTP certificates.
If you prefer to use a separate CA for HTTP, you can generate a new one using the same process. For example:
elasticsearch-certutil ca --out http-ca.p12
Then, use this CA to sign your HTTP certificates in the next section and for {{kib}} HTTP endpoint.
% Encrypt HTTP client communications for {{es}}
Once TLS is enabled, all client communications with the cluster will be encrypted. Clients must connect using https
and be configured to trust the Certificate Authority (CA) that signed the {{es}} certificates.
-
On every node in your cluster, stop {{es}} and {{kib}} if they are running.
-
On any single node, from the directory where you installed {{es}}, run the {{es}} HTTP certificate tool to generate TLS certificates for your nodes.
./bin/elasticsearch-certutil http
This command generates a
.zip
file that contains certificates and keys to use with {{es}} and {{kib}}. Each folder contains aREADME.txt
explaining how to use these files.-
When asked if you want to generate a CSR, enter
n
. -
When asked if you want to use an existing CA, enter
y
. -
Enter the path to your CA. This is the absolute path to the
elastic-stack-ca.p12
file that you generated for your cluster. -
Enter the password for your CA.
-
Enter an expiration value for your certificate. You can enter the validity period in years, months, or days. For example, enter
90D
for 90 days. -
When asked if you want to generate one certificate per node, enter
y
.Each certificate will have its own private key, and will be issued for a specific hostname or IP address.
-
When prompted, enter the name of the first node in your cluster.
-
Enter all hostnames used to connect to your first node. These hostnames will be added as DNS names in the Subject Alternative Name (SAN) field in your certificate.
List every hostname and variant used to connect to your cluster over HTTPS.
-
Enter the IP addresses that clients can use to connect to your node.
-
Repeat these steps for each additional node in your cluster.
-
-
After generating a certificate for each of your nodes, enter a password for your private key when prompted.
-
Unzip the generated
elasticsearch-ssl-http.zip
file. This compressed file contains one directory for both {{es}} and {{kib}}./elasticsearch |_ README.txt |_ http.p12 |_ sample-elasticsearch.yml
/kibana |_ README.txt |_ elasticsearch-ca.pem |_ sample-kibana.yml
-
On every node in your cluster, complete the following steps:
-
Copy the relevant
http.p12
certificate to the$ES_PATH_CONF
directory. -
Edit the
elasticsearch.yml
file to enable HTTPS security and specify the location of thehttp.p12
security certificate.xpack.security.http.ssl.enabled: true xpack.security.http.ssl.keystore.path: http.p12
-
Add the password for your private key to the secure settings in {{es}}.
./bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
-
Start {{es}}.
-
{{kib}} handles two separate types of HTTP traffic that should be encrypted:
- Outgoing requests from {{kib}} to {{es}}: {{kib}} acts as an HTTP client and must be configured to trust the TLS certificate used by {{es}}.
- Incoming requests from browsers or API clients to {{kib}}: {{kib}} acts as an HTTP server, and you should configure a TLS certificate for its public-facing endpoint to secure clients traffic.
:::{include} /deploy-manage/security/_snippets/kibana-client-https-setup.md :::
:::{include} /deploy-manage/security/_snippets/kibana-https-setup.md :::
After having enabled HTTPS, you should configure any other client that interacts with {{es}} or {{kib}} to use HTTPS and trust the appropriate CA certificate. Refer to Secure other {{stack}} components and Securing HTTP client applications for more details.
For other tasks related with TLS encryption in self-managed deployments, refer to .