|
| 1 | +[[tls-overview]] |
| 2 | += One-way and mutual TLS certifications flow |
| 3 | + |
| 4 | +This page provides an overview of the relationship between the various certificates and certificate authorities (CAs) that you configure for {fleet-server} and {agent}, using the `elastic-agent install` TLS command options. |
| 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 `elastic-agent 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 that 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 the presented 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 the {es} `es-ca`. {es} presents its certificate, `es-cert`, and {fleet-server} validates the presented certificate using the 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 | +[discrete] |
| 39 | +=== Relationship between components in a one-way TLS connection |
| 40 | + |
| 41 | +image::images/tls-overview-oneway-all.jpg[Diagram of one-way TLS connection between components] |
| 42 | + |
| 43 | +[discrete] |
| 44 | +[[mutual-tls-connection]] |
| 45 | +== Mutual TLS connection |
| 46 | + |
| 47 | +The following `elastic-agent install` command configures a {fleet-server} with the required certificates and certificate authorities to enable mutual TLS connections between the components involved: |
| 48 | + |
| 49 | +[source,shell] |
| 50 | +---- |
| 51 | +elastic-agent install --url=https://your-fleet-server.elastic.co:443 \ |
| 52 | +--certificate-authorities=/path/to/fleet-ca,/path/to/agent-ca \ |
| 53 | +--elastic-agent-cert=/path/to/agent-cert \ |
| 54 | +--elastic-agent-cert-key=/path/to/agent-cert-key \ |
| 55 | +--fleet-server-es=https://es.elastic.com:443 \ |
| 56 | +--fleet-server-es-ca=/path/to/es-ca \ |
| 57 | +--fleet-server-es-cert=/path/to/fleet-es-cert \ |
| 58 | +--fleet-server-es-cert-key=/path/to/fleet-es-cert-key \ |
| 59 | +--fleet-server-cert=/path/to/fleet-cert \ |
| 60 | +--fleet-server-cert-key=/path/to/fleet-cert-key \ |
| 61 | +--fleet-server-client-auth=required \ |
| 62 | +--fleet-server-service-token=FLEET-SERVER-SERVICE-TOKEN \ |
| 63 | +--fleet-server-policy=FLEET-SERVER-POLICY-ID \ |
| 64 | +--fleet-server-port=8220 |
| 65 | +---- |
| 66 | + |
| 67 | +As with the <<one-way-tls-connection,one-way TLS example>>, {agent} is configured with `fleet-ca` as the certificate authority that 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. |
| 68 | + |
| 69 | +To establish a mutual TLS connection, the agent presents its certificate, `agent-cert`, and {fleet-server} validates this certificate using the `agent-ca` that it has stored in memory. |
| 70 | + |
| 71 | +image::images/tls-overview-mutual-fs-agent.png[Diagram of mutual TLS connection between Fleet Server and Elastic Agent] |
| 72 | + |
| 73 | +{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}. |
| 74 | + |
| 75 | +image::images/tls-overview-mutual-fs-es.png[Diagram of mutual TLS connection between Fleet Server and Elasticsearch] |
| 76 | + |
| 77 | +Note that you can also configure mutual TLS for {fleet-server} and {agent} <<mutual-tls-cloud-proxy,using a proxy>>. |
| 78 | + |
| 79 | +[discrete] |
| 80 | +=== Relationship between components in a mutual TLS connection |
| 81 | + |
| 82 | +image::images/tls-overview-mutual-all.jpg[Diagram of mutual TLS connection between components] |
0 commit comments