problema regole

Asked by vrubino

Buonasera, innanzitutto complimenti per il progetto molto interessante!
Premesso di non essere molto esperto, ho dei problemi con l'applicazione di alcuni tipi di regole:
utilizzando un dominio --> ogni regola funziona correttamente
utilizzando IP o Ident --> la regola sembra non esser presa in considerazione.
Dai log la regexp sul contesto sembra non avere problemi.
Su squid utilizzo autenticazione con LDAP verso un Active Directory, nessuna acl particolare.
La configurazione è la seguente: Contesto 192.168.0.0/16 (inserita con regexp ottenute da google), Gruppo, Utente con nome "utente" con Ident "vrubino" (no ACL per squidtl) appartenente a Contesto e Gruppo. Azione di default: blocco.

Allego i log di errore di accesso a Google in presenza di una sola regola, in ordine Ident --> utente --> allow --> contesto --> hits 0 tempo 1. Se la regola fosse applicata, accedendo con squid come vrubino dovrei avere accesso ad ogni sito, superando il blocco di default. Invece viene bloccato. Comportamento simile utilizzando l'IP, funzionante invece inserendo il sito da sbloccare.

In attesa di una risposta, grazie molte :)

estratto log

[12222] 2011-04-11 19:05:16 DEBUG - IN: http://www.google.it/ 192.168.101.5/- vrubino GET - myip=192.168.10.13 myport=8080
[12222] 2011-04-11 19:05:16 DEBUG - SquidInfo - P:http D:www.google.it U: O:http://www.google.it/ S:google.it/ F:www.google.it/
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT ID FROM DB_Access WHERE (Src="192.168.101.5" AND Domain="www.google.it") AND TIMESTAMPDIFF(SECOND, AddDate, NOW()) < 5 ORDER BY AddDate DESC LIMIT 1;
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT ipRange,ID FROM DB_Context;
[12222] 2011-04-11 19:05:16 DEBUG - doRegExp: ^192.168.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5])).([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$ 192.168.101.5 = 1
[12222] 2011-04-11 19:05:16 NOTICE - getUserContext(192.168.101.5) = Contesto
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT IdentifiedBy,Value,Username,Type,isActive,DATEDIFF(ExpireDate,CURDATE()) FROM DB_Users WHERE Context='Contesto'
[12222] 2011-04-11 19:05:16 DEBUG - doRegExp: vrubino vrubino = 1
[12222] 2011-04-11 19:05:16 NOTICE - getRealIdent(192.168.101.5) = utente@Contesto (Level:1 Expire:0)
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: INSERT INTO DB_Access (Src,Domain,FullUrl,Ident,realIdent,Context,AddDate) VALUES ("192.168.101.5","www.google.it","http://www.google.it/","utente","utente","Contesto",NOW());
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT GroupID FROM UserGroup WHERE UserID='utente';
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT t1.ID,t1.Type,t1.Value,t1.Action,t1.MaxHits,t1.TimeSlice,t1.redirectUrl FROM DB_Rules AS t1 INNER JOIN RulesGroup AS t2 ON t2.RuleID=t1.ID WHERE t2.GroupID='2' AND t1.isActive=1 AND t1.Context='Contesto';
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT t2.ID,t2.Name,t2.fromHour,t2.toHour,t2.isNegate,t2.daysOfWeek FROM RulesTime AS t1 INNER JOIN DB_Time AS t2 ON t1.TimeID=t2.ID WHERE t1.RuleID=4 AND IF(t2.isNegate,(CURTIME() < t2.fromHour AND CURTIME() > t2.toHour),(t2.fromHour < CURTIME() AND t2.toHour > CURTIME()));
[12222] 2011-04-11 19:05:16 DEBUG - Apply 24x7
[12222] 2011-04-11 19:05:16 DEBUG - checkTimeRule(4) = 1
[12222] 2011-04-11 19:05:16 NOTICE - REDIRECT: 302:http://192.168.10.13/squidtl/negazione.php?rule=default&action=block (DEFAULT)
[12222] 2011-04-11 19:05:16 DEBUG - IN: http://192.168.10.13/squidtl/negazione.php?rule=default&action=block 192.168.101.5/- vrubino GET - myip=192.168.10.13 myport=8080
[12222] 2011-04-11 19:05:16 DEBUG - SquidInfo - P:http D:192.168.10.13 U: O:http://192.168.10.13/squidtl/negazione.php?rule=default&action=block S:192.168.10.13/squidtl/negazione.php?rule=default&action=block F:192.168.10.13/squidtl/negazione.php?rule=default&action=block
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT ID FROM DB_Access WHERE (Src="192.168.101.5" AND Domain="192.168.10.13") AND TIMESTAMPDIFF(SECOND, AddDate, NOW()) < 5 ORDER BY AddDate DESC LIMIT 1;
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT ipRange,ID FROM DB_Context;
[12222] 2011-04-11 19:05:16 DEBUG - doRegExp: ^192.168.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5])).([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$ 192.168.101.5 = 1
[12222] 2011-04-11 19:05:16 NOTICE - getUserContext(192.168.101.5) = Contesto
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT IdentifiedBy,Value,Username,Type,isActive,DATEDIFF(ExpireDate,CURDATE()) FROM DB_Users WHERE Context='Contesto'
[12222] 2011-04-11 19:05:16 DEBUG - doRegExp: vrubino vrubino = 1
[12222] 2011-04-11 19:05:16 NOTICE - getRealIdent(192.168.101.5) = utente@Contesto (Level:1 Expire:0)
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: INSERT INTO DB_Access (Src,Domain,FullUrl,Ident,realIdent,Context,AddDate) VALUES ("192.168.101.5","192.168.10.13","http://192.168.10.13/squidtl/negazione.php?rule=default&action=block","utente","utente","Contesto",NOW());
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT GroupID FROM UserGroup WHERE UserID='utente';
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT t1.ID,t1.Type,t1.Value,t1.Action,t1.MaxHits,t1.TimeSlice,t1.redirectUrl FROM DB_Rules AS t1 INNER JOIN RulesGroup AS t2 ON t2.RuleID=t1.ID WHERE t2.GroupID='2' AND t1.isActive=1 AND t1.Context='Contesto';
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT t2.ID,t2.Name,t2.fromHour,t2.toHour,t2.isNegate,t2.daysOfWeek FROM RulesTime AS t1 INNER JOIN DB_Time AS t2 ON t1.TimeID=t2.ID WHERE t1.RuleID=4 AND IF(t2.isNegate,(CURTIME() < t2.fromHour AND CURTIME() > t2.toHour),(t2.fromHour < CURTIME() AND t2.toHour > CURTIME()));
[12222] 2011-04-11 19:05:16 DEBUG - Apply 24x7
[12222] 2011-04-11 19:05:16 DEBUG - checkTimeRule(4) = 1
[12222] 2011-04-11 19:05:16 NOTICE - REDIRECT: 302:http://192.168.10.13/squidtl/negazione.php?rule=default&action=block (DEFAULT)
[12222] 2011-04-11 19:05:16 DEBUG - IN: http://192.168.10.13/squidtl/negazione.php?rule=default&action=block 192.168.101.5/- vrubino GET - myip=192.168.10.13 myport=8080
[12222] 2011-04-11 19:05:16 DEBUG - SquidInfo - P:http D:192.168.10.13 U: O:http://192.168.10.13/squidtl/negazione.php?rule=default&action=block S:192.168.10.13/squidtl/negazione.php?rule=default&action=block F:192.168.10.13/squidtl/negazione.php?rule=default&action=block
[12222] 2011-04-11 19:05:16 DEBUG - MySQL: SELECT ID FROM DB_Access WHERE (Src="192.168.101.5" AND Domain="192.168.10.13") AND TIMESTAMPDIFF(SECOND, AddDate, NOW()) < 5 ORDER BY AddDate DESC LIMIT 1;
[12222] 2011-04-11 19:05:16 DEBUG - ALLOWED: 192.168.10.13 related request of ID 1613

Question information

Language:
Italian Edit question
Status:
Answered
For:
SquidTL Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michele "O-Zone" Pinassi (o-zone) said :
#1

Ciao,
puoi specificare a quale IP ti riferisci così da riuscire ad interpretare per bene i log ?

Grazie, Michele

Revision history for this message
vrubino (rubinoenzo) said :
#2

Il proxy ha indirizzo IP 192.168.10.13 porta 8080, mentre il pc da cui faccio accesso il 192.168.101.5.
Il log precedente aveva regola Ident, con Utente come nome utente (che corrisponde a vrubino, nome account su active directory passato dallo squid).

Allego per semplicità analogo log con regola sull'IP, ovvero sul 192.168.101.5, che sembra non essere riconosciuta (ho provato a inserire sia l'IP normalmente, con la maschera, sotto forma di regular expression nella forma ^192\.168\.101\.5$ e sue varianti). Chiedo scusa se ho dimenticato di dire che i controlli nell'inserimento dell'IP lo segnalano come invalido (flagReg), lasciando tuttavia abilitare la regola.

Riepilogando la situazione per il log seguente: azione di default block; accesso al proxy da ip 192.168.101.5; regola che dice "IP 192.168.101.5 allow hits 0 tempo 1". (Anche con regole capovolte, ovvero allow come default e block su ip ha lo stesso comportamento).

Grazie

[13520] 2011-04-12 13:44:11 DEBUG - IN: http://www.google.it/ 192.168.101.5/- vrubino GET - myip=192.168.10.13 myport=8080
[13520] 2011-04-12 13:44:11 DEBUG - SquidInfo - P:http D:www.google.it U: O:http://www.google.it/ S:google.it/ F:www.google.it/
[13520] 2011-04-12 13:44:11 DEBUG - MySQL: SELECT ID FROM DB_Access WHERE (Src="192.168.101.5" AND Domain="www.google.it") AND TIMESTAMPDIFF(SECOND, AddDate, NOW()) < 5 ORDER BY AddDate DESC LIMIT 1;
[13520] 2011-04-12 13:44:11 DEBUG - MySQL: SELECT ipRange,ID FROM DB_Context;
[13520] 2011-04-12 13:44:11 DEBUG - doRegExp: ^192.168.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5])).([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$ 192.168.101.5 = 1
[13520] 2011-04-12 13:44:11 NOTICE - getUserContext(192.168.101.5) = Contesto
[13520] 2011-04-12 13:44:11 DEBUG - MySQL: SELECT IdentifiedBy,Value,Username,Type,isActive,DATEDIFF(ExpireDate,CURDATE()) FROM DB_Users WHERE Context='Contesto'
[13520] 2011-04-12 13:44:11 DEBUG - doRegExp: vrubino vrubino = 1
[13520] 2011-04-12 13:44:11 NOTICE - getRealIdent(192.168.101.5) = utente@Contesto (Level:1 Expire:0)
[13520] 2011-04-12 13:44:11 DEBUG - MySQL: INSERT INTO DB_Access (Src,Domain,FullUrl,Ident,realIdent,Context,AddDate) VALUES ("192.168.101.5","www.google.it","http://www.google.it/","utente","utente","Contesto",NOW());
[13520] 2011-04-12 13:44:11 DEBUG - MySQL: SELECT GroupID FROM UserGroup WHERE UserID='utente';
[13520] 2011-04-12 13:44:11 DEBUG - MySQL: SELECT t1.ID,t1.Type,t1.Value,t1.Action,t1.MaxHits,t1.TimeSlice,t1.redirectUrl FROM DB_Rules AS t1 INNER JOIN RulesGroup AS t2 ON t2.RuleID=t1.ID WHERE t2.GroupID='2' AND t1.isActive=1 AND t1.Context='Contesto';
[13520] 2011-04-12 13:44:11 DEBUG - MySQL: SELECT t2.ID,t2.Name,t2.fromHour,t2.toHour,t2.isNegate,t2.daysOfWeek FROM RulesTime AS t1 INNER JOIN DB_Time AS t2 ON t1.TimeID=t2.ID WHERE t1.RuleID=4 AND IF(t2.isNegate,(CURTIME() < t2.fromHour AND CURTIME() > t2.toHour),(t2.fromHour < CURTIME() AND t2.toHour > CURTIME()));
[13520] 2011-04-12 13:44:11 DEBUG - Apply 24x7
[13520] 2011-04-12 13:44:11 DEBUG - checkTimeRule(4) = 1
[13520] 2011-04-12 13:44:11 NOTICE - REDIRECT: 302:http://192.168.10.13/squidtl/negazione.php?rule=default&action=block (DEFAULT)

Revision history for this message
vrubino (rubinoenzo) said :
#3

Ciao Michele, ci sono novità?

Can you help with this problem?

Provide an answer of your own, or ask vrubino for more information if necessary.

To post a message you must log in.