Commit 731ae4cb authored by Jos Schellevis's avatar Jos Schellevis

(proxy) small changes to regex handling for black and whitelists

parent bdef8691
...@@ -96,10 +96,10 @@ acl bannedHosts src {{ip}} ...@@ -96,10 +96,10 @@ acl bannedHosts src {{ip}}
{% if helpers.exists('OPNsense.proxy.forward.acl.whiteList') %} {% if helpers.exists('OPNsense.proxy.forward.acl.whiteList') %}
# ALC - Whitelist - User defined (whiteList) # ALC - Whitelist - User defined (whiteList)
{% for element in OPNsense.proxy.forward.acl.whiteList.split(",") %} {% for element in OPNsense.proxy.forward.acl.whiteList.split(",") %}
{% if ('^' or '\\' or '$' or '[') in element %} {% if ('^' or '\' or '$' or '[') in element %}
acl whiteList url_regex {{element}} acl whiteList url_regex {{element}}
{% else %} {% else %}
acl whiteList url_regex .+{{element|replace(".","\.")}} acl whiteList url_regex {{element|replace(".","\.")}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
...@@ -107,10 +107,10 @@ acl whiteList url_regex .+{{element|replace(".","\.")}} ...@@ -107,10 +107,10 @@ acl whiteList url_regex .+{{element|replace(".","\.")}}
# ALC - Blacklist - User defined (blackList) # ALC - Blacklist - User defined (blackList)
{% for element in OPNsense.proxy.forward.acl.blackList.split(",") %} {% for element in OPNsense.proxy.forward.acl.blackList.split(",") %}
{% if ('^' or '\\' or '$' or '[') in element %} {% if ('^' or '\' or '$' or '[') in element %}
acl blackList url_regex {{element}} acl blackList url_regex {{element}}
{% else %} {% else %}
acl blackList url_regex .+{{element|replace(".","\.")}} acl blackList url_regex {{element|replace(".","\.")}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment