From e08ddd214417af0dbdb7936b501a0047b03f917a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 14 Jul 2019 23:33:45 +0200 Subject: [PATCH] net/haproxy: support deciphered SNI check, improve wording, closes #1365 --- .../OPNsense/HAProxy/forms/dialogAcl.xml | 11 +++++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 19 ++++++++++++------- .../templates/OPNsense/HAProxy/haproxy.conf | 11 +++++++++-- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml index f56065c94..ee8bb0283 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml @@ -423,6 +423,17 @@ dropdown + + + header + + + + acl.ssl_fc_sni + + text + + header diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 33d431a46..2499cecde 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1290,7 +1290,6 @@ Path contains subdir Path contains string URL parameter contains - SSL/TLS connection established SSL Client certificate is valid SSL Client certificate verify error result SSL Client certificate issued by CA common-name @@ -1317,12 +1316,14 @@ Source IP: session rate Minimum number of usable servers in backend Traffic is HTTP - Traffic is SSL - SNI TLS extension matches - SNI TLS extension contains - SNI TLS extension starts with - SNI TLS extension ends with - SNI TLS extension regex + Traffic is SSL (TCP request content inspection) + Traffic is SSL (locally deciphered) + SNI TLS extension matches (locally deciphered) + SNI TLS extension matches (TCP request content inspection) + SNI TLS extension contains (TCP request content inspection) + SNI TLS extension starts with (TCP request content inspection) + SNI TLS extension ends with (TCP request content inspection) + SNI TLS extension regex (TCP request content inspection) Custom condition (option pass-through) @@ -1620,6 +1621,10 @@ Related backend item not found N + + /^.{1,4096}$/u + N + /^.{1,4096}$/u N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 938493cdb..94cf13f07 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -182,8 +182,6 @@ {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'ssl_fc' %} -{% do acl_options.append('ssl_fc') %} {% elif acl_data.expression == 'src' %} {% if acl_data.src|default("") != "" %} {% do acl_options.append('src ' ~ acl_data.src) %} @@ -238,6 +236,15 @@ {% do acl_options.append('req.proto_http') %} {% elif acl_data.expression == 'traffic_is_ssl' %} {% do acl_options.append('req.ssl_ver gt 0') %} +{% elif acl_data.expression == 'ssl_fc' %} +{% do acl_options.append('ssl_fc') %} +{% elif acl_data.expression == 'ssl_fc_sni' %} +{% if acl_data.ssl_fc_sni|default("") != "" %} +{% do acl_options.append('ssl_fc_sni ' ~ acl_data.ssl_fc_sni) %} +{% else %} +{% set acl_enabled = '0' %} + # ERROR: missing parameters +{% endif %} {% elif acl_data.expression == 'ssl_sni' %} {% if acl_data.ssl_sni|default("") != "" %} {% do acl_options.append('req.ssl_sni -i ' ~ acl_data.ssl_sni) %}