From d585b0411554b876df2ee042bfdeb744f7b38134 Mon Sep 17 00:00:00 2001 From: blablup Date: Sun, 13 Oct 2019 14:26:09 +0200 Subject: [PATCH] Add OCSP Stapling for nginx (#1519) * Add OCSP Stapeling * Add aditional ocsp_verify flag and minor changes * Version bump * Update www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml Typo Co-Authored-By: Fabian Franz BSc * Update www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml Co-Authored-By: Fabian Franz BSc * Update www/nginx/pkg-descr typo Co-Authored-By: Franco Fichtner * Update www/nginx/Makefile plugin version bump Co-Authored-By: Franco Fichtner --- www/nginx/Makefile | 3 +-- www/nginx/pkg-descr | 4 ++++ .../OPNsense/Nginx/forms/httpserver.xml | 14 ++++++++++++++ .../mvc/app/models/OPNsense/Nginx/Nginx.xml | 8 ++++++++ .../service/templates/OPNsense/Nginx/http.conf | 6 ++++++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 0b14ed54a..912ab14b3 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.14 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.15 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index ecd0c36c2..13d933a0d 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -8,6 +8,10 @@ reuse, SSL offload and HTTP media streaming. Plugin Changelog ================ +1.15 + +* add OCSP stapling and verify + 1.14 * add load balancer algorithm option (ip_hash) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml index 17e39f8b0..2e62fb6b1 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml @@ -132,6 +132,20 @@ checkbox If you check this box, a TLS encrypted connection is enforced. + + httpserver.ocsp_stapling + + checkbox + true + in RFC 7633.]]> + + + httpserver.ocsp_verify + + checkbox + true + Enables or disables verification of OCSP responses by the server. + httpserver.block_nonpublic_data diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index cebf7d930..46f4b87ee 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -686,6 +686,14 @@ 0 Y + + 0 + Y + + + 0 + Y + 0 Y diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf index 05aea6864..a929dab25 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf @@ -115,6 +115,12 @@ server { ssl_session_cache shared:SSL:50m; ssl_session_tickets off; ssl_prefer_server_ciphers on; +{% if server.ocsp_stapling is defined and server.ocsp_stapling == '1'%} + ssl_stapling on; + ssl_stapling_verify {% if server.ocsp_verify is defined and server.ocsp_verify == '1' %}On{% else %}Off{% endif %}; +{% else %} + ssl_stapling off; +{% endif %} sendfile {% if server.sendfile is defined and server.sendfile == '1' %}On{% else %}Off{% endif %}; {% endif %} server_name {{ server.servername.replace(',', ' ') }};