Skip to content

Commit a4c18a9

Browse files
authored
Feature/mtls (#60)
* caddy version for TLS client auth must be >=2.8 for tls subdirective client_auth: trust_pool * add mTLS documentation * split syntax for compose.yaml and .env file * typo
1 parent 77f7525 commit a4c18a9

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,39 @@ services:
204204
- NET_ADMIN
205205
```
206206

207+
### mTLS (client authentication)
208+
209+
It is possible to use Mutual TLS authentication for client connections, which is useful to prevent MITM attacks and reducing attack vector when running possibly insecure software in your containers.
210+
211+
You will need to create a self-signed CA certificate and sign X.509 client certificates, then use this snippet for your `compose.yaml`
212+
```yaml
213+
TLS_INTERNAL_CONFIG: |2
214+
tls {
215+
client_auth {
216+
mode require_and_verify
217+
trust_pool inline {
218+
trust_der YOUR_BASE64_ENCODED_CA_IN_DER_FORMAT_BELONGS_HERE
219+
}
220+
}
221+
}
222+
```
223+
224+
or this for your `.env` file:
225+
```yaml
226+
TLS_INTERNAL_CONFIG='tls {
227+
client_auth {
228+
mode require_and_verify
229+
trust_pool inline {
230+
trust_der YOUR_BASE64_ENCODED_CA_IN_DER_FORMAT_BELONGS_HERE
231+
}
232+
}
233+
}'
234+
```
235+
236+
Now you won't be able to establish connections to your service withou your client certificate. There are other possible configuration values, of course, please have a look at the official [Caddy documentation](https://caddyserver.com/docs/caddyfile/directives/tls#client_auth).
237+
238+
Keep in mind, this might effect any corporate firewall as there is no way to terminate TLS without breaking client authentication and therefor no way to connect for a client behind one of these appliances.
239+
207240
### Show all links running on a Gateway
208241
```
209242
$ docker ps

src/client-link/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM caddy:2.7
1+
FROM caddy:2.8
22

33
ARG RELEASE_TAG
44

0 commit comments

Comments
 (0)