You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/concepts/configuration/configuration_code.rst
+276Lines changed: 276 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -319,6 +319,282 @@ In case of a single URI, the following syntax also works:
319
319
}
320
320
321
321
322
+
.. _configuration_code_iproto-encryption:
323
+
324
+
Traffic encryption
325
+
------------------
326
+
327
+
.. admonition:: Enterprise Edition
328
+
:class: fact
329
+
330
+
Traffic encryption is supported by the `Enterprise Edition <https://www.tarantool.io/compare/>`_ only.
331
+
332
+
Since version 2.10.0, Tarantool Enterprise Edition has the built-in support for using SSL to encrypt the client-server communications over :ref:`binary connections <box_protocol-iproto_protocol>`,
333
+
that is, between Tarantool instances in a cluster or connecting to an instance via connectors using :doc:`net.box </reference/reference_lua/net_box>`.
334
+
335
+
Tarantool uses the OpenSSL library that is included in the delivery package.
336
+
Note that SSL connections use only TLSv1.2.
337
+
338
+
.. _configuration_code_iproto-encryption-config:
339
+
340
+
Configuration
341
+
~~~~~~~~~~~~~
342
+
343
+
To configure traffic encryption, you need to set the special :ref:`URI parameters <index-uri-several-params>` for a particular connection.
344
+
The parameters can be set for the following ``box.cfg`` options and ``nex.box`` method:
345
+
346
+
* :ref:`box.cfg.listen <cfg_basic-listen>` -- on the server side.
347
+
* :ref:`box.cfg.replication <cfg_replication-replication>`--on the client side.
348
+
* :ref:`net_box_object.connect() <net_box-connect>`--on the client side.
349
+
350
+
Below is the list of the parameters.
351
+
In the :ref:`next section <configuration_code_iproto-encryption-config-sc>`, you can find details and examples on what should be configured on both the server side and the client side.
352
+
353
+
* ``transport`` -- enables SSL encryption for a connection if set to ``ssl``.
354
+
The default value is ``plain``, which means the encryption is off. If the parameter is not set, the encryption is off too.
355
+
Other encryption-related parameters can be used only if the ``transport = 'ssl'`` is set.
* ``ssl_key_file`` -- a path to a private SSL key file.
366
+
Mandatory for a server.
367
+
For a client, it's mandatory if the ``ssl_ca_file`` parameter is set for a server; otherwise, optional.
368
+
If the private key is encrypted, provide a password for it in the ``ssl_password`` or ``ssl_password_file`` parameter.
369
+
370
+
* ``ssl_cert_file`` -- a path to an SSL certificate file.
371
+
Mandatory for a server.
372
+
For a client, it's mandatory if the ``ssl_ca_file`` parameter is set for a server; otherwise, optional.
373
+
374
+
* ``ssl_ca_file`` -- a path to a trusted certificate authorities (CA) file. Optional. If not set, the peer won't be checked for authenticity.
375
+
376
+
Both a server and a client can use the ``ssl_ca_file`` parameter:
377
+
378
+
* If it's on the server side, the server verifies the client.
379
+
* If it's on the client side, the client verifies the server.
380
+
* If both sides have the CA files, the server and the client verify each other.
381
+
382
+
* ``ssl_ciphers`` -- a colon-separated (``:``) list of SSL cipher suites the connection can use. See the :ref:`configuration_code_iproto-encryption-ciphers` section for details. Optional.
383
+
Note that the list is not validated: if a cipher suite is unknown, Tarantool just ignores it, doesn't establish the connection and writes to the log that no shared cipher found.
384
+
385
+
* ``ssl_password`` -- a password for an encrypted private SSL key. Optional. Alternatively, the password
386
+
can be provided in ``ssl_password_file``.
387
+
388
+
* ``ssl_password_file`` -- a text file with one or more passwords for encrypted private SSL keys
389
+
(each on a separate line). Optional. Alternatively, the password can be provided in ``ssl_password``.
390
+
391
+
Tarantool applies the ``ssl_password`` and ``ssl_password_file`` parameters in the following order:
392
+
393
+
1. If ``ssl_password`` is provided, Tarantool tries to decrypt the private key with it.
394
+
2. If ``ssl_password`` is incorrect or isn't provided, Tarantool tries all passwords from ``ssl_password_file``
395
+
one by one in the order they are written.
396
+
3. If ``ssl_password`` and all passwords from ``ssl_password_file`` are incorrect,
397
+
or none of them is provided, Tarantool treats the private key as unencrypted.
398
+
399
+
Configuration example:
400
+
401
+
.. code-block:: lua
402
+
403
+
box.cfg{ listen = {
404
+
uri = 'localhost:3301',
405
+
params = {
406
+
transport = 'ssl',
407
+
ssl_key_file = '/path_to_key_file',
408
+
ssl_cert_file = '/path_to_cert_file',
409
+
ssl_ciphers = 'HIGH:!aNULL',
410
+
ssl_password = 'topsecret'
411
+
}
412
+
}}
413
+
414
+
.. _configuration_code_iproto-encryption-ciphers:
415
+
416
+
Supported ciphers
417
+
*****************
418
+
419
+
Tarantool Enterprise supports the following cipher suites:
420
+
421
+
* ECDHE-ECDSA-AES256-GCM-SHA384
422
+
* ECDHE-RSA-AES256-GCM-SHA384
423
+
* DHE-RSA-AES256-GCM-SHA384
424
+
* ECDHE-ECDSA-CHACHA20-POLY1305
425
+
* ECDHE-RSA-CHACHA20-POLY1305
426
+
* DHE-RSA-CHACHA20-POLY1305
427
+
* ECDHE-ECDSA-AES128-GCM-SHA256
428
+
* ECDHE-RSA-AES128-GCM-SHA256
429
+
* DHE-RSA-AES128-GCM-SHA256
430
+
* ECDHE-ECDSA-AES256-SHA384
431
+
* ECDHE-RSA-AES256-SHA384
432
+
* DHE-RSA-AES256-SHA256
433
+
* ECDHE-ECDSA-AES128-SHA256
434
+
* ECDHE-RSA-AES128-SHA256
435
+
* DHE-RSA-AES128-SHA256
436
+
* ECDHE-ECDSA-AES256-SHA
437
+
* ECDHE-RSA-AES256-SHA
438
+
* DHE-RSA-AES256-SHA
439
+
* ECDHE-ECDSA-AES128-SHA
440
+
* ECDHE-RSA-AES128-SHA
441
+
* DHE-RSA-AES128-SHA
442
+
* AES256-GCM-SHA384
443
+
* AES128-GCM-SHA256
444
+
* AES256-SHA256
445
+
* AES128-SHA256
446
+
* AES256-SHA
447
+
* AES128-SHA
448
+
* GOST2012-GOST8912-GOST8912
449
+
* GOST2001-GOST89-GOST89
450
+
451
+
Tarantool Enterprise static build has the embedded engine to support the GOST cryptographic algorithms.
452
+
If you use these algorithms for traffic encryption, specify the corresponding cipher suite in the ``ssl_ciphers`` parameter, for example:
453
+
454
+
.. code-block:: lua
455
+
456
+
box.cfg{ listen = {
457
+
uri = 'localhost:3301',
458
+
params = {
459
+
transport = 'ssl',
460
+
ssl_key_file = '/path_to_key_file',
461
+
ssl_cert_file = '/path_to_cert_file',
462
+
ssl_ciphers = 'GOST2012-GOST8912-GOST8912'
463
+
}
464
+
}}
465
+
466
+
For detailed information on SSL ciphers and their syntax, refer to `OpenSSL documentation <https://www.openssl.org/docs/man1.1.1/man1/ciphers.html>`__.
467
+
468
+
Using environment variables
469
+
***************************
470
+
471
+
The URI parameters for traffic encryption can also be set via :ref:`environment variables <box-cfg-params-env>`, for example:
When configuring the traffic encryption, you need to specify the necessary parameters on both the server side and the client side.
484
+
Below you can find the summary on the options and parameters to be used and :ref:`examples of configuration <configuration_code_iproto-encryption-config-example>`.
485
+
486
+
**Server side**
487
+
488
+
* Is configured via the ``box.cfg.listen`` option.
489
+
* Mandatory URI parameters: ``transport``, ``ssl_key_file`` and ``ssl_cert_file``.
490
+
* Optional URI parameters: ``ssl_ca_file``, ``ssl_ciphers``, ``ssl_password``, and ``ssl_password_file``.
491
+
492
+
493
+
**Client side**
494
+
495
+
* Is configured via the ``box.cfg.replication`` option (see :ref:`details <configuration_code_iproto-encryption-config-example>`) or ``net_box_object.connect()``.
496
+
497
+
Parameters:
498
+
499
+
* If the server side has only the ``transport``, ``ssl_key_file`` and ``ssl_cert_file`` parameters set,
500
+
on the client side, you need to specify only ``transport = ssl`` as the mandatory parameter.
501
+
All other URI parameters are optional.
502
+
503
+
* If the server side also has the ``ssl_ca_file`` parameter set,
504
+
on the client side, you need to specify ``transport``, ``ssl_key_file`` and ``ssl_cert_file`` as the mandatory parameters.
505
+
Other parameters -- ``ssl_ca_file``, ``ssl_ciphers``, ``ssl_password``, and ``ssl_password_file`` -- are optional.
0 commit comments