SquidTL

ATTENZIONE
Il progetto SquidTL è stato abbandonato ormai da qualche anno. E’ ancora disponibile il codice sorgente e le istruzioni per l’installazione che, però, potrebbero non riflettere più le esigenze delle ultime versioni di Squid.

SquidTL è un software che permette di gestire, in maniera facile ed intuitiva, gli utenti ed il traffico di rete di una o più intranet. Composto da due parti, l’url redirector e l’interfaccia web, consente di definire regole basate su:

  • Utenti e Gruppi di utenti
  • Contesti da amministrare (ad es. più intranet)
  • Periodi di tempo
  • Limiti temporali su base giornaliera
  • Siti web o categorie di siti web (con XML-RPC attivato)

Le regole vengono attivate in tempo reale grazie all’uso di MySQL come database per la gestione e memorizzazione delle impostazioni. SquidTL si interfaccia al famoso proxy server Squid per quanto riguarda la gestione delle connessioni ed eventuali redirect degli utenti.

Il contesto ideale per l’uso di SquidTL si compone essenzialmente di una (o più) intranet ed un gateway unico per l’uscita su Internet:

Il gateway rappresenta il nodo cruciale di tutta la nostra intranet: oltre a dover gestire il traffico in entrada ed uscita, dovrà anche preoccuparsi di autenticare gli utenti e di mantenere i log del traffico da loro generato. Dovrà anche essere una macchina dalle prestazioni adeguate alla mole di traffico prevista e con un hardware capace di sopportare carichi di lavoro 24*7.

Il funzionamento di un proxy è abbastanza semplice: esso funziona come intermediario tra il browser dell’utente ed il server web remoto. Tutte le richieste effettuate dal browser saranno indirizzate al proxy che, dopo averle analizzate, inoltra la richiesta al server remoto preoccupandosi di inoltrare la risposta al browser dell’utente: è chiaro come attraverso il proxy sia possibile gestire la totalità del traffico ed è esattamente quello che faremo utilizzando SquidTL

Il proxy-server Squid permette l’utilizzo di moduli per l’autenticazione (auth helpers) e la verifica delle richieste (url redirectors) degli utenti.

SquidTL lavora come url redirector decidendo se una certa richiesta è legittima oppure no. Le decisioni avvengono secondo le impostazioni decise dall’amministratore del sistema, attraverso l’interfaccia di gestione via web.

Si possono configurare regole di uso per contesti diversi, gruppi di utenti ed utenti singoli. Le regole possono permettere, limitare o bloccare la visita di certi siti web a prescindere dal nome a dominio, lista di url, categoria del sito web. Gli utenti possono essere gestiti singolarmente, abilitando o disabilitando l’uso della rete ed impostando la scadenza (expire) dell’account.

In più tutto il traffico generato viene memorizzato in appositi log, in formato testuale, direttamente sul server, in ottemperanza al D.M. Pisanu (Legge 155/2005), che impone sia il riconoscimento degli utenti che la conservazione dei log di traffico.

Installare ed usare SquidTL è semplice: dopo una prima fase di setup da console di sistema per il demone in C e la GUI in PHP, l’intera gestione del traffico e degli utenti può essere effettuata via web.

In particolare è possibile:

  • definire regole su specifici domini (es. facebook.com) per limitarne o bloccarne l’uso
  • definire periodi temporali di validità delle regole specificate
  • definire limiti di tempo su utenti o gruppi di utenti su base giornaliera
  • creare utenti e gruppi di utenti che condividono lo stesso set di regole
  • creare contesti separati per realtà eterogenee che utilizzano lo stesso server proxy
  • visualizzare tutto il traffico web sul proxy ed il log delle operazioni su SquidTL
  • creare utenti amministratori a cui assegnare specifici compiti attraverso le ACL
  • visualizzare grafici statistici sull’uso della rete e degli utenti

Caratteristica interessante di SquidTL è la possibilità di limitare l’uso di particolari siti web: a differenza di un meccanismo ad ACL, che bloccano o permettono, con SquidTL è possibile definire quante sessioni l’utente (o gruppi di utenti) possono fare sul dominio web. Ad esempio è possibile stabilire un limite di 100 connessioni sul dominio X ogni 15 minuti: se l’utente supera tale limite, viene reindirizzato ad una pagina web (personalizzabile) che lo blocca: questo permette di evitare la sgradevole necessità di impedire totalmente l’uso di un certo servizio, evitandone però l’abuso da parte degli utenti.

Inoltre, utilizzando il sistema di autenticazione di Squid (auth_helper), è possibile creare dinamicamente gli utenti che potranno usufruire del servizio web.

L’anagrafica dell’utente viene memorizzata negli appositi campi di ogni scheda utente. In qualunque momento, ad esempio al termine di una sessione, è possibile disabilitare ogni singolo account (invece di cancellarlo), riservandosi la possibilità di abilitare nuovamente l’accesso a tale utente in un secondo momento.

Ovviamente è importante avere traccia anche delle operazioni compiute sull’interfaccia di gestione: poter risalire a chi ha fatto cosa dal lato amministrativo è fondamentale nel caso di eventuali indagini o richieste di chiarimento a seguito di eventuali problemi: SquidTL prevede già un log delle operazioni effettuate, accessibile solamente dagli utenti che ne hanno i privilegi.

Oltre alle funzioni amministrative SquidTL, se configurato anche per la gestione degli utenti, offre la possibilità (in ottemperanza alle disposizioni di legge) del cambio password autonomo da parte degli utenti registrati.

Supporto ed assistenza

Diventa Fan su Facebook o seguici su Twitter. Se vuoi segnalare un BUG utilizza Launchpad a questo URL: https://bugs.launchpad.net/squidtl/+filebug. Se invece vuoi fare una domanda generica su SquidTL clicca su questo link: https://answers.launchpad.net/squidtl

Download SquidTL

Attualmente siamo alla versione v0.2.2, usata in produzione. Tuttavia abbiamo bisogno della tua collaborazione: SquidTL ha una pagina dedicata su Launchpad (https://launchpad.net/squidtl) e tutti coloro che lo desiderano possono collaborare al progetto.

Scaricate l’utlima versione di SquidTL su Launchpad a questo link:

http://launchpad.net/squidtl/trunk/0.2.0/+download/squidtl-0.2.2.tar.gz

Changelog

0.2.2 – 9 Mar 2011

  • Start support for PostgreSQL DBMS (thanks to Michele Petrazzo for his help)
  • Fixed other minor bugs

0.2.1 – 17 Gen 2011

  • Added eMail as optional field in user management
  • Bug #604512: squidtl don’t exit when squid stop
  • Bug #703825: crash on ADD unknown user
  • Some minor GUI cleanups

0.2.0 – 16 Nov 2010

  • Added daily session time limit rule
  • Bug #667115: copytolist function (button) doesn’t work on USER form > Groups ownership
  • Bug #668102: redirectURL not added / updated to DB
  • Bug #669277: Edit Group Popup does’t show current Context
  • Bug #670166: Update to en.inc.php (replaced Italian Words)

0.1.2 – 30 Sep 2010

  • Bugs fixed

0.1.1 – 22 Jul 2010

  • Processing speed-up with related requests
  • Web gui cleanup
  • Some bugs fixed

0.1.0 – 07 May 2010

  • User context now work as expected
  • Added the possibility to create temporary user account using Expire Date
  • Remake of URL traffic page with details and paginating
  • Now admin can enable and disable users in realtime
  • Created install.php for new and existings installations
  • Implemented time profiling for measuring performance of redirectors
  • New logo

0.0.9 – 04 May 2010

  • Use user ident if available in IP ident
  • Added domain categorizing by admins
  • Added the chance to create your own xmlrpc domain categories repository
  • Fixed some bugs

0.0.8 – 30 Apr 2010

  • Added ajax check on Web Gui
  • Category list grabbed in realtime with xml-rpc
  • Added caching of URL categories (speed-up if multiple queries on the same URL)
  • Some interesting features (such domain lookup) added in Web Gui
  • Fixed some bugs

0.0.7 – 28 Apr 2010

  • Added context support
  • Optimizing mysql usage to raise load on server
  • Implemented PCRE instead of POSIX RegExp (deprecated)
  • Implemented XML-RPC service for URL categorizing
  • Added inline help
  • A lot of bugs fixed

0.0.6 – 21 Dec 2009

  • This is mainly a bug fixed release
  • Start support for URL categorization service (through XML-RPC)

0.0.5 – 15 Dec 2009

  • Use of url lists (text files) for rules, instead of add manually all domains which needs the same rule
  • Statistic module bugfixes
  • Added GUI sanity checks
  • Created install.php script for easier DB installation
  • Some minor bugs fixed

0.0.4 – 9 Dec 2009

  • Some bugs fixed
  • Statistics module
  • XMLRPC service for notifications on new releases

0.0.3 – 4 Dec 2009

  • Add time rules on filtering rules
  • Add instructions how to install on Debian and Ubuntu
  • First approach to statistics module
  • Fix a nasty bug for IP range identification
  • Fix some other bugs

0.0.2.1 – 2 Dec 2009

  • fixes some problems with compilation under Debian and other distros

0.0.2 – 1 Dec 2009

  • Support for IP ranges with dymanic users
  • Localization for the GUI (actually english and italian)
  • GUI Authentication
  • Group and users management
  • Rules export in CSV, XML and Plain format
  • Bug fixes and improvements

0.0.1 – 24 Nov 2009

  • First public release. BETA.

Hai trovato utile questo articolo?

Questo articolo è stato visto 149 volte (Oggi 1 visite)
10 comments
  1. I install squidtl have problem as follow:

    configure: error: Couldn’t find mysql_config. Please verify that it is installed.

    But i install mysql-server and mysql-client ,the problem still. I am waitting for answer.

    Thanks

  2. hi ,i have a problem when installing squidtl-0.22, like this:

    common.h:52:48: err:pcre.h:
    common.h:66:27: err:libxml/parser.h
    common.h:67:25: err:libxml/tree.h:
    config.c:25: err:expected ‘)’ before ‘*’ token
    …………………………………………………….
    But i have install
    mysql-server-5.1.61-4.el6.x86_64
    squid-3.1.10-1.el6_2.4.x86_64
    libxml2-2.7.6-4.el6_2.4.x86_64
    xmlrpc-c-client-1.16.24-1209.1840.el6.x86_64
    xmlrpc-c-1.16.24-1209.1840.el6.x86_64
    pcre-7.8-4.el6.x86_64
    in centos 6.3
    whether my software version is higher than required? Thank u for your help!

  3. Hi Michele,I got it with your help . I really miss to install libxml2-dev and pcre-dev.Thank U!

    But ,I get a other problem after step by step following the INSTALL.

    (1) the web index.php is blank ,so is the other web in www directory. But my PHP is Ok.
    (2) SElinux is disabled
    (2)the log of squidtl.log as follow :

    [5520] 2008-01-01 12:25:58 DEBUG – CB_Signal: 14
    [5519] 2008-01-01 12:25:58 DEBUG – CB_Signal: 14
    [5520] 2008-01-01 12:25:58 DEBUG – SQL: DELETE FROM DB_Access WHERE TIMESTAMPDIFF(MINUTE,AddDate,NOW()) > 360;
    [5519] 2008-01-01 12:25:58 DEBUG – SQL: DELETE FROM DB_Access WHERE TIMESTAMPDIFF(MINUTE,AddDate,NOW()) > 360;
    [5518] 2008-01-01 12:25:58 DEBUG – CB_Signal: 14
    [5518] 2008-01-01 12:25:58 DEBUG – SQL: DELETE FROM DB_Access WHERE TIMESTAMPDIFF(MINUTE,AddDate,NOW()) > 360;
    [5521] 2008-01-01 12:25:58 DEBUG – CB_Signal: 14
    [5521] 2008-01-01 12:25:58 DEBUG – SQL: DELETE FROM DB_Access WHERE TIMESTAMPDIFF(MINUTE,AddDate,NOW()) > 360;
    [5523] 2008-01-01 12:25:58 DEBUG – CB_Signal: 14
    [5523] 2008-01-01 12:25:58 DEBUG – SQL: DELETE FROM DB_Access WHERE TIMESTAMPDIFF(MINUTE,AddDate,NOW()) > 360;
    [5523] 2008-01-01 12:25:58 ERROR – SQL Error: Table ‘squidtl.DB_Access’ doesn’t exist
    [5521] 2008-01-01 12:25:58 ERROR – SQL Error: Table ‘squidtl.DB_Access’ doesn’t exist
    [5519] 2008-01-01 12:25:58 ERROR – SQL Error: Table ‘squidtl.DB_Access’ doesn’t exist
    [5518] 2008-01-01 12:25:58 ERROR – SQL Error: Table ‘squidtl.DB_Access’ doesn’t exist
    [5520] 2008-01-01 12:25:58 ERROR – SQL Error: Table ‘squidtl.DB_Access’ doesn’t exist

    1. Hi Simon,

      firstly check that DB_Access table exists in the database. Then, if exists,please check:

      1) in www directory (root of the web site) you have already copied “config.inc.sample.php” to “config.inc.php”
      2) use “nano” or other text editor to verify that MySQL credentials inside “config.inc.php” was correctly set.

      Of course you need to have installed mysql-server 🙂

      Good luck, Michele

  4. Hi Michele,
    After installed squidtl, restart squid is ok. But squidtl can’t work ,And squidtl.log was as follow:

    [10400] 2012-08-28 08:59:05 FATAL – FEOF on STDIN detected: Squid has gone away ?
    [10402] 2012-08-28 08:59:05 FATAL – FEOF on STDIN detected: Squid has gone away ?
    [10400] 2012-08-28 08:59:05 FATAL – Shutdown NOW !
    [10402] 2012-08-28 08:59:05 FATAL – Shutdown NOW !
    [10400] 2012-08-28 08:59:05 FATAL – LOG CLOSE
    [10402] 2012-08-28 08:59:05 FATAL – LOG CLOSE
    [10401] 2012-08-28 08:59:05 FATAL – FEOF on STDIN detected: Squid has gone away ?
    [10401] 2012-08-28 08:59:05 FATAL – Shutdown NOW !
    [10401] 2012-08-28 08:59:05 FATAL – LOG CLOSE
    [10403] 2012-08-28 08:59:05 FATAL – FEOF on STDIN detected: Squid has gone away ?
    [10403] 2012-08-28 08:59:05 FATAL – Shutdown NOW !
    [10403] 2012-08-28 08:59:05 FATAL – LOG CLOSE
    [10405] 2012-08-28 08:59:05 FATAL – FEOF on STDIN detected: Squid has gone away ?
    [10405] 2012-08-28 08:59:05 FATAL – Shutdown NOW !
    [10405] 2012-08-28 08:59:05 FATAL – LOG CLOSE
    [11159] 2012-08-28 08:59:06 FATAL – LOG START (Verbosity: 2)
    [11159] 2012-08-28 08:59:06 NOTICE – SquidTL v0.2.2
    [11161] 2012-08-28 08:59:06 FATAL – LOG START (Verbosity: 2)
    [11161] 2012-08-28 08:59:06 NOTICE – SquidTL v0.2.2
    [11160] 2012-08-28 08:59:06 FATAL – LOG START (Verbosity: 2)
    [11160] 2012-08-28 08:59:06 NOTICE – SquidTL v0.2.2
    [11159] 2012-08-28 08:59:06 NOTICE – SQL(localhost:root) connection OK
    [11160] 2012-08-28 08:59:06 NOTICE – SQL(localhost:root) connection OK
    [11162] 2012-08-28 08:59:06 FATAL – LOG START (Verbosity: 2)
    [11162] 2012-08-28 08:59:06 NOTICE – SquidTL v0.2.2
    [11161] 2012-08-28 08:59:06 NOTICE – SQL(localhost:root) connection OK
    [11162] 2012-08-28 08:59:06 NOTICE – SQL(localhost:root) connection OK
    [11164] 2012-08-28 08:59:06 FATAL – LOG START (Verbosity: 2)
    [11164] 2012-08-28 08:59:06 NOTICE – SquidTL v0.2.2
    [11164] 2012-08-28 08:59:06 NOTICE – SQL(localhost:root) connection OK

    what caused above? Thank u ~

  5. Hi Michele,

    Thanks a million for your help again and again !

    my OS is Centos 6.3 2.6.32-279.el6.x86_64, squid version is squid-3.1.10-1.el6_2.4.x86_64

    1) I test squid work ok ,then I add this line “url_rewrite_program /usr/local/bin/squidtl -l /var/log/squid/squidtl.log -c /etc/squid/config.xml” to squid.conf.
    sure,exec “which squidtl” shows ” /usr/local/bin/squidtl”

    2)restar squid , squid is ok ,nothing is wrong .but squidtl can’t work .The squidtl.log like above.

    3)I find squid ‘s log (cache.log) have no difference whether add the url_rewrite_program when restarting the squid.

    4) The squidtl web can be reaching ,And the connection of mysql is ok .also, I may change the passwd of admin . And can read the access.log through squidtl ‘s web if the squid ACL allows.

    Michele ,if I need to paste my squid.conf and squid’s log ( cache.log ) ?

    THank u very much ~

Rispondi a Michele Pinassi Annulla risposta

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.