|
| 1 | +[[tls-overview]] |
| 2 | += One-way and mutual TLS certifications flow |
| 3 | + |
| 4 | +The following is an overview of how the various certificates and certificate authorities (CAs) that you configure using the `elastic-agent install` secure connection options relate to each other. |
| 5 | + |
| 6 | +* <<one-way-tls-connection>> |
| 7 | +* <<mutual-tls-connection>> |
| 8 | + |
| 9 | +[discrete] |
| 10 | +[[one-way-tls-connection]] |
| 11 | +== Simple one-way TLS connection |
| 12 | + |
| 13 | +The following install command configures a {fleet-server} with the required certificates and certificate authorities to enable one-way TLS connections between the components involved: |
| 14 | + |
| 15 | +[source,shell] |
| 16 | +---- |
| 17 | +elastic-agent install --url=https://your-fleet-server.elastic.co:443 \ |
| 18 | +--certificate-authorities=/path/to/fleet-ca \ |
| 19 | +--fleet-server-es=https://es.elastic.com:443 \ |
| 20 | +--fleet-server-es-ca=/path/to/es-ca \ |
| 21 | +--fleet-server-cert=/path/to/fleet-cert \ |
| 22 | +--fleet-server-cert-key=/path/to/fleet-cert-key \ |
| 23 | +--fleet-server-service-token=FLEET-SERVER-SERVICE-TOKEN \ |
| 24 | +--fleet-server-policy=FLEET-SERVER-POLICY-ID \ |
| 25 | +--fleet-server-port=8220 |
| 26 | +---- |
| 27 | + |
| 28 | +{agent} is configured with `fleet-ca` as the certificate authority it needs to validate certificates from {fleet-server}. |
| 29 | + |
| 30 | +During the TLS connection setup, {fleet-server} presents its certificate `fleet-cert` to the agent and the agent (as a client) uses `fleet-ca` to validate this certificate. |
| 31 | + |
| 32 | +image::images/tls-overview-oneway-fs-agent.png[Diagram of one-way TLS connection between Fleet Server and Elastic Agent] |
| 33 | + |
| 34 | +{fleet-server} also establishes a secure connection to an {es} cluster. In this case, {fleet-server} is configured with the certificate authority from {es} `es-ca`. {es} presents its certificate, `es-cert`, and {fleet-server} validates this certificate using certificate authority `es-ca`. |
| 35 | + |
| 36 | +image::images/tls-overview-oneway-fs-es.png[Diagram of one-way TLS connection between Fleet Server and Elasticsearch] |
| 37 | + |
| 38 | +The following diagram shows the one-way TLS connection relationship between components: |
| 39 | + |
| 40 | +image::images/tls-overview-oneway-all.jpg[Diagram of one-way TLS connection between components] |
| 41 | + |
| 42 | +[discrete] |
| 43 | +[[mutual-tls-connection]] |
| 44 | +== Mutual TLS connection |
| 45 | + |
| 46 | +The following install command configures a {fleet-server} with the required certificates and certificate authorities to enable mutual TLS connections between the components involved: |
| 47 | + |
| 48 | +[source,shell] |
| 49 | +---- |
| 50 | +elastic-agent install --url=https://your-fleet-server.elastic.co:443 \ |
| 51 | +--certificate-authorities=/path/to/fleet-ca,/path/to/agent-ca \ |
| 52 | +--elastic-agent-cert=/path/to/agent-cert \ |
| 53 | +--elastic-agent-cert-key=/path/to/agent-cert-key \ |
| 54 | +--fleet-server-es=https://es.elastic.com:443 \ |
| 55 | +--fleet-server-es-ca=/path/to/es-ca \ |
| 56 | +--fleet-server-es-cert=/path/to/fleet-es-cert \ |
| 57 | +--fleet-server-es-cert-key=/path/to/fleet-es-cert-key \ |
| 58 | +--fleet-server-cert=/path/to/fleet-cert \ |
| 59 | +--fleet-server-cert-key=/path/to/fleet-cert-key \ |
| 60 | +--fleet-server-client-auth=required \ |
| 61 | +--fleet-server-service-token=FLEET-SERVER-SERVICE-TOKEN \ |
| 62 | +--fleet-server-policy=FLEET-SERVER-POLICY-ID \ |
| 63 | +--fleet-server-port=8220 |
| 64 | +---- |
| 65 | + |
| 66 | +As with the <<one-way-tls-connection,one-way TLS example>>, {agent} is configured with `fleet-ca` as the certificate authority it needs to validate certificates from the {fleet-server}. {fleet-server} presents its certificate `fleet-cert` to the agent and the agent (as a client) uses `fleet-ca` to validate the presented certificate. |
| 67 | + |
| 68 | +To establish a mutual TLS connection, the agent will present its certificate, `agent-cert`, and {fleet-server} will validate this certificate using the `agent-ca` that it has stored in memory. |
| 69 | + |
| 70 | +image::images/tls-overview-mutual-fs-agent.png[Diagram of mutual TLS connection between Fleet Server and Elastic Agent] |
| 71 | + |
| 72 | +{fleet-server} can also establish a mutual TLS connection to the {es} cluster. In this case {fleet-server} is configured with the certificate authority from the {es} `es-ca` and uses this to validate the certificate `es-cert` presented to it by {es}. |
| 73 | + |
| 74 | +image::images/tls-overview-mutual-fs-es.png[Diagram of mutual TLS connection between Fleet Server and Elasticsearch] |
| 75 | + |
| 76 | +Note that you can also configure mutual TLS for {fleet-server} and {agent} <<mutual-tls-cloud-proxy,using a proxy>>. |
| 77 | + |
| 78 | +The following diagram shows the mutual TLS connection relationship between components: |
| 79 | + |
| 80 | +image::images/tls-overview-mutual-all.jpg[Diagram of mutual TLS connection between components] |
0 commit comments