mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-09 08:56:23 -04:00
dns/bind: add new lists, mark zone management as experimental (#1338)
This commit is contained in:
parent
1d4c45ab7d
commit
8efeec8102
6 changed files with 85 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
PLUGIN_NAME= bind
|
||||
PLUGIN_VERSION= 1.5.d
|
||||
PLUGIN_VERSION= 1.5
|
||||
PLUGIN_COMMENT= BIND domain name service
|
||||
PLUGIN_DEPENDS= bind914
|
||||
PLUGIN_MAINTAINER= m.muenz@gmail.com
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ Plugin Changelog
|
|||
1.5
|
||||
|
||||
* Add basic zone management
|
||||
* Add 6 new blacklists to DNSBL (hpHosts Ads, FSA, PSA, PUP; Blocklist.site Ads, Fraud, Phishing)
|
||||
|
||||
1.4
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,17 @@
|
|||
<OptionValues>
|
||||
<aa>AdAway List</aa>
|
||||
<ag>AdGuard List</ag>
|
||||
<bla>Blocklist.site Ads</bla>
|
||||
<blf>Blocklist.site Fraud</blf>
|
||||
<blp>Blocklist.site Phishing</blp>
|
||||
<ca>Cameleon List</ca>
|
||||
<el>Easy List</el>
|
||||
<emd>EMD Malicious Domains List</emd>
|
||||
<ep>Easyprivacy List</ep>
|
||||
<hpa>hpHosts Ads</hpa>
|
||||
<hpf>hpHosts FSA</hpf>
|
||||
<hpp>hpHosts PSH</hpp>
|
||||
<hup>hpHosts PUP</hup>
|
||||
<ht>Hbbtv List</ht>
|
||||
<mw>Malwaredomain List</mw>
|
||||
<nc>NoCoin List</nc>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class Domain extends BaseModel
|
|||
}
|
||||
// new serials on changed records
|
||||
foreach ($serialsToSet as $domain) {
|
||||
$domain->serial = (string)date("YmdHis");
|
||||
$domain->serial = (string)date("ymdHi");
|
||||
}
|
||||
return parent::serializeToConfig($validateFullModel, $disable_validation);
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ class Domain extends BaseModel
|
|||
{
|
||||
foreach ($this->domains->domain->iterateItems() as $domain) {
|
||||
if ($domain->getAttribute('uuid') == $uuid) {
|
||||
$domain->serial = (string)date("YmdHis");
|
||||
$domain->serial = (string)date("ymdHi");
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
</div>
|
||||
</div>
|
||||
<div id="domains" class="tab-pane fade in">
|
||||
<div class="alert alert-warning" role="alert" style="min-height:65px;">
|
||||
<div style="margin-top: 8px;">{{ lang._('Zone management is still in experimental state, use with caution.') }}</div>
|
||||
</div>
|
||||
<table id="grid-domains" class="table table-responsive" data-editDialog="dialogEditBindDomain">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -133,6 +133,55 @@ stevenblack() {
|
|||
rm ${WORKDIR}/stevenblack-raw
|
||||
}
|
||||
|
||||
blocklistads() {
|
||||
# Blocklist.site Ads
|
||||
${FETCH} https://blocklist.site/app/dl/ads -o ${WORKDIR}/blocklistads-raw
|
||||
sed "/\.$/d" ${WORKDIR}/blocklistads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistads
|
||||
rm ${WORKDIR}/blocklistads-raw
|
||||
}
|
||||
|
||||
blocklistfraud() {
|
||||
# Blocklist.site Fraud
|
||||
${FETCH} https://blocklist.site/app/dl/fraud -o ${WORKDIR}/blocklistfraud-raw
|
||||
sed "/\.$/d" ${WORKDIR}/blocklistfraud-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistfraud
|
||||
rm ${WORKDIR}/blocklistfraud-raw
|
||||
}
|
||||
|
||||
blocklistphishing() {
|
||||
# Blocklist.site Phishing
|
||||
${FETCH} https://blocklist.site/app/dl/phishing -o ${WORKDIR}/blocklistphishing-raw
|
||||
sed "/\.$/d" ${WORKDIR}/blocklistphishing-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistphishing
|
||||
rm ${WORKDIR}/blocklistphishing-raw
|
||||
}
|
||||
|
||||
hphosts-ads() {
|
||||
# hphosts-ads
|
||||
${FETCH} https://hosts-file.net/ad_servers.txt -o ${WORKDIR}/hphosts-ads-raw
|
||||
sed "/\.$/d" ${WORKDIR}/hphosts-ads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-ads
|
||||
rm ${WORKDIR}/hphosts-ads-raw
|
||||
}
|
||||
|
||||
hphosts-fsa() {
|
||||
# hphosts-fsa
|
||||
${FETCH} https://hosts-file.net/fsa.txt -o ${WORKDIR}/hphosts-fsa-raw
|
||||
sed "/\.$/d" ${WORKDIR}/hphosts-fsa-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-fsa
|
||||
rm ${WORKDIR}/hphosts-fsa-raw
|
||||
}
|
||||
|
||||
hphosts-psh() {
|
||||
# hphosts-psh
|
||||
${FETCH} https://hosts-file.net/psh.txt -o ${WORKDIR}/hphosts-psh-raw
|
||||
sed "/\.$/d" ${WORKDIR}/hphosts-psh-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-psh
|
||||
rm ${WORKDIR}/hphosts-psh-raw
|
||||
}
|
||||
|
||||
hphosts-pup() {
|
||||
# hphosts-pup
|
||||
${FETCH} https://hosts-file.net/pup.txt -o ${WORKDIR}/hphosts-pup-raw
|
||||
sed "/\.$/d" ${WORKDIR}/hphosts-pup-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-pup
|
||||
rm ${WORKDIR}/hphosts-pup-raw
|
||||
}
|
||||
|
||||
hbbtv() {
|
||||
# HBBTV List
|
||||
${FETCH} https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/hbbtv.txt -o ${WORKDIR}/hbbtv-raw
|
||||
|
|
@ -164,7 +213,7 @@ zeusabuse() {
|
|||
install() {
|
||||
# Put all files in correct format
|
||||
for FILE in $(find ${WORKDIR} -type f); do
|
||||
awk '{ if (length($1) < 245) print ""$1" CNAME .\n*."$1" CNAME ."}' ${FILE} | sort -u > ${FILE}.inc
|
||||
awk '{ if (length($1) < 220) print ""$1" CNAME .\n*."$1" CNAME ."}' ${FILE} | sort -u > ${FILE}.inc
|
||||
done
|
||||
# Merge resulting files (/dev/null in case there are none)
|
||||
cat $(find ${WORKDIR} -type f -name "*.inc") /dev/null | sort -u > ${DESTDIR}/dnsbl.inc
|
||||
|
|
@ -187,6 +236,15 @@ for CAT in $(echo ${DNSBL} | tr ',' ' '); do
|
|||
ag)
|
||||
adguard
|
||||
;;
|
||||
bla)
|
||||
blocklistads
|
||||
;;
|
||||
blf)
|
||||
blocklistfraud
|
||||
;;
|
||||
blp)
|
||||
blocklistphishing
|
||||
;;
|
||||
ca)
|
||||
cameleon
|
||||
;;
|
||||
|
|
@ -199,6 +257,18 @@ for CAT in $(echo ${DNSBL} | tr ',' ' '); do
|
|||
emd)
|
||||
emdlist
|
||||
;;
|
||||
hpa)
|
||||
hphosts-ads
|
||||
;;
|
||||
hpf)
|
||||
hphosts-fsa
|
||||
;;
|
||||
hpp)
|
||||
hphosts-psh
|
||||
;;
|
||||
hup)
|
||||
hphosts-pup
|
||||
;;
|
||||
ht)
|
||||
hbbtv
|
||||
;;
|
||||
|
|
|
|||
Loading…
Reference in a new issue