dns/bind: add bind strict search, add 4 new blacklists (#1068)

This commit is contained in:
Michael
2018-12-15 07:53:53 +01:00
committed by Franco Fichtner
parent 836032e38f
commit 8b602203c1
8 changed files with 105 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= bind
PLUGIN_VERSION= 1.3
PLUGIN_VERSION= 1.4
PLUGIN_COMMENT= BIND domain name service
PLUGIN_DEPENDS= bind912
PLUGIN_MAINTAINER= m.muenz@gmail.com
+28
View File
@@ -4,4 +4,32 @@ one computer can find another computer on the basis of its name.
The BIND software distribution contains all of the software
necessary for asking and answering name service questions.
Plugin Changelog
================
1.4
* Add Bing Strict Search
* Add 4 new blacklists to DNSBL
1.3
* Add Google Safe Search
* Add Youtube Adult Filter
1.2
* Add Log Viewer
* Removed too big porn list
1.1
* Add 3 new blacklists to DNSBL
1.0
* Initial release
WWW: https://www.isc.org
@@ -31,4 +31,10 @@
<type>checkbox</type>
<help>This will force safe Youtube browsing.</help>
</field>
<field>
<id>dnsbl.forcestrictbing</id>
<label>Enable Strict Bing Search</label>
<type>checkbox</type>
<help>This will force safe search when using Bing.</help>
</field>
</form>
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/bind/dnsbl</mount>
<description>DNSBL configuration</description>
<version>1.0.4</version>
<version>1.0.5</version>
<items>
<enabled type="BooleanField">
<default>0</default>
@@ -17,12 +17,16 @@
<el>Easy List</el>
<emd>EMD Malicious Domains List</emd>
<ep>Easyprivacy List</ep>
<ht>Hbbtv List</ht>
<mw>Malwaredomain List</mw>
<nc>NoCoin List</nc>
<pt>PornTop1M List</pt>
<rw>Ransomware Tracker List</rw>
<sa>Simple Ad List</sa>
<st>Simple Tracker List</st>
<ws>Windows Spyware Blocker</ws>
<yy>YoYo List</yy>
<za>ZeusTracker Abuse.ch List</za>
</OptionValues>
</type>
<whitelists type="CSVListField">
@@ -36,5 +40,9 @@
<default>0</default>
<Required>Y</Required>
</forcesafeyoutube>
<forcestrictbing type="BooleanField">
<default>0</default>
<Required>Y</Required>
</forcestrictbing>
</items>
</model>
@@ -126,6 +126,34 @@ yoyo() {
rm ${WORKDIR}/yoyo-raw
}
hbbtv() {
# HBBTV List
${FETCH} https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/hbbtv.txt -o ${WORKDIR}/hbbtv-raw
sed "/\.$/d" ${WORKDIR}/hbbtv-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/hbbtv
rm ${WORKDIR}/hbbtv-raw
}
simplead() {
# Simple Ad List
${FETCH} https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt -o ${WORKDIR}/simplead-raw
sed "/\.$/d" ${WORKDIR}/simplead-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simplead
rm ${WORKDIR}/simplead-raw
}
simpletrack() {
# Simple Tracking List
${FETCH} https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt -o ${WORKDIR}/simpletrack-raw
sed "/\.$/d" ${WORKDIR}/simpletrack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simpletrack
rm ${WORKDIR}/simpletrack-raw
}
zeusabuse() {
# Zeus Tracker List from abuse.ch
${FETCH} https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist -o ${WORKDIR}/zeusabuse-raw
sed "/\.$/d" ${WORKDIR}/zeusabuse-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/zeusabuse
rm ${WORKDIR}/zeusabuse-raw
}
install() {
# Put all files in correct format
for FILE in $(find ${WORKDIR} -type f); do
@@ -164,6 +192,9 @@ for CAT in $(echo ${DNSBL} | tr ',' ' '); do
emd)
emdlist
;;
ht)
hbbtv
;;
nc)
nocoin
;;
@@ -179,12 +210,21 @@ for CAT in $(echo ${DNSBL} | tr ',' ' '); do
pt)
porntop
;;
sa)
simplead
;;
st)
simpletrack
;;
ws)
windowsspyblocker
;;
yy)
yoyo
;;
za)
zeusabuse
;;
esac
done
@@ -1,3 +1,4 @@
bing.db:/usr/local/etc/namedb/master/bing.db
blacklist.db:/usr/local/etc/namedb/master/blacklist.db
google.db:/usr/local/etc/namedb/master/google.db
named:/etc/rc.conf.d/named
@@ -0,0 +1,14 @@
$TTL 86400
@ IN SOA opnsense.localdomain. hostmaster.opnsense.localdomain. (
2018121501
28800
7200
864000
3600 )
@ NS localhost.
{% if helpers.exists('OPNsense.bind.dnsbl.forcestrictbing') and OPNsense.bind.dnsbl.forcestrictbing == '1' %}
www.bing.at IN CNAME strict.bing.com.
www.bing.ch IN CNAME strict.bing.com.
www.bing.com IN CNAME strict.bing.com.
www.bing.de IN CNAME strict.bing.com.
{% endif %}
@@ -27,7 +27,7 @@ options {
{% endif %}
{% if helpers.exists('OPNsense.bind.dnsbl.enabled') and OPNsense.bind.dnsbl.enabled == '1' %}
response-policy { {% if helpers.exists('OPNsense.bind.dnsbl.type') and OPNsense.bind.dnsbl.type != '' %}zone "whitelist.localdomain"; zone "blacklist.localdomain";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafegoogle') and OPNsense.bind.dnsbl.forcesafegoogle == '1' %}zone "rpzgoogle";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeyoutube') and OPNsense.bind.dnsbl.forcesafeyoutube == '1' %}zone "rpzyoutube";{% endif %} };
response-policy { {% if helpers.exists('OPNsense.bind.dnsbl.type') and OPNsense.bind.dnsbl.type != '' %}zone "whitelist.localdomain"; zone "blacklist.localdomain";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafegoogle') and OPNsense.bind.dnsbl.forcesafegoogle == '1' %}zone "rpzgoogle";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcesafeyoutube') and OPNsense.bind.dnsbl.forcesafeyoutube == '1' %}zone "rpzyoutube";{% endif %}{% if helpers.exists('OPNsense.bind.dnsbl.forcestrictbing') and OPNsense.bind.dnsbl.forcestrictbing == '1' %}zone "rpzbing";{% endif %} };
{% endif %}
{% if helpers.exists('OPNsense.bind.general.recursion') and OPNsense.bind.general.recursion != '' %}
@@ -80,7 +80,11 @@ zone "rpzgoogle" { type master; file "/usr/local/etc/namedb/master/google.db"; n
zone "rpzyoutube" { type master; file "/usr/local/etc/namedb/master/youtube.db"; notify no; check-names ignore; };
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.bind.dnsbl.enabled') and OPNsense.bind.dnsbl.enabled == '1' %}
{% if helpers.exists('OPNsense.bind.dnsbl.forcestrictbing') and OPNsense.bind.dnsbl.forcestrictbing == '1' %}
zone "rpzbing" { type master; file "/usr/local/etc/namedb/master/bing.db"; notify no; check-names ignore; };
{% endif %}
{% endif %}
logging {
channel default_log {
file "/var/log/named/named.log" versions 3 size {{ OPNsense.bind.general.logsize }}m;