Skip to content

Commit 004698f

Browse files
authored
Merge pull request #748 from LaurenceJJones/db_ssl_opts
enhance: add ssl opts for db connections
2 parents f3373cb + 8b48ea4 commit 004698f

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

crowdsec-docs/docs/configuration/crowdsec_configuration.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ db_config:
146146
host: "<db_host_ip>" # for mysql/pgsql
147147
port: "<db_host_port>" # for mysql/pgsql
148148
sslmode: "<require/disable>" # for pgsql
149+
ssl_ca_cert: "<path_to_ca_cert_file>" # for mysql/pgsql
150+
ssl_client_cert: "<path_to_client_cert_file>" # for mysql/pgsql
151+
ssl_client_key: "<path_to_client_key_file>" # for mysql/pgsql
149152
use_wal: "true|false" # for sqlite
150153
max_open_conns: "<max_number_of_conns_to_db>"
151154
flush:
@@ -459,6 +462,9 @@ db_config:
459462
host: "<db_host_ip>" # for mysql/postgresql/pgx # must be omitted if using socket file
460463
port: "<db_host_port>" # for mysql/postgresql/pgx # must be omitted if using socket file
461464
sslmode: "<require/disable>" # for postgresql/pgx
465+
ssl_ca_cert: "<path_to_ca_cert_file>" # for mysql/pgsql
466+
ssl_client_cert: "<path_to_client_cert_file>" # for mysql/pgsql
467+
ssl_client_key: "<path_to_client_key_file>" # for mysql/pgsql
462468
max_open_conns: "<max_number_of_conns_to_db>"
463469
decision_bulk_size: "<decision_bulk_size>"
464470
flush:
@@ -556,13 +562,48 @@ db_config:
556562
The port to connect to (only if the type of database is `mysql` or `postgresql`). Must be omitted if using socket file.
557563

558564

565+
#### `sslmode`
566+
559567
```yaml
560568
db_config:
561569
type: postgresql
562570
563571
sslmode: require
564572
```
565-
Require or disable ssl connection to database (only if the type of database is `postgresql`). See [PostgreSQL SSL modes](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS) for possible values.
573+
Require or disable ssl connection to database (only if the type of database is `mysql` or `postgresql` or `pgx`).
574+
575+
See [PostgreSQL SSL modes](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS) for possible values.
576+
See [MySQL SSL modes](https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html) for possible values within the `Client-Side` configuration.
577+
578+
#### `ssl_ca_cert`
579+
580+
```yaml
581+
db_config:
582+
type: mysql|postgresql|pgx
583+
584+
ssl_ca_cert: /path/to/ca.crt
585+
```
586+
Path to the CA certificate file (only if the type of database is `mysql` or `postgresql` or `pgx`)
587+
588+
#### `ssl_client_cert`
589+
590+
```yaml
591+
db_config:
592+
type: mysql|postgresql|pgx
593+
594+
ssl_client_cert: /path/to/client.crt
595+
```
596+
Path to the client certificate file when using mTLS (only if the type of database is `mysql` or `postgresql` or `pgx`)
597+
598+
#### `ssl_client_key`
599+
600+
```yaml
601+
db_config:
602+
type: mysql|postgresql|pgx
603+
604+
ssl_client_key: /path/to/client.key
605+
```
606+
Path to the client key file when using mTLS (only if the type of database is `mysql` or `postgresql` or `pgx`)
566607

567608
#### `max_open_conns`
568609

0 commit comments

Comments
 (0)