zoukankan      html  css  js  c++  java
  • MariaDB

    翻译自链接:https://mariadb.com/kb/en/secure-connections-overview/

    Encryption 加密

    传输中数据的加密

    安全连接概述

    默认情况下,MariaDB在服务器和客户端之间传输数据而不进行加密。当服务器和客户端在同一主机或网络上运行时,以其他方式保证安全性,这通常是可以接受的。但是,如果服务器和客户端存在于单独的网络上,或者它们处于高风险的网络中,缺乏加密确实带来了安全问题,因为恶意的参与者可能会窃听通过网络在他们之间发送的通信。

    为了减轻这种担忧,MariaDB允许您使用 Transport Layer Security(TLS)协议对服务器和客户端之间传输的数据进行加密。TLS以前称为 Secure Socket Layer(SSL),但严格来说,SSL协议是TLS的前身,并且该协议版本现在被认为是不安全的。文档仍然经常使用SSL术语,并且出于兼容性原因,与TLS相关的服务器系统和状态变量仍使用前缀ssl_,但在内部,MariaDB仅支持其安全的继任者(TLS)。

    检查MariaDB服务器是否支持TLS

    为了使MariaDB服务器使用 TLS,需要使用 TLS 支持对其进行编译。MariaDB Foundation 和MariaDB Corporation 分发的所有 MariaDB 软件包均使用 TLS 支持进行编译。如果不确定您的MariaDB Server二进制文件是否使用TLS支持进行编译,那么您可以检查 have_ssl 系统变量的值。 例如:

    SHOW GLOBAL VARIABLES LIKE 'have_ssl';
    +---------------+----------+
    | Variable_name | Value    |
    +---------------+----------+
    | have_ssl      | DISABLED |
    +---------------+----------+
    

    The possible values are:

    • If it isDISABLED, then the server was compiled with TLS support, but TLS is not enabled.
    • If it isYES, then the server was compiled with TLS support, and TLS is enabled.
    • If it isNO, then the server was not compiled with TLS support.

    TLS 库

    在使用TLS和加密支持编译MariaDB时,通常会静态地链接到MariaDB捆绑的TLS和加密库(可能是wolfSSL或yaSSL),或者动态地链接到系统的TLS和加密库(可能是OpenSSL、GnuTLS或Schannel)。

    TLS协议版本

    TLS协议有4个版本:

    • TLSv1.0
    • TLSv1.1
    • TLSv1.2
    • TLSv1.3

    启用特定的TLS协议版本

    MariaDB starting with10.4

    Thetls_versionsystem variable was first introduced inMariaDB 10.4.6.

    ThePCI DSS v3.2recommends using a minimum protocol version of TLSv1.2.

    tips: PCI DSS v3.2 提了一堆 TLS早期版本的问题,因此建议最低使用 TLSv1.2。

    在我的MariaDB-10.3 的配置如下,并提到了 YaSSL 名词(读下文可知道这是 TLS 库的一种)

    图片

    TLS协议版本支持

    所支持的TLS协议版本依赖于特定MariaDB二进制文件所使用的底层TLS库。

    图片

    TLS Protocol Version Support in OpenSSL

    MariaDB binaries built with theOpenSSLlibrary (OpenSSL 1.0.1or later) support TLSv1.1 and TLSv1.2 sinceMariaDB 5.5.41,MariaDB 10.0.15, andMariaDB 10.1.4.

    MariaDB binaries built with theOpenSSLlibrary (OpenSSL 1.1.1or later) support TLSv1.3 sinceMariaDB 10.2.16andMariaDB 10.3.8.

    如果你的 MariaDB 服务器二进制文件是用OpenSSL构建的,那么你可以将 ssl_cipher 系统变量设置为SSLv3 或 TLSv1.2 这样的值,以允许所有 SSLv3.0 或所有 TLSv1.2 加密。但是限制协议版本为TLSv1.2并不是必须的。有关它的更多信息,请参见MDEV-14101。

    TLS Protocol Version Support in wolfSSL

    MariaDB binaries built with the bundledwolfSSLlibrary support TLSv1.0, TLSv1.1, TLSv1.2, and TLSv1.3.

    TLS Protocol Version Support in yaSSL

    MariaDB binaries built with the bundledyaSSLlibrary support SSLv3.0, TLSv1.0, and TLSv1.1.

    TLS Protocol Version Support in yaSSL

    TLS Protocol Version Support in GnuTLS

    启用TLS

    pass

    证书验证

    证书验证是,TLS通过验证它正在与它所说的对象对话来验证它的连接。验证过程包含多个组件:

    Was the certificate signed by a trusted Certificate Authority (CA)?

    Is the certificate expired?

    Is the certificate on my Certificate Revocation List (CRL)?

    Does the certificate belong to who I believe that I'm communicating with?

    • 证书是否由受信任的证书颁发机构 (CA) 签署?
    • 证书过期了吗?
    • 该证书是否在我的证书撤销清单 (CRL) 上?
    • 证书是否属于我认为正在与之通信的人?
  • 相关阅读:
    自定义checkbox样式
    自定义select样式
    jsonp
    I/O复用 poll简介
    DOS和DDOS攻击
    TCP状态转换图解析
    Makefile入门
    I/O复用select 使用简介
    替换文本内容
    share memory
  • 原文地址:https://www.cnblogs.com/daemonFlY/p/13831273.html
Copyright © 2011-2022 走看看