summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraapostoliuk <a.apostoliuk@vyos.io>2022-12-06 13:57:42 +0200
committeraapostoliuk <a.apostoliuk@vyos.io>2022-12-08 12:44:49 +0200
commitd846f000424522bc2e26d554ada61d0ae7e10ecc (patch)
tree1f170e53b2299ff1a8c1464d072a35212f9328e6
parentec6aaf72378d02753ca38ff17adadf785b2b21bd (diff)
downloadvyos-1x-d846f000424522bc2e26d554ada61d0ae7e10ecc.tar.gz
vyos-1x-d846f000424522bc2e26d554ada61d0ae7e10ecc.zip
T4862: Added the generation config for webproxy domain-block
Added the generation in the config file /etc/squid/squid.conf for command: set service webroxy domain-block <domain>
-rw-r--r--data/templates/squid/squid.conf.j27
1 files changed, 6 insertions, 1 deletions
diff --git a/data/templates/squid/squid.conf.j2 b/data/templates/squid/squid.conf.j2
index 5781c883f..b953c8b18 100644
--- a/data/templates/squid/squid.conf.j2
+++ b/data/templates/squid/squid.conf.j2
@@ -24,7 +24,12 @@ acl Safe_ports port {{ port }}
{% endfor %}
{% endif %}
acl CONNECT method CONNECT
-
+{% if domain_block is vyos_defined %}
+{% for domain in domain_block %}
+acl BLOCKDOMAIN dstdomain {{ domain }}
+{% endfor %}
+http_access deny BLOCKDOMAIN
+{% endif %}
{% if authentication is vyos_defined %}
{% if authentication.children is vyos_defined %}
auth_param basic children {{ authentication.children }}