[PATCH V2] [Wok] Remove support for TLS v1.0 and add SSL timeout

Signed-off-by: Lucio Correia <luciojhc@linux.vnet.ibm.com> --- src/nginx/wok.conf.in | 3 ++- src/wok/proxy.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) Changes in V2: * read timeout value from config diff --git a/src/nginx/wok.conf.in b/src/nginx/wok.conf.in index 8dd5d7c..cb05e4d 100644 --- a/src/nginx/wok.conf.in +++ b/src/nginx/wok.conf.in @@ -62,10 +62,11 @@ http { ssl_certificate ${cert_pem}; ssl_certificate_key ${cert_key}; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_protocols TLSv1.1 TLSv1.2; ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:@STRENGTH'; ssl_prefer_server_ciphers on; ssl_dhparam ${dhparams_pem}; + ssl_session_timeout ${session_timeout}m; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; add_header X-Frame-Options DENY; diff --git a/src/wok/proxy.py b/src/wok/proxy.py index 9d39dbd..a74e88a 100644 --- a/src/wok/proxy.py +++ b/src/wok/proxy.py @@ -102,6 +102,7 @@ def _create_proxy_config(options): websockets_port=options.websockets_port, cert_pem=cert, cert_key=key, max_body_size=eval(options.max_body_size), + session_timeout=options.session_timeout, dhparams_pem=dhparams_pem) # Write file to be used for nginx. -- 1.9.1

Reviewed-By: Ramon Medeiros <ramonn@br.ibm.com> On 06/17/2016 04:30 PM, Lucio Correia wrote:
Signed-off-by: Lucio Correia <luciojhc@linux.vnet.ibm.com> --- src/nginx/wok.conf.in | 3 ++- src/wok/proxy.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
Changes in V2: * read timeout value from config
diff --git a/src/nginx/wok.conf.in b/src/nginx/wok.conf.in index 8dd5d7c..cb05e4d 100644 --- a/src/nginx/wok.conf.in +++ b/src/nginx/wok.conf.in @@ -62,10 +62,11 @@ http {
ssl_certificate ${cert_pem}; ssl_certificate_key ${cert_key}; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_protocols TLSv1.1 TLSv1.2; ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:@STRENGTH'; ssl_prefer_server_ciphers on; ssl_dhparam ${dhparams_pem}; + ssl_session_timeout ${session_timeout}m;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; add_header X-Frame-Options DENY; diff --git a/src/wok/proxy.py b/src/wok/proxy.py index 9d39dbd..a74e88a 100644 --- a/src/wok/proxy.py +++ b/src/wok/proxy.py @@ -102,6 +102,7 @@ def _create_proxy_config(options): websockets_port=options.websockets_port, cert_pem=cert, cert_key=key, max_body_size=eval(options.max_body_size), + session_timeout=options.session_timeout, dhparams_pem=dhparams_pem)
# Write file to be used for nginx.
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com

Hi Lucio, The tests cases are failing with this patch: ...... ====================================================================== ERROR: setUpModule (test_plugin) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_plugin.py", line 45, in setUpModule test_server = utils.run_server(host, port, ssl_port, test_mode=True) File "utils.py", line 126, in run_server s = wok.server.Server(args) File "/home/alinefm/wok/src/wok/server.py", line 77, in __init__ start_proxy(options) File "/home/alinefm/wok/src/wok/proxy.py", line 116, in start_proxy _create_proxy_config(options) File "/home/alinefm/wok/src/wok/proxy.py", line 105, in _create_proxy_config session_timeout=options.session_timeout, AttributeError: '_' object has no attribute 'session_timeout' ====================================================================== ERROR: test_development_env (test_exception.ExceptionTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_exception.py", line 96, in test_development_env setup_server() File "test_exception.py", line 43, in setup_server environment=environment) File "utils.py", line 126, in run_server s = wok.server.Server(args) File "/home/alinefm/wok/src/wok/server.py", line 77, in __init__ start_proxy(options) File "/home/alinefm/wok/src/wok/proxy.py", line 116, in start_proxy _create_proxy_config(options) File "/home/alinefm/wok/src/wok/proxy.py", line 105, in _create_proxy_config session_timeout=options.session_timeout, AttributeError: '_' object has no attribute 'session_timeout' ====================================================================== ERROR: test_development_env (test_exception.ExceptionTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_exception.py", line 48, in tearDown test_server.stop() AttributeError: 'NoneType' object has no attribute 'stop' ====================================================================== ERROR: test_production_env (test_exception.ExceptionTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_exception.py", line 54, in test_production_env setup_server('production') File "test_exception.py", line 43, in setup_server environment=environment) File "utils.py", line 126, in run_server s = wok.server.Server(args) File "/home/alinefm/wok/src/wok/server.py", line 77, in __init__ start_proxy(options) File "/home/alinefm/wok/src/wok/proxy.py", line 116, in start_proxy _create_proxy_config(options) File "/home/alinefm/wok/src/wok/proxy.py", line 105, in _create_proxy_config session_timeout=options.session_timeout, AttributeError: '_' object has no attribute 'session_timeout' ====================================================================== ERROR: test_production_env (test_exception.ExceptionTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_exception.py", line 48, in tearDown test_server.stop() AttributeError: 'NoneType' object has no attribute 'stop' ====================================================================== ERROR: setUpModule (test_api) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_api.py", line 41, in setUpModule test_server = utils.run_server(host, port, ssl_port, test_mode=True) File "utils.py", line 126, in run_server s = wok.server.Server(args) File "/home/alinefm/wok/src/wok/server.py", line 77, in __init__ start_proxy(options) File "/home/alinefm/wok/src/wok/proxy.py", line 116, in start_proxy _create_proxy_config(options) File "/home/alinefm/wok/src/wok/proxy.py", line 105, in _create_proxy_config session_timeout=options.session_timeout, AttributeError: '_' object has no attribute 'session_timeout' ====================================================================== ERROR: setUpModule (test_server) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_server.py", line 54, in setUpModule cherrypy_port=cherrypy_port) File "utils.py", line 126, in run_server s = wok.server.Server(args) File "/home/alinefm/wok/src/wok/server.py", line 77, in __init__ start_proxy(options) File "/home/alinefm/wok/src/wok/proxy.py", line 116, in start_proxy _create_proxy_config(options) File "/home/alinefm/wok/src/wok/proxy.py", line 105, in _create_proxy_config session_timeout=options.session_timeout, AttributeError: '_' object has no attribute 'session_timeout' ---------------------------------------------------------------------- Ran 13 tests in 0.038s FAILED (errors=7) Could you fix it and resend? Regards, Aline Manera On 06/17/2016 04:30 PM, Lucio Correia wrote:
Signed-off-by: Lucio Correia <luciojhc@linux.vnet.ibm.com> --- src/nginx/wok.conf.in | 3 ++- src/wok/proxy.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
Changes in V2: * read timeout value from config
diff --git a/src/nginx/wok.conf.in b/src/nginx/wok.conf.in index 8dd5d7c..cb05e4d 100644 --- a/src/nginx/wok.conf.in +++ b/src/nginx/wok.conf.in @@ -62,10 +62,11 @@ http {
ssl_certificate ${cert_pem}; ssl_certificate_key ${cert_key}; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_protocols TLSv1.1 TLSv1.2; ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:@STRENGTH'; ssl_prefer_server_ciphers on; ssl_dhparam ${dhparams_pem}; + ssl_session_timeout ${session_timeout}m;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; add_header X-Frame-Options DENY; diff --git a/src/wok/proxy.py b/src/wok/proxy.py index 9d39dbd..a74e88a 100644 --- a/src/wok/proxy.py +++ b/src/wok/proxy.py @@ -102,6 +102,7 @@ def _create_proxy_config(options): websockets_port=options.websockets_port, cert_pem=cert, cert_key=key, max_body_size=eval(options.max_body_size), + session_timeout=options.session_timeout, dhparams_pem=dhparams_pem)
# Write file to be used for nginx.
participants (3)
-
Aline Manera
-
Lucio Correia
-
Ramon Medeiros