Author Topic: How to update your domain blacklist file daily with a cron job  (Read 8515 times)

Christophe

  • Zen Warrior
  • ***
  • Posts: 170
  • Karma: +6/-1
    • View Profile
I propose a cron job to update your lists from your blacklist provider.
From zentyal it's difficult to update these blacklist, each week you have to :
- connect in VNC to your serveur (
- download an updated blacklist from FF
- create a new blacklist
- set the rules
- delete the old blacklist

it's really tiring....

I'm not sur if it's enought for dansguardian, but i wrote this :

Code: [Select]
#!/bin/sh
#
# File /etc/cron.daily/dansguardian_blacklists
#
# download and update each day blacklists from UT1.

wget ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz -O /etc/dansguardian/extralists/$filterprofile$/blacklist.tar.gz
tar zxvf /etc/dansguardian/extralists/$filterprofile$/blacklist.tar.gz -C /etc/dansguardian/extralists/$filterprofile$/archives/$description$/
       chmod 0775 /etc/dansguardian/extralists/$filterprofile$/archives/$description$
       chown -R root:root /etc/dansguardian/extralists/$filterprofile$/archives/$description$
       service squid restart
« Last Edit: August 05, 2011, 07:04:14 pm by Christophe »
DELL PowerEDGE R210 - ESXi 4.1 - 4 VM Zentyal

Pfff

  • Zen Warrior
  • ***
  • Posts: 132
  • Karma: +0/-0
  • Be open
    • View Profile
    • Webynux
Re: How to update your domain blacklist file daily with a cron job
« Reply #1 on: October 25, 2012, 02:30:47 pm »
hello,

do you use this script,
Is it stil working?

J. A. Calvo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1986
  • Karma: +67/-3
    • View Profile
    • http://blogs.zentyal.org/jacalvo
Re: How to update your domain blacklist file daily with a cron job
« Reply #2 on: October 25, 2012, 09:18:24 pm »
Yes, I completely agree that updating this manually is really tiring. That's why on commercial editions of Zentyal this gets done automatically, not only for the proxy blacklists, also for anti-spam, antivirus, IDS rules... :)
Zentyal Server Lead Developer

matthieuy

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: How to update your domain blacklist file daily with a cron job
« Reply #3 on: September 10, 2014, 12:01:01 pm »
Hi,

A little update of this script for Zentyal 3.5 and Squid 3

Code: [Select]
#!/bin/sh
#
# File : /etc/cron.daily/blacklist
#
# Change the name of your category name : CAT_NAME
# See it in https://{ZENTYAL_IP}/Squid/View/CategorizedLists
CAT_NAME="Blacklist"

DIR="/var/lib/zentyal/files/squid/categories/${CAT_NAME}"

wget ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz -O ${DIR}/blacklist.tar.gz
tar -xvf ${DIR}/blacklist.tar.gz -C ${DIR}/
rm $[DIR}/blacklist.tar.gz
chmod -Rfv 755 ${DIR}
chown -Rfv root:ebox ${DIR}

service squid3 restart

don't forget : chmod +x /etc/cron.daily/blacklist