Commit 109b5eb4 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(proxy) add option to ignore subnets from getting into the access log...

(proxy) add option to ignore subnets from getting into the access log (https://github.com/opnsense/core/issues/287)
parent 73a8e90e
...@@ -30,6 +30,17 @@ ...@@ -30,6 +30,17 @@
<help><![CDATA[Enable store logging.]]></help> <help><![CDATA[Enable store logging.]]></help>
<advanced>true</advanced> <advanced>true</advanced>
</field> </field>
<field>
<id>proxy.general.logging.ignoreLogACL</id>
<label>Ignore hosts in access.log</label>
<type>select_multiple</type>
<style>tokenize</style>
<help>
<![CDATA[Type subnets/addresses you want to ignore for the access.log <div class="text-info"><b>TIP: </b>You can also paste a comma separated list into this field.</div>]]></help>
<hint>Type subnet adresses (ex. 192.168.2.0/24)</hint>
<allownew>true</allownew>
<advanced>true</advanced>
</field>
<field> <field>
<id>proxy.general.alternateDNSservers</id> <id>proxy.general.alternateDNSservers</id>
<label>Use alternate DNS-servers</label> <label>Use alternate DNS-servers</label>
......
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
<Required>Y</Required> <Required>Y</Required>
</storeLog> </storeLog>
</enable> </enable>
<ignoreLogACL type="CSVListField">
<Required>N</Required>
</ignoreLogACL>
</logging> </logging>
<alternateDNSservers type="CSVListField"> <alternateDNSservers type="CSVListField">
<Required>N</Required> <Required>N</Required>
......
...@@ -289,12 +289,18 @@ refresh_pattern . 0 20% 4320 ...@@ -289,12 +289,18 @@ refresh_pattern . 0 20% 4320
dns_v4_first on dns_v4_first on
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if helpers.exists('OPNsense.proxy.general.logging.enable.accessLog') %} {% if helpers.exists('OPNsense.proxy.general.logging.enable.accessLog') %}
{% if OPNsense.proxy.general.logging.enable.accessLog == '0' %} {% if OPNsense.proxy.general.logging.enable.accessLog == '0' %}
# Disable access logging # Disable access logging
access_log none access_log none
{% elif OPNsense.proxy.general.logging.ignoreLogACL|default('') != '' %}
# ignore source hosts from access.log
acl accesslog_ignore src {{ OPNsense.proxy.general.logging.ignoreLogACL.replace(',', ' ') }}
access_log /var/log/squid/access.log squid !accesslog_ignore
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if helpers.exists('OPNsense.proxy.general.logging.enable.storeLog') %} {% if helpers.exists('OPNsense.proxy.general.logging.enable.storeLog') %}
{% if OPNsense.proxy.general.logging.enable.storeLog == '0' %} {% if OPNsense.proxy.general.logging.enable.storeLog == '0' %}
# Disable cache store log # Disable cache store log
......
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