Skip to content

Commit 14676bc

Browse files
authored
Add a diagram for CAs and Certs usage between agent, fleet-server and ES (#5263)
* add a diagram for CAs and Certs usage
1 parent 0dc7e95 commit 14676bc

File tree

1 file changed

+146
-0
lines changed

1 file changed

+146
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# TLS between Elastic AGent <-> Fleet Server <-> Elasticsearch
2+
3+
This shows the different certificates and certificate authorities used by the Elastic Agent, Fleet Server and Elasticsearch for the control plane communication and their respective cli flags when installing the Elastic Agent.
4+
5+
- Elastic Agent (client) makes HTTPS requests to Fleet Server (server)
6+
- Fleet Server (client) makes HTTPS requests to Elasticsearch (server)
7+
8+
## TLS
9+
10+
For the TLS case, the following is used:
11+
- fleet-ca: the certificate authority for the certificate presented by Fleet Server
12+
- fleet-cert: the TLS certificate Fleet Server presents when a client makes an HTTPS request
13+
- fleet-cert-key: the private key for Fleet Server's TLS certificate (not shown in the diagram)
14+
- es-ca: the certificate authority for the certificate presented by Elasticsearch
15+
16+
```shell
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+
```mermaid
28+
flowchart LR
29+
subgraph TLS
30+
elastic-agent
31+
fleet-server
32+
elasticsearch
33+
end
34+
35+
36+
fleet-server --> |**fleet-server: presents fleet-cert**
37+
--fleet-server-cert=fleet-cert| elastic-agent
38+
39+
elastic-agent --> |**agent validates fleet-ca:**
40+
--certificate-authorities=/path/to/fleet-ca| fleet-server
41+
42+
fleet-server --> | **fleet-server es-ca validates es-cert:**
43+
--fleet-server-es-ca=es-ca| elasticsearch
44+
45+
elasticsearch --> | **elasticsearch presents es-cert**| fleet-server
46+
47+
48+
subgraph elasticsearch
49+
es-cert
50+
end
51+
subgraph fleet-server
52+
fleet-cert
53+
es-ca
54+
end
55+
subgraph elastic-agent
56+
fleet-ca
57+
end
58+
```
59+
60+
## mTLS
61+
62+
For the mTLS case, the following is used:
63+
- agent-ca: the certificate authority for the certificate presented by the Elastic Agent
64+
- agent-cert: the client TLS certificate Elastic Agent presents to Fleet Server
65+
- agent-cert-key: the private key for the Elastic Agent's TLS certificate (not shown in the diagram)
66+
67+
- fleet-ca: the certificate authority for the certificate presented by Fleet Server
68+
- fleet-cert: the TLS certificate Fleet Server presents when a client makes an HTTPS request
69+
- fleet-cert-key: the private key for Fleet Server's TLS certificate (not shown in the diagram)
70+
71+
- fleet-es-ca: the certificate authority for the client TLS certificate presented by Fleet Server to Elasticsearch
72+
- fleet-es-cert: the client TLS certificate Fleet Server presents to Elasticsearch
73+
- fleet-es-cert-key: the private key for Fleet Server's client TLS certificate (not shown in the diagram)
74+
75+
- es-ca: the certificate authority for the certificate presented by Elasticsearch
76+
- es-cert: the TLS certificate Elasticsearch presents when a client makes an HTTPS request
77+
78+
```shell
79+
elastic-agent install --url=https://your-fleet-server.elastic.co:443 \
80+
--certificate-authorities=/path/to/fleet-ca,/path/to/agent-ca \
81+
--elastic-agent-cert=/path/to/agent-cert \
82+
--elastic-agent-cert-key=/path/to/agent-cert-key \
83+
--fleet-server-es=https://es.elastic.com:443 \
84+
--fleet-server-es-ca=/path/to/es-ca \
85+
--fleet-server-es-cert=/path/to/fleet-es-cert \
86+
--fleet-server-es-cert-key=/path/to/fleet-es-cert-key \
87+
--fleet-server-cert=/path/to/fleet-cert \
88+
--fleet-server-cert-key=/path/to/fleet-cert-key \
89+
--fleet-server-client-auth=required \
90+
--fleet-server-service-token=FLEET-SERVER-SERVICE-TOKEN \
91+
--fleet-server-policy=FLEET-SERVER-POLICY-ID \
92+
--fleet-server-port=8220
93+
```
94+
```mermaid
95+
flowchart LR
96+
subgraph mTLS
97+
elastic-agent((elastic-agent))
98+
99+
fleet-server((fleet-server))
100+
elasticsearch((elasticsearch))
101+
102+
end
103+
104+
105+
elastic-agent --> |**agent: fleet-ca validates fleet-cert:**
106+
--certificate-authorities=/path/to/fleet-ca| fleet-server
107+
108+
elastic-agent --> |**agent presents agent-cert:**
109+
--elastic-agent-cert=agent-cert| fleet-server
110+
111+
112+
fleet-server --> |**fleet-server: presents fleet-cert**
113+
--fleet-server-cert=fleet-cert| elastic-agent
114+
115+
fleet-server --> |**fleet-server: agent-ca validates agent-cert**
116+
--certificate-authorities=fleet-ca,agent-ca| elastic-agent
117+
118+
119+
fleet-server --> | **fleet-server es-ca validates es-cert:**
120+
--fleet-server-es-ca=es-ca| elasticsearch
121+
122+
fleet-server --> | **fleet-server presents fleet-es-cert:**
123+
--fleet-server-es-cert=fleet-es-cert| elasticsearch
124+
125+
126+
elasticsearch --> | **elasticsearch presents es-cert**| fleet-server
127+
elasticsearch --> | **elasticsearch: fleet-es-ca validates fleet-es-cert**| fleet-server
128+
129+
130+
subgraph elastic-agent
131+
fleet-ca
132+
agent-cert
133+
end
134+
subgraph fleet-server
135+
fleet-cert
136+
fleet-es-cert
137+
agent-ca
138+
es-ca
139+
end
140+
subgraph elasticsearch
141+
es-cert
142+
fleet-es-ca
143+
end
144+
```
145+
146+

0 commit comments

Comments
 (0)