[ 
https://issues.apache.org/jira/browse/THRIFT-3165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III updated THRIFT-3165:
--------------------------------------
    Description: 
Thrift provides an SSL implementation and implements some best practices (for 
example, SSLv2 and SSLv3 are disabled).  The current mechanism in the C++ 
library to control the protocol negotiation is unnecessarily complex.

The current behavior is to use an enumeration to set the protocol level.  The 
methods these call are deprecated in OpenSSL 1.1 and do not provide the desired 
control.

The proposed new behavior is to:

* Remove SSLProtocol
* Require the consumer to subclass SSLContext and call SSL_CTX_set_option to 
disable certain behaviors, like negotiation protocol levels.

For example the following SSLContext subclass will ensure connections are at 
TLSv1_2 or later:

{noformat}
class SSLContextOnlyTLSv12OrLater : public SSLContext
{
  public:
    SSLContextOnlyTLSv12OrLater() : SSLContext()
    {
        // SSLContext already disables SSLv2 and SSLv3
        SSL_CTX_set_options(ctx_, SSL_OP_NO_TLSv1); // This is TLSv1_0
        SSL_CTX_set_options(ctx_, SSL_OP_NO_TLSv1_1);
    }
};
{noformat}

  was:
Thrift provides an SSL implementation and as such we need to ensure that thrift 
as a distribution is not the source of a security risk.  Currently there is no 
uniformity across the library implementations to require a certain level of 
security for SSL communications.

It is therefore proposed that the Thrift project require all SSL 
implementations shipping with the distribution to require TLS 1.2 or later as 
the accepted ciphers for a server socket.  TLS 1.2 was defined in RFC 5246 in 
August of 2008.

By shipping thrift with anything less, the finger can potentially be pointed 
back at thrift as a project for not providing the proper security.  By setting 
the bar as high as possible on components in the package, the third party using 
Thrift must make a conscious decision to add other ciphers that are not as 
strong as TLS 1.2.  Since the third party is making this decision, they are 
fully accepting the consequences of their action.

Given this affects all SSL implementations, it could be done in one commit or 
in multiple commits; if the work is to be split up then it should be done with 
subtasks in Jira.


> Remove TSSLSocket::SSLProtocol and require subclass of SSLContext to control 
> TLS negotiation
> --------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-3165
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3165
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.9.2
>            Reporter: James E. King III
>            Priority: Major
>              Labels: SSL, SSLSocketFactory, Security, TLS
>
> Thrift provides an SSL implementation and implements some best practices (for 
> example, SSLv2 and SSLv3 are disabled).  The current mechanism in the C++ 
> library to control the protocol negotiation is unnecessarily complex.
> The current behavior is to use an enumeration to set the protocol level.  The 
> methods these call are deprecated in OpenSSL 1.1 and do not provide the 
> desired control.
> The proposed new behavior is to:
> * Remove SSLProtocol
> * Require the consumer to subclass SSLContext and call SSL_CTX_set_option to 
> disable certain behaviors, like negotiation protocol levels.
> For example the following SSLContext subclass will ensure connections are at 
> TLSv1_2 or later:
> {noformat}
> class SSLContextOnlyTLSv12OrLater : public SSLContext
> {
>   public:
>     SSLContextOnlyTLSv12OrLater() : SSLContext()
>     {
>         // SSLContext already disables SSLv2 and SSLv3
>         SSL_CTX_set_options(ctx_, SSL_OP_NO_TLSv1); // This is TLSv1_0
>         SSL_CTX_set_options(ctx_, SSL_OP_NO_TLSv1_1);
>     }
> };
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to