Skip to content

Commit 397a33a

Browse files
tls: Add descriptions for x509v3 alt name verification (tls.verify_hostname) (#1393)
* tls: Add a description for tls.verify_hostname parameter Signed-off-by: Hiroshi Hatake <[email protected]> * filter_kubernetes: Add a description for tls.verify_hostname Signed-off-by: Hiroshi Hatake <[email protected]> * Address comments Co-authored-by: Pat <[email protected]> Signed-off-by: Hiroshi Hatake <[email protected]> --------- Signed-off-by: Hiroshi Hatake <[email protected]> Co-authored-by: Pat <[email protected]>
1 parent 11070df commit 397a33a

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

administration/transport-security.md

+40
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Both input and output plugins that perform Network I/O can optionally enable TLS
99
| :--- | :--- | :--- |
1010
| tls | enable or disable TLS support | Off |
1111
| tls.verify | force certificate validation | On |
12+
| tls.verify\_hostname | force TLS verification of hostnames | Off |
1213
| tls.debug | Set TLS debug verbosity level. It accept the following values: 0 \(No debug\), 1 \(Error\), 2 \(State change\), 3 \(Informational\) and 4 Verbose | 1 |
1314
| tls.ca\_file | absolute path to CA certificate file | |
1415
| tls.ca\_path | absolute path to scan for certificate files | |
@@ -171,3 +172,42 @@ Fluent Bit supports [TLS server name indication](https://en.wikipedia.org/wiki/S
171172
tls.ca_file /etc/certs/fluent.crt
172173
tls.vhost fluent.example.com
173174
```
175+
176+
### Verify subjectAltName
177+
178+
By default, TLS verification of hostnames is not done automatically.
179+
As an example, we can extract the X509v3 Subject Alternative Name from a certificate:
180+
181+
```
182+
X509v3 Subject Alternative Name:
183+
DNS:my.fluent-aggregator.net
184+
```
185+
186+
As you can see, this certificate covers only `my.fluent-aggregator.net` so if we use a different hostname it should fail.
187+
188+
To fully verify the alternative name and demonstrate the failure we enable `tls.verify_hostname`:
189+
190+
191+
```text
192+
[INPUT]
193+
Name cpu
194+
Tag cpu
195+
196+
[OUTPUT]
197+
Name forward
198+
Match *
199+
Host other.fluent-aggregator.net
200+
Port 24224
201+
tls On
202+
tls.verify On
203+
tls.verify_hostname on
204+
tls.ca_file /path/to/fluent-x509v3-alt-name.crt
205+
```
206+
207+
This outgoing connect will be failed and disconnected:
208+
209+
```
210+
[2024/06/17 16:51:31] [error] [tls] error: unexpected EOF with reason: certificate verify failed
211+
[2024/06/17 16:51:31] [debug] [upstream] connection #50 failed to other.fluent-aggregator.net:24224
212+
[2024/06/17 16:51:31] [error] [output:forward:forward.0] no upstream connections available
213+
```

pipeline/filters/kubernetes.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The plugin supports the following configuration parameters:
3737
| Keep\_Log | When `Keep_Log` is disabled, the `log` field is removed from the incoming message once it has been successfully merged \(`Merge_Log` must be enabled as well\). | On |
3838
| tls.debug | Debug level between 0 \(nothing\) and 4 \(every detail\). | -1 |
3939
| tls.verify | When enabled, turns on certificate validation when connecting to the Kubernetes API server. | On |
40+
| tls.verify\_hostname | When enabled, turns on hostname validation for certificates | Off |
4041
| Use\_Journal | When enabled, the filter reads logs coming in Journald format. | Off |
4142
| Cache\_Use\_Docker\_Id | When enabled, metadata will be fetched from K8s when docker\_id is changed. | Off |
4243
| Regex\_Parser | Set an alternative Parser to process record Tag and extract pod\_name, namespace\_name, container\_name and docker\_id. The parser must be registered in a [parsers file](https://github.com/fluent/fluent-bit/blob/master/conf/parsers.conf) \(refer to parser _filter-kube-test_ as an example\). | |

0 commit comments

Comments
 (0)