Authentification Local (Squid)
-
Boujour !!!
Contexte :
Milieu Scolaire, (Licence professionnelle) niveau débutant (première utilisation de pfsense, mais celui-ci est imposé) - L'infra est pour mon projet de validation de l'année (donc assez important en soit mais pas de mise en prod si c'est la la question).
J'utilise PfSense (2.2.6).Besoin :
Je dois créer plusieurs utilisateur (Admin, jordan, test) qui une fois les paramètres du proxy rentrés dans le navigateur devront avoir un popup ou il devront se connecter pour avoir accès à internet et être filtrer en conséquent.
Les utilisateur devront être des utilisateurs locaux de pfsense (ou alors freeradius mais je n'arrive pas à la configurer)1: Admin pourra visiter n'importe quel site
2: jordan et test ne pourront accéder aux sites porno, et aux réseaux sociaux)J'ai créé les utilisateur dans SquidProxy (il ne demande qu'un username, password et une description donc ce n'est pas très compliqué jusque la).
Sur SquidGuard, utilisé la blacklist de l'université de toulouse, j'ai créé des "Groups ACL" pour chaques utilisateur
je rentre les paramètres du proxy dans mon navigateur, quand je charge google.com un popup s'affiche, me demande login et mot de passe mais quand je rentre l'un et l'autre cela ne fonctionne pas et il me demande de nouveau de le rentrer…
cela fais des heures et des heures que je fouille le net à la recherche de réponse mais je ne trouve rien et je commence sincèrement à être désespéré. (Je tiens à préciser que c'est la première fois que je touche du pfsense).
J'ai essayé avec FreeRadius mais j'ai toujours le même problème (peut être mal configuré) mais pour ce qui est des utilisateurs locaux il n'y a pas grand chose à configurer, donc je ne comprend pas que cela ne fonctionne pas..
Schéma :
J'ai une connexion Wifi (Box internet ou partage de connexion mobile quand je serais devant le jury, oui c'est précaire mais je n'ai pas vraiment le choix).
J'ai mon PC avez un PfSense en VM et un client windows 7 en client (pour configurer pfsense en graphique et pour faire les test de blacklist, etc)
J'utilise VMware Workstation 9LAN :
192.168.1.1 pour accéder au pfsense (https://192.168.1.1:8443)
Règles Firewall :
WAN: Celles de base, je n'en ai pas rajoutée.
LAN:
-
-
- LAN Address 8443, 80, 22 * * Anti-Lockout Rule
-
IPv4 * LAN net * * * * none Default allow LAN to any rule
IPv6 * LAN net * * * * none Default allow LAN IPv6 to any rule
IPv4 TCP WAN net * * 80 (HTTP) * none
IPv4 TCP * * * 3128 * none
IPv4 * LAN net * 192.168.1.1 * * none Empêcher contournement du Proxy
Packages ajoutés :
-
Cron : Pour la MAJ automatique de la blacklist
-
LightSquid (ne fonctionne pas pour le moment, j'ai un message d'erreur) à la base pour journaliser
-
Sarg (ne fonctionne pas pour le moment, j'ai un message d'erreur) pour journaliser aussi
-
Squid 3 (Proxy)
-
SquidGuard (Filtrage)
-
freeradius 2 : Car je suis désespérer de ne pas réussir avec les comptes locaux
Recherches :
Logs et tests :J'ai arpenter internet à la recherche de solution mais je n'ai rien trouvé de concret ou qui puisse résoudre mon problème, le soucis et que les explications ne sont pas assez détaillées.. malheureusement.
J'ai aussi chercher dans les 12 pages de recherche avec pour mot clé "authentification" soit 356 sujets sans trouver.
Etant maintenant en mort cérébrale je m'en remet à vous.Merci d'avance pour vos réponses !
Si vous avez besoin de plus de renseignements dite le moi. -
-
Pour faire simple tu veux mettre en place un proxy avec du filtrage basé sur des groupes, le tout en local sur pfSense.
C'est ça ?PS : si on résout ce problème pour toi, on est admis à ta place ? :P (joke)
-
Oui, en gros c'est bien ça :)
J'ai déjà créé les comptes utilisateurs dans : Services / Proxy Server / Users
ensuite j'ai renseigné ces utilisateurs dans : services / Proxy filter SquidGuard / Groups ACL / "+" (par contre dans la rubrique "Client (source)" je ne sais pas si je note le nom de l'utilisateur comme ceci 'test' ou comme ça "test".
enfin bref, après tout cela quand je renseigne les paramètres du proxy dans mon navigateur un popup apparait pour que je puisse me connecter, j'ai beau rentrer tout les logins/mot de passe du monde rien ne se passe il me remet le popup en boucle sans charger la page et sur la page il est écrit qu'elle ne se chargera pas tant que je ne me serait pas authentifié en gros..
Vu votre niveau en pfsense ça ne compte pas, il vous faut un examen plus complexe :P
-
C'est une problématique qui est plus "Squid proxy" que pfSense ;)
Je n'utilise pas le proxy de pfSense.
A mon avis, il ne faut pas que tu essaies de tout résoudre à la fois si ça ne fonctionne pas comme prévu.Reprends ta conf de base avec uniquement le proxy et l’authentification, ça limitera le scope des investigations.
Quand tu vas demander une page, le proxy va renvoyer un code HTTP 407 que tu dois voir dans le log du proxy.
Et tu devrais y voir également la réponse de l’utilisateur, ce qui te permettra de vérifier que cette couche fonctionne (ou pas)L'étape suivante, c'est le profiling dont Squidguard a besoin pour donner des droits d'accès.
Squid relaie à Squidguard les informations relatives à l'utilisateur donc si tu t'authentifie correctement, le reste est surtout question d'ACL mais ça viendra par la suite. -
Voici la page de log de Squid :
Date IP Status Address User Destination
19.03.2016 10:42:38 192.168.1.2 TCP_DENIED/407 192.168.1.1:443 admin -
19.03.2016 10:42:22 192.168.1.2 TCP_DENIED/407 192.168.1.1:443 test -
19.03.2016 10:41:58 192.168.1.2 TCP_DENIED/407 http://www.gstatic.com/generate_204 - -
19.03.2016 10:41:37 192.168.1.2 TCP_DENIED/407 ssl.gstatic.com:443 - -
19.03.2016 10:41:37 192.168.1.2 TCP_DENIED/407 ssl.gstatic.com:443 - -
19.03.2016 10:41:34 192.168.1.2 TCP_DENIED/407 http://vauzxvkxyj/ - -
19.03.2016 10:41:34 192.168.1.2 TCP_DENIED/407 http://wkgklbajande/ - -
19.03.2016 10:41:34 192.168.1.2 TCP_DENIED/407 http://laxubxltb/ - -
19.03.2016 10:41:32 192.168.1.2 TCP_DENIED/407 http://www.google.fr/ test -
19.03.2016 10:41:28 192.168.1.2 TCP_DENIED/407 translate.googleapis.com:443 - -Désolé pour l'affichage, je peut mettre la photo si tu préfère.
Tu en penses quoi ?
-
j'en pense que mon explication initiale n'est potentiellement pas la bonne (preuve que je ne pratique pas Squid sur pfSense) car il est également possible que l’authentification ne soit générée que par Squidguard si déclenchée par les ACL.
Tu peux coller ici ta conf Squidguard ?
-
Voici : :)
============================================================
SquidGuard configuration file
This file generated automaticly with SquidGuard configurator
(C)2006 Serg Dvoriancev
email: dv_serg@mail.ru
============================================================
logdir /var/squidGuard/log
dbhome /var/db/squidGuardTeddy
src teddy {
log block.log
}Eleves IUT CALAIS
src Eleves {
user jordan
log block.log
}Administrateur IUT CALAIS
src admin {
log block.log
}dest blk_blacklists_adult {
domainlist blk_blacklists_adult/domains
expressionlist blk_blacklists_adult/expressions
urllist blk_blacklists_adult/urls
log block.log
}dest blk_blacklists_agressif {
domainlist blk_blacklists_agressif/domains
expressionlist blk_blacklists_agressif/expressions
urllist blk_blacklists_agressif/urls
log block.log
}dest blk_blacklists_arjel {
domainlist blk_blacklists_arjel/domains
log block.log
}dest blk_blacklists_associations_religieuses {
domainlist blk_blacklists_associations_religieuses/domains
log block.log
}dest blk_blacklists_astrology {
domainlist blk_blacklists_astrology/domains
urllist blk_blacklists_astrology/urls
log block.log
}dest blk_blacklists_audio-video {
domainlist blk_blacklists_audio-video/domains
urllist blk_blacklists_audio-video/urls
log block.log
}dest blk_blacklists_bank {
domainlist blk_blacklists_bank/domains
log block.log
}dest blk_blacklists_bitcoin {
domainlist blk_blacklists_bitcoin/domains
urllist blk_blacklists_bitcoin/urls
log block.log
}dest blk_blacklists_blog {
domainlist blk_blacklists_blog/domains
urllist blk_blacklists_blog/urls
log block.log
}dest blk_blacklists_celebrity {
domainlist blk_blacklists_celebrity/domains
urllist blk_blacklists_celebrity/urls
log block.log
}dest blk_blacklists_chat {
domainlist blk_blacklists_chat/domains
urllist blk_blacklists_chat/urls
log block.log
}dest blk_blacklists_child {
domainlist blk_blacklists_child/domains
urllist blk_blacklists_child/urls
log block.log
}dest blk_blacklists_cleaning {
domainlist blk_blacklists_cleaning/domains
urllist blk_blacklists_cleaning/urls
log block.log
}dest blk_blacklists_cooking {
domainlist blk_blacklists_cooking/domains
log block.log
}dest blk_blacklists_dangerous_material {
domainlist blk_blacklists_dangerous_material/domains
urllist blk_blacklists_dangerous_material/urls
log block.log
}dest blk_blacklists_dating {
domainlist blk_blacklists_dating/domains
urllist blk_blacklists_dating/urls
log block.log
}dest blk_blacklists_ddos {
domainlist blk_blacklists_ddos/domains
log block.log
}dest blk_blacklists_dialer {
domainlist blk_blacklists_dialer/domains
log block.log
}dest blk_blacklists_download {
domainlist blk_blacklists_download/domains
urllist blk_blacklists_download/urls
log block.log
}dest blk_blacklists_drogue {
domainlist blk_blacklists_drogue/domains
urllist blk_blacklists_drogue/urls
log block.log
}dest blk_blacklists_educational_games {
domainlist blk_blacklists_educational_games/domains
urllist blk_blacklists_educational_games/urls
log block.log
}dest blk_blacklists_filehosting {
domainlist blk_blacklists_filehosting/domains
urllist blk_blacklists_filehosting/urls
log block.log
}dest blk_blacklists_financial {
domainlist blk_blacklists_financial/domains
urllist blk_blacklists_financial/urls
log block.log
}dest blk_blacklists_forums {
domainlist blk_blacklists_forums/domains
expressionlist blk_blacklists_forums/expressions
urllist blk_blacklists_forums/urls
log block.log
}dest blk_blacklists_gambling {
domainlist blk_blacklists_gambling/domains
urllist blk_blacklists_gambling/urls
log block.log
}dest blk_blacklists_games {
domainlist blk_blacklists_games/domains
urllist blk_blacklists_games/urls
log block.log
}dest blk_blacklists_hacking {
domainlist blk_blacklists_hacking/domains
urllist blk_blacklists_hacking/urls
log block.log
}dest blk_blacklists_jobsearch {
domainlist blk_blacklists_jobsearch/domains
log block.log
}dest blk_blacklists_lingerie {
domainlist blk_blacklists_lingerie/domains
urllist blk_blacklists_lingerie/urls
log block.log
}dest blk_blacklists_liste_blanche {
domainlist blk_blacklists_liste_blanche/domains
urllist blk_blacklists_liste_blanche/urls
log block.log
}dest blk_blacklists_liste_bu {
domainlist blk_blacklists_liste_bu/domains
urllist blk_blacklists_liste_bu/urls
log block.log
}dest blk_blacklists_malware {
domainlist blk_blacklists_malware/domains
expressionlist blk_blacklists_malware/expressions
urllist blk_blacklists_malware/urls
log block.log
}dest blk_blacklists_manga {
domainlist blk_blacklists_manga/domains
urllist blk_blacklists_manga/urls
log block.log
}dest blk_blacklists_marketingware {
domainlist blk_blacklists_marketingware/domains
urllist blk_blacklists_marketingware/urls
log block.log
}dest blk_blacklists_mixed_adult {
domainlist blk_blacklists_mixed_adult/domains
urllist blk_blacklists_mixed_adult/urls
log block.log
}dest blk_blacklists_mobile-phone {
domainlist blk_blacklists_mobile-phone/domains
urllist blk_blacklists_mobile-phone/urls
log block.log
}dest blk_blacklists_phishing {
domainlist blk_blacklists_phishing/domains
urllist blk_blacklists_phishing/urls
log block.log
}dest blk_blacklists_press {
domainlist blk_blacklists_press/domains
urllist blk_blacklists_press/urls
log block.log
}dest blk_blacklists_publicite {
domainlist blk_blacklists_publicite/domains
expressionlist blk_blacklists_publicite/expressions
urllist blk_blacklists_publicite/urls
log block.log
}dest blk_blacklists_radio {
domainlist blk_blacklists_radio/domains
urllist blk_blacklists_radio/urls
log block.log
}dest blk_blacklists_reaffected {
domainlist blk_blacklists_reaffected/domains
urllist blk_blacklists_reaffected/urls
log block.log
}dest blk_blacklists_redirector {
domainlist blk_blacklists_redirector/domains
expressionlist blk_blacklists_redirector/expressions
urllist blk_blacklists_redirector/urls
log block.log
}dest blk_blacklists_remote-control {
domainlist blk_blacklists_remote-control/domains
urllist blk_blacklists_remote-control/urls
log block.log
}dest blk_blacklists_sect {
domainlist blk_blacklists_sect/domains
urllist blk_blacklists_sect/urls
log block.log
}dest blk_blacklists_sexual_education {
domainlist blk_blacklists_sexual_education/domains
urllist blk_blacklists_sexual_education/urls
log block.log
}dest blk_blacklists_shopping {
domainlist blk_blacklists_shopping/domains
urllist blk_blacklists_shopping/urls
log block.log
}dest blk_blacklists_shortener {
domainlist blk_blacklists_shortener/domains
urllist blk_blacklists_shortener/urls
log block.log
}dest blk_blacklists_social_networks {
domainlist blk_blacklists_social_networks/domains
urllist blk_blacklists_social_networks/urls
log block.log
}dest blk_blacklists_special {
domainlist blk_blacklists_special/domains
expressionlist blk_blacklists_special/expressions
urllist blk_blacklists_special/urls
log block.log
}dest blk_blacklists_sports {
domainlist blk_blacklists_sports/domains
log block.log
}dest blk_blacklists_strict_redirector {
domainlist blk_blacklists_strict_redirector/domains
expressionlist blk_blacklists_strict_redirector/expressions
urllist blk_blacklists_strict_redirector/urls
log block.log
}dest blk_blacklists_strong_redirector {
domainlist blk_blacklists_strong_redirector/domains
expressionlist blk_blacklists_strong_redirector/expressions
urllist blk_blacklists_strong_redirector/urls
log block.log
}dest blk_blacklists_translation {
domainlist blk_blacklists_translation/domains
urllist blk_blacklists_translation/urls
log block.log
}dest blk_blacklists_tricheur {
domainlist blk_blacklists_tricheur/domains
urllist blk_blacklists_tricheur/urls
log block.log
}dest blk_blacklists_update {
domainlist blk_blacklists_update/domains
log block.log
}dest blk_blacklists_warez {
domainlist blk_blacklists_warez/domains
expressionlist blk_blacklists_warez/expressions
urllist blk_blacklists_warez/urls
log block.log
}dest blk_blacklists_webmail {
domainlist blk_blacklists_webmail/domains
urllist blk_blacklists_webmail/urls
log block.log
}rew safesearch {
s@(google../search?.q=.)@\1&safe=active@i
s@(google../images.q=.)@\1&safe=active@i
s@(google../groups.q=.)@\1&safe=active@i
s@(google../news.q=.)@\1&safe=active@i
s@(yandex../yandsearch?.text=.)@\1&fyandex=1@i
s@(search.yahoo../search.p=.)@\1&vm=r&v=1@i
s@(search.live../.q=.)@\1&adlt=strict@i
s@(search.msn../.q=.)@\1&adlt=strict@i
s@(.bing..*/.q=.)@\1&adlt=strict@i
log block.log
}acl {
Teddy
teddy {
pass !in-addr !blk_blacklists_adult !blk_blacklists_social_networks all
redirect http://192.168.1.1:80/sgerror.php?url=403%20http%3A%2F%2Fiic0e.univ-littoral.fr%2Fmoodle%2F&a=%a&n=%n&i=%i&s=%s&t=%t&u=%u
rewrite safesearch
log block.log
}Eleves IUT CALAIS
Eleves {
pass !in-addr !blk_blacklists_adult !blk_blacklists_social_networks all
redirect http://iic0e.univ-littoral.fr/moodle/&a=%a&n=%n&i=%i&s=%s&t=%t&u=%u
rewrite safesearch
log block.log
}Administrateur IUT CALAIS
admin {
pass !in-addr all
log block.log
}default {
pass !in-addr !blk_blacklists_adult !blk_blacklists_social_networks all
redirect http://192.168.1.1:80/sgerror.php?url=403%20&a=%a&n=%n&i=%i&s=%s&t=%t&u=%u
rewrite safesearch
log block.log
}
} -
Pourquoi as-tu des groupes vides ? (e.g. teddy & admin) ?
As-tu essayé avec un seul groupe en simplifiant un peu (même si en l’occurrence, c'est assez simple)
1 groupe
1 utilisateur à l'intérieur
1 ACL avec ce groupe -
Je ne sais pas, j'avoue que j'ai un peu du mal à comprendre le fichier conf :/
Je vais essayer de supprimer les utilisateurs et les acls et je vais recommencer je te tiens au courant
-
Donc voilà,
J'ai supprimé les utilisateurs de Squid, j'ai supprimé les ACL de Squidguard, j'ai redémarrer pfsense, j'ai créé l'utilisateur Jordan dans Squid et ça fonctionne il peut maintenant se log sans soucis.
Le seul soucis maintenant c'est pour Squidguard car Jordan est restreint par la blacklist de service / Squidguard proxy / Common ACL.
Donc je me suis dis que j'allais créer des groups ACL dans Service / Squidguard proxy pour avoir une blacklist propre à Jordan mais elle ne fonctionne pas je reste brider uniquement par la blacklist générale.
Je pense que soit:- Je remplis mal les conditions (utilisateurs, options à cocher)
- Les utilisateurs créés dans Squid n'arrive pas à être détectés par Squidguard
En tout cas merci de ton conseil, cela m'a permis de faire fonctionner la partie authentification :) :) :)
-
Dans Squidguard, l'ordre des ACL est important.
-
Pour les ACL il faut mettre de la moins restrictive à la plus restrictive c'est bien ça ?
Pour renseigné ces utilisateurs dans : services / Proxy filter SquidGuard / Groups ACL / "+" (dans la rubrique "Client (source)" je ne sais pas si je note le nom de l'utilisateur comme ceci 'jordan' ou comme ça "jordan" ou encore jordan.
-
je ne connais pas l'interface mais pourquoi faudrait-il mettre des quotes ?
-
Pour les ACL il faut mettre de la moins restrictive à la plus restrictive c'est bien ça ?
Pas vraiment ;)
(Mon commentaire est relatif à Squidguard et pas à son implémentation dans pfSense)
Il faut surtout écrire des ACL qui ne se chevauchent pas, c'est à dire être certain, dans la mesure du possible, qu'à un critère donné ne s'applique qu'une seule ACL.
Par exemple si tu fais des ACL par groupe d'utilisateur, pour les utilisateurs qui appartiennent à plusieurs groupes, seule la première ACL va s'appliquer.
Ou si tu fais des ACL par groupe et des ACL par adresse IP (c'est une drôle d'idée mais juste pour illustrer on propos), seule la première va s'appliquer.
-
Car c'est écrit comme cela dans la création d'ACL:
Enter client's IP address or domain or "username" here. To separate them use space.
Example:
IP: 192.168.0.1 - Subnet: 192.168.0.0/24 or 192.168.1.0/255.255.255.0 - IP-Range: 192.168.1.1-192.168.1.10
Domain: foo.bar matches foo.bar or *.foo.bar
Username: 'user1'Ah d'accord je comprend bien ce que tu veux dire avec l'ordre des ACL.
La normalement ça ne devrait pas poser de problème vu que je veux faire 2 ACL avec des utilisateurs différents.Je voudrais faire 2 groupes ACL:
1 pour les élèves (User Jordan et Teddy): Pas d'accés aux sites pornos et aux réseaux sociaux
1 pour l'admin (User admin): Accès à tous les sites -
Car c'est écrit comme cela dans la création d'ACL:
Username: 'user1'Si l'incertitude se limite à la manière de saisir les membres des groupes, c'est assez vite fait de faire un test non ?
Donc tu as bientôt fini:- 2 ACL pour 2 groupes distincts (et disjoints)
- quelques essais pour vérifier la bonne syntaxe 8)
PS: je me demande bien pourquoi l'administrateur a, lui, le droit de passer du temps sur des sites "ludiques" ;D :-X
-
Après quelques test cela ne fonctionne pas, c'est comme ci il y avait aucune ACL. :o
On va dire que l'administrateur à certains "privilèges" ;D ;D :P
Voici une copie du fichier squidGuard.conf qui est dans ./pbi/squidguard-i386/local/etc/squidguard/
============================================================
SquidGuard configuration file
This file generated automaticly with SquidGuard configurator
(C)2006 Serg Dvoriancev
email: dv_serg@mail.ru
============================================================
logdir /var/squidGuard/log
dbhome /var/db/squidGuardeleves
src eleves {
log block.log
}dest blk_blacklists_adult {
domainlist blk_blacklists_adult/domains
expressionlist blk_blacklists_adult/expressions
urllist blk_blacklists_adult/urls
log block.log
}dest blk_blacklists_agressif {
domainlist blk_blacklists_agressif/domains
expressionlist blk_blacklists_agressif/expressions
urllist blk_blacklists_agressif/urls
log block.log
}dest blk_blacklists_arjel {
domainlist blk_blacklists_arjel/domains
log block.log
}dest blk_blacklists_associations_religieuses {
domainlist blk_blacklists_associations_religieuses/domains
log block.log
}dest blk_blacklists_astrology {
domainlist blk_blacklists_astrology/domains
urllist blk_blacklists_astrology/urls
log block.log
}dest blk_blacklists_audio-video {
domainlist blk_blacklists_audio-video/domains
urllist blk_blacklists_audio-video/urls
log block.log
}dest blk_blacklists_bank {
domainlist blk_blacklists_bank/domains
log block.log
}dest blk_blacklists_bitcoin {
domainlist blk_blacklists_bitcoin/domains
urllist blk_blacklists_bitcoin/urls
log block.log
}dest blk_blacklists_blog {
domainlist blk_blacklists_blog/domains
urllist blk_blacklists_blog/urls
log block.log
}dest blk_blacklists_celebrity {
domainlist blk_blacklists_celebrity/domains
urllist blk_blacklists_celebrity/urls
log block.log
}dest blk_blacklists_chat {
domainlist blk_blacklists_chat/domains
urllist blk_blacklists_chat/urls
log block.log
}dest blk_blacklists_child {
domainlist blk_blacklists_child/domains
urllist blk_blacklists_child/urls
log block.log
}dest blk_blacklists_cleaning {
domainlist blk_blacklists_cleaning/domains
urllist blk_blacklists_cleaning/urls
log block.log
}dest blk_blacklists_cooking {
domainlist blk_blacklists_cooking/domains
log block.log
}dest blk_blacklists_dangerous_material {
domainlist blk_blacklists_dangerous_material/domains
urllist blk_blacklists_dangerous_material/urls
log block.log
}dest blk_blacklists_dating {
domainlist blk_blacklists_dating/domains
urllist blk_blacklists_dating/urls
log block.log
}dest blk_blacklists_ddos {
domainlist blk_blacklists_ddos/domains
log block.log
}dest blk_blacklists_dialer {
domainlist blk_blacklists_dialer/domains
log block.log
}dest blk_blacklists_download {
domainlist blk_blacklists_download/domains
urllist blk_blacklists_download/urls
log block.log
}dest blk_blacklists_drogue {
domainlist blk_blacklists_drogue/domains
urllist blk_blacklists_drogue/urls
log block.log
}dest blk_blacklists_educational_games {
domainlist blk_blacklists_educational_games/domains
urllist blk_blacklists_educational_games/urls
log block.log
}dest blk_blacklists_filehosting {
domainlist blk_blacklists_filehosting/domains
urllist blk_blacklists_filehosting/urls
log block.log
}dest blk_blacklists_financial {
domainlist blk_blacklists_financial/domains
urllist blk_blacklists_financial/urls
log block.log
}dest blk_blacklists_forums {
domainlist blk_blacklists_forums/domains
expressionlist blk_blacklists_forums/expressions
urllist blk_blacklists_forums/urls
log block.log
}dest blk_blacklists_gambling {
domainlist blk_blacklists_gambling/domains
urllist blk_blacklists_gambling/urls
log block.log
}dest blk_blacklists_games {
domainlist blk_blacklists_games/domains
urllist blk_blacklists_games/urls
log block.log
}dest blk_blacklists_hacking {
domainlist blk_blacklists_hacking/domains
urllist blk_blacklists_hacking/urls
log block.log
}dest blk_blacklists_jobsearch {
domainlist blk_blacklists_jobsearch/domains
log block.log
}dest blk_blacklists_lingerie {
domainlist blk_blacklists_lingerie/domains
urllist blk_blacklists_lingerie/urls
log block.log
}dest blk_blacklists_liste_blanche {
domainlist blk_blacklists_liste_blanche/domains
urllist blk_blacklists_liste_blanche/urls
log block.log
}dest blk_blacklists_liste_bu {
domainlist blk_blacklists_liste_bu/domains
urllist blk_blacklists_liste_bu/urls
log block.log
}dest blk_blacklists_malware {
domainlist blk_blacklists_malware/domains
expressionlist blk_blacklists_malware/expressions
urllist blk_blacklists_malware/urls
log block.log
}dest blk_blacklists_manga {
domainlist blk_blacklists_manga/domains
urllist blk_blacklists_manga/urls
log block.log
}dest blk_blacklists_marketingware {
domainlist blk_blacklists_marketingware/domains
urllist blk_blacklists_marketingware/urls
log block.log
}dest blk_blacklists_mixed_adult {
domainlist blk_blacklists_mixed_adult/domains
urllist blk_blacklists_mixed_adult/urls
log block.log
}dest blk_blacklists_mobile-phone {
domainlist blk_blacklists_mobile-phone/domains
urllist blk_blacklists_mobile-phone/urls
log block.log
}dest blk_blacklists_phishing {
domainlist blk_blacklists_phishing/domains
urllist blk_blacklists_phishing/urls
log block.log
}dest blk_blacklists_press {
domainlist blk_blacklists_press/domains
urllist blk_blacklists_press/urls
log block.log
}dest blk_blacklists_publicite {
domainlist blk_blacklists_publicite/domains
expressionlist blk_blacklists_publicite/expressions
urllist blk_blacklists_publicite/urls
log block.log
}dest blk_blacklists_radio {
domainlist blk_blacklists_radio/domains
urllist blk_blacklists_radio/urls
log block.log
}dest blk_blacklists_reaffected {
domainlist blk_blacklists_reaffected/domains
urllist blk_blacklists_reaffected/urls
log block.log
}dest blk_blacklists_redirector {
domainlist blk_blacklists_redirector/domains
expressionlist blk_blacklists_redirector/expressions
urllist blk_blacklists_redirector/urls
log block.log
}dest blk_blacklists_remote-control {
domainlist blk_blacklists_remote-control/domains
urllist blk_blacklists_remote-control/urls
log block.log
}dest blk_blacklists_sect {
domainlist blk_blacklists_sect/domains
urllist blk_blacklists_sect/urls
log block.log
}dest blk_blacklists_sexual_education {
domainlist blk_blacklists_sexual_education/domains
urllist blk_blacklists_sexual_education/urls
log block.log
}dest blk_blacklists_shopping {
domainlist blk_blacklists_shopping/domains
urllist blk_blacklists_shopping/urls
log block.log
}dest blk_blacklists_shortener {
domainlist blk_blacklists_shortener/domains
urllist blk_blacklists_shortener/urls
log block.log
}dest blk_blacklists_social_networks {
domainlist blk_blacklists_social_networks/domains
urllist blk_blacklists_social_networks/urls
log block.log
}dest blk_blacklists_special {
domainlist blk_blacklists_special/domains
expressionlist blk_blacklists_special/expressions
urllist blk_blacklists_special/urls
log block.log
}dest blk_blacklists_sports {
domainlist blk_blacklists_sports/domains
log block.log
}dest blk_blacklists_strict_redirector {
domainlist blk_blacklists_strict_redirector/domains
expressionlist blk_blacklists_strict_redirector/expressions
urllist blk_blacklists_strict_redirector/urls
log block.log
}dest blk_blacklists_strong_redirector {
domainlist blk_blacklists_strong_redirector/domains
expressionlist blk_blacklists_strong_redirector/expressions
urllist blk_blacklists_strong_redirector/urls
log block.log
}dest blk_blacklists_translation {
domainlist blk_blacklists_translation/domains
urllist blk_blacklists_translation/urls
log block.log
}dest blk_blacklists_tricheur {
domainlist blk_blacklists_tricheur/domains
urllist blk_blacklists_tricheur/urls
log block.log
}dest blk_blacklists_update {
domainlist blk_blacklists_update/domains
log block.log
}dest blk_blacklists_warez {
domainlist blk_blacklists_warez/domains
expressionlist blk_blacklists_warez/expressions
urllist blk_blacklists_warez/urls
log block.log
}dest blk_blacklists_webmail {
domainlist blk_blacklists_webmail/domains
urllist blk_blacklists_webmail/urls
log block.log
}rew safesearch {
s@(google../search?.q=.)@\1&safe=active@i
s@(google../images.q=.)@\1&safe=active@i
s@(google../groups.q=.)@\1&safe=active@i
s@(google../news.q=.)@\1&safe=active@i
s@(yandex../yandsearch?.text=.)@\1&fyandex=1@i
s@(search.yahoo../search.p=.)@\1&vm=r&v=1@i
s@(search.live../.q=.)@\1&adlt=strict@i
s@(search.msn../.q=.)@\1&adlt=strict@i
s@(.bing..*/.q=.)@\1&adlt=strict@i
log block.log
}acl {
eleves
eleves {
pass !in-addr !blk_blacklists_adult !blk_blacklists_agressif !blk_blacklists_download !blk_blacklists_financial !blk_blacklists_hacking !blk_blacklists_lingerie !blk_blacklists_manga !blk_blacklists_social_networks !blk_blacklists_webmail all
log block.log
}default {
pass !in-addr !blk_blacklists_adult !blk_blacklists_social_networks all
redirect http://192.168.1.1:80/sgerror.php?url=403%20&a=%a&n=%n&i=%i&s=%s&t=%t&u=%u
rewrite safesearch
log block.log
}
}et voici une copie du fichier "squidguard.conf.xml" dans le même dossier :
<squidguard><logdir>/var/squidGuard/log</logdir>
<dbhome>/var/db/squidGuard</dbhome>
<ldap_enable><ldapbinddn><ldapbindpass><ldapversion>3</ldapversion>
<stripntdomain><striprealm><binpath>/usr/pbi/squidguard-i386/bin</binpath>
<workdir>/usr/pbi/squidguard-i386/etc/squidGuard</workdir>
<sgxml_file>/usr/pbi/squidguard-i386/etc/squidGuard/squidguard_conf.xml</sgxml_file>
<enabled>on</enabled>
<blacklist_enabled>on</blacklist_enabled>
<blacklist_url>ftp://ftp.univ-tlse1.fr/blacklist/blacklists_for_pfsense.tar.gz</blacklist_url>
<sources><name>eleves</name>
<source>'teddy' 'jordan'
<log>on</log>
<name>admin</name>
<source>'admin'
<log>on</log></sources>
<destinations><rewrites><name>safesearch</name><log>on</log>
<targeturl>(google../search?.q=.)</targeturl>
<replaceto>\1&safe=active</replaceto>
<mode>i</mode>
<targeturl>(google../images.q=.)</targeturl>
<replaceto>\1&safe=active</replaceto>
<mode>i</mode>
<targeturl>(google../groups.q=.)</targeturl>
<replaceto>\1&safe=active</replaceto>
<mode>i</mode>
<targeturl>(google../news.q=.)</targeturl>
<replaceto>\1&safe=active</replaceto>
<mode>i</mode>
<targeturl>(yandex../yandsearch?.text=.)</targeturl>
<replaceto>\1&fyandex=1</replaceto>
<mode>i</mode>
<targeturl>(search.yahoo../search.p=.)</targeturl>
<replaceto>\1&vm=r&v=1</replaceto>
<mode>i</mode>
<targeturl>(search.live../.q=.)</targeturl>
<replaceto>\1&adlt=strict</replaceto>
<mode>i</mode>
<targeturl>(search.msn../.q=.)</targeturl>
<replaceto>\1&adlt=strict</replaceto>
<mode>i</mode>
<targeturl>(.bing..*/.q=.)</targeturl>
<replaceto>\1&adlt=strict</replaceto>
<mode>i</mode></rewrites>
<times><acls><0>
<name>eleves</name><disabled><timename><redirect><redirect_mode>rmod_none</redirect_mode>
<rewritename><log>on</log>
<notallowingip>on</notallowingip><overredirect><overrewritename><destname>!blk_blacklists_adult !blk_blacklists_agressif !blk_blacklists_download !blk_blacklists_financial !blk_blacklists_hacking !blk_blacklists_lingerie !blk_blacklists_manga !blk_blacklists_social_networks !blk_blacklists_webmail all</destname>
<overdestname>all</overdestname><1>
<name>admin</name><disabled><timename><redirect><redirect_mode>rmod_none</redirect_mode>
<rewritename><log>on</log>
<notallowingip><overredirect><overrewritename><destname>all</destname>
<overdestname>all</overdestname></overrewritename></overredirect></notallowingip></rewritename></redirect></timename></disabled></overrewritename></overredirect></rewritename></redirect></timename></disabled></acls>
<default><name>default</name>
<description><disabled><timename></timename>
<redirect_mode>rmod_int</redirect_mode>
<redirect><rewritename>safesearch</rewritename>
<log>on</log>
<notallowingip>on</notallowingip>
<destname>!blk_blacklists_adult !blk_blacklists_social_networks all</destname></redirect></disabled></description></default>
<enablelog>on</enablelog>
<enableguilog>on</enableguilog>
<logrotation>on</logrotation>
<adv_blankimg>off</adv_blankimg>
<current_lan_ip>192.168.1.1</current_lan_ip></times></destinations></striprealm></stripntdomain></ldapbindpass></ldapbinddn></ldap_enable></squidguard> -
Après quelques test cela ne fonctionne pas, c'est comme ci il y avait aucune ACL. :o
Voici une copie du fichier squidGuard.conf qui est dans ./pbi/squidguard-i386/local/etc/squidguard/
eleves
src eleves {
log block.log
}:o
il n'y a rien qui te choque dans la conf SquidGuard ???
ça devrait être un truc du genresrc eleves {teddy jordan
log block.log
}Donc à l'évidence les quotes, ce n'est pas ça.
Si ce groupe est vide, bien sûr que les ACL ne s'appliquent pas :P
-
ça fonctionne !
Merci beaucoup Chris !
J'ai de nouveau fait les ACLs (il faut bien écrire comme cela 'teddy' 'jordan' …) donc user entre cotes et espace pour séparer les utilisateurs.
redémarrage de PfSense et prise en compte des ACL cela fonctionne nickel ! ;D ;D ;D