Thread: [mod-security-users] Setenv and checking ENV_
Brought to you by:
victorhora,
zimmerletw
|
From: Christian M. <cma...@is...> - 2005-06-30 10:43:33
|
Hi, i'm having problems with the Setenv action, i want to set an=20 enviroment variable like test=3D1, and then in another rule check if it i= s=20 set, but can't get it done, here is what i do: SecFilterSelective REQUEST_URI "example.asp" setenv:test=3D1,pass And then <Location /admin/toprotect.asp> SecFilterSelective ENV_test "1" log,pass </Location> I first access my example.asp, and then /admin/toprotect.asp, but=20 doesn't work.. Any ideas? Thanks in advance --=20 _________________________________ Christian Martorella e-Security Engineer cma...@is... Internet Security Auditors, S.L. c. Santander, 101. Edif. A. 2=BA 1=AA. 08030 Barcelona Tel: 93 305 13 18 Fax: 93 278 22 48 www.isecauditors.com ____________________________________ Este mensaje y los documentos que, en su caso lleve anexos, pueden contener informaci=F3n confidencial. Por ello, se informa a quien lo reciba por error que la informaci=F3n contenida en el mismo es reservada y su uso no autorizado est=E1 prohibido legalmente, por lo que en tal caso le rogamos que nos lo comunique por la misma v=EDa o por tel=E9fono (93 305 13 18), se abstenga de realizar copias del mensaje o remitirlo o entregarlo a otra persona y proceda a borrarlo de inmediato. En cumplimiento de la Ley Org=E1nica 15/1999 de 13 de diciembre de protecci=F3n de datos de car=E1cter personal, Internet Security Auditors S.L., le informa de que sus datos personales se han incluido en ficheros informatizados titularidad de Internet Security Auditors S.L., que ser=E1 el =FAnico destinatario de dichos datos, y cuya finalida= d exclusiva es la gesti=F3n de clientes y acciones de comunicaci=F3n comercial, y de que tiene la posibilidad de ejercer los derechos de acceso, rectificaci=F3n, cancelaci=F3n y oposici=F3n previstos en la ley mediante carta dirigida a Internet Security Auditors, c. Santander, 101. Edif. A. 2=BA 1=AA, 08030 Barcelona, o v=EDa e-mail a la siguiente direcci=F3n de correo: le...@is... |
|
From: Ivan R. <iv...@we...> - 2005-06-30 11:42:42
|
Christian Martorella wrote: > Hi, i'm having problems with the Setenv action, i want to set an > enviroment variable like test=1, and then in another rule check if it is > set, but can't get it done, here is what i do: Just use the debug log to figure out. > SecFilterSelective REQUEST_URI "example.asp" setenv:test=1,pass > > And then > > <Location /admin/toprotect.asp> > SecFilterSelective ENV_test "1" log,pass > </Location> > > I first access my example.asp, and then /admin/toprotect.asp, but > doesn't work.. > > Any ideas? I suspect this is what happens after inheritance takes place: SecFilterSelective ENV_test "1" log,pass SecFilterSelective REQUEST_URI "example.asp" setenv:test=1,pass In 1.9.x the following should happen: SecFilterSelective REQUEST_URI "example.asp" setenv:test=1,pass SecFilterSelective ENV_test "1" log,pass ... As a temporary workaround in 1.8.x you may want to use SetEnvIf to set the variable. -- Ivan Ristic Apache Security (O'Reilly) - http://www.apachesecurity.net Open source web application firewall - http://www.modsecurity.org |
|
From: Christian M. <cma...@is...> - 2005-06-30 12:43:41
|
I'm using a 1.9dev2 In the logs i have the warning of the example.asp: Warning. Pattern match "example.asp" at REQUEST_URI and then for toprotect.asp: Checking signature "1" at ENV(test) Checking against "" And just for test purposes i tried the following: SecfilterSelective REQUEST_URI "example" "setenv:test=3D1,log,pass" SecFilterSelective REQUEST_URI "toprotect.asp" chain SecFilterSelective ENV_test "1" "log,pass" and it doesn't work either.... Any other clue? Cheers! Ivan Ristic wrote: > Christian Martorella wrote: > >> Hi, i'm having problems with the Setenv action, i want to set an=20 >> enviroment variable like test=3D1, and then in another rule check if i= t=20 >> is set, but can't get it done, here is what i do: > > > Just use the debug log to figure out. > > >> SecFilterSelective REQUEST_URI "example.asp" setenv:test=3D1,pass >> >> And then >> >> <Location /admin/toprotect.asp> >> SecFilterSelective ENV_test "1" log,pass >> </Location> >> >> I first access my example.asp, and then /admin/toprotect.asp, but=20 >> doesn't work.. >> >> Any ideas? > > > I suspect this is what happens after inheritance takes place: > > SecFilterSelective ENV_test "1" log,pass > SecFilterSelective REQUEST_URI "example.asp" setenv:test=3D1,pass > > In 1.9.x the following should happen: > > SecFilterSelective REQUEST_URI "example.asp" setenv:test=3D1,pass > SecFilterSelective ENV_test "1" log,pass > > ... > > As a temporary workaround in 1.8.x you may want to use SetEnvIf > to set the variable. > --=20 _________________________________ Christian Martorella e-Security Engineer cma...@is... Internet Security Auditors, S.L. c. Santander, 101. Edif. A. 2=BA 1=AA. 08030 Barcelona Tel: 93 305 13 18 Fax: 93 278 22 48 www.isecauditors.com ____________________________________ Este mensaje y los documentos que, en su caso lleve anexos, pueden contener informaci=F3n confidencial. Por ello, se informa a quien lo reciba por error que la informaci=F3n contenida en el mismo es reservada y su uso no autorizado est=E1 prohibido legalmente, por lo que en tal caso le rogamos que nos lo comunique por la misma v=EDa o por tel=E9fono (93 305 13 18), se abstenga de realizar copias del mensaje o remitirlo o entregarlo a otra persona y proceda a borrarlo de inmediato. En cumplimiento de la Ley Org=E1nica 15/1999 de 13 de diciembre de protecci=F3n de datos de car=E1cter personal, Internet Security Auditors S.L., le informa de que sus datos personales se han incluido en ficheros informatizados titularidad de Internet Security Auditors S.L., que ser=E1 el =FAnico destinatario de dichos datos, y cuya finalida= d exclusiva es la gesti=F3n de clientes y acciones de comunicaci=F3n comercial, y de que tiene la posibilidad de ejercer los derechos de acceso, rectificaci=F3n, cancelaci=F3n y oposici=F3n previstos en la ley mediante carta dirigida a Internet Security Auditors, c. Santander, 101. Edif. A. 2=BA 1=AA, 08030 Barcelona, o v=EDa e-mail a la siguiente direcci=F3n de correo: le...@is... |
|
From: Ivan R. <iv...@we...> - 2005-06-30 13:02:02
|
Christian Martorella wrote: > I'm using a 1.9dev2 > > In the logs i have the warning of the example.asp: Please send the complete log fragments with configuration. Otherwise I won't be able to recreate the same environment. I tried this: SecfilterSelective REQUEST_URI "example" "setenv:test=1,log,pass" SecFilterSelective ENV_test "1" "log,pass" And it works, like this: Checking signature "example" at REQUEST_URI Checking against "/example" Warning. Pattern match "example" at REQUEST_URI Signature check returned 0 (337 usec) Checking signature "1" at ENV(test) Checking against "1" Warning. Pattern match "1" at ENV(test) Signature check returned 0 (373 usec) Now you try the same :) -- Ivan Ristic Apache Security (O'Reilly) - http://www.apachesecurity.net Open source web application firewall - http://www.modsecurity.org |
|
From: Christian M. <cma...@is...> - 2005-06-30 13:36:38
|
> I tried this: > > SecfilterSelective REQUEST_URI "example" "setenv:test=3D1,log,pass" > SecFilterSelective ENV_test "1" "log,pass" > > And it works, like this: > > Checking signature "example" at REQUEST_URI > Checking against "/example" > Warning. Pattern match "example" at REQUEST_URI > Signature check returned 0 (337 usec) > Checking signature "1" at ENV(test) > Checking against "1" > Warning. Pattern match "1" at ENV(test) > Signature check returned 0 (373 usec) > > Now you try the same :) > I tried that and it works for same request, but if then i do another=20 request to other page ex. toprotect.asp it doesn't match the second signature : Checking signature "1" at ENV(test) The env variable dissapeared between request?? Cheers --=20 _________________________________ Christian Martorella e-Security Engineer cma...@is... Internet Security Auditors, S.L. c. Santander, 101. Edif. A. 2=BA 1=AA. 08030 Barcelona Tel: 93 305 13 18 Fax: 93 278 22 48 www.isecauditors.com ____________________________________ Este mensaje y los documentos que, en su caso lleve anexos, pueden contener informaci=F3n confidencial. Por ello, se informa a quien lo reciba por error que la informaci=F3n contenida en el mismo es reservada y su uso no autorizado est=E1 prohibido legalmente, por lo que en tal caso le rogamos que nos lo comunique por la misma v=EDa o por tel=E9fono (93 305 13 18), se abstenga de realizar copias del mensaje o remitirlo o entregarlo a otra persona y proceda a borrarlo de inmediato. En cumplimiento de la Ley Org=E1nica 15/1999 de 13 de diciembre de protecci=F3n de datos de car=E1cter personal, Internet Security Auditors S.L., le informa de que sus datos personales se han incluido en ficheros informatizados titularidad de Internet Security Auditors S.L., que ser=E1 el =FAnico destinatario de dichos datos, y cuya finalida= d exclusiva es la gesti=F3n de clientes y acciones de comunicaci=F3n comercial, y de que tiene la posibilidad de ejercer los derechos de acceso, rectificaci=F3n, cancelaci=F3n y oposici=F3n previstos en la ley mediante carta dirigida a Internet Security Auditors, c. Santander, 101. Edif. A. 2=BA 1=AA, 08030 Barcelona, o v=EDa e-mail a la siguiente direcci=F3n de correo: le...@is... |
|
From: Ivan R. <iv...@we...> - 2005-06-30 13:44:36
|
Christian Martorella wrote: > > I tried that and it works for same request, but if then i do another > request to other page ex. toprotect.asp > it doesn't match the second signature : > > Checking signature "1" at ENV(test) > > The env variable dissapeared between request?? Oh yes, they do :) Those are per-request environment variables. -- Ivan Ristic Apache Security (O'Reilly) - http://www.apachesecurity.net Open source web application firewall - http://www.modsecurity.org |
|
From: Christian M. <cma...@is...> - 2005-06-30 13:52:16
|
Ivan Ristic wrote: > Christian Martorella wrote: > >> >> I tried that and it works for same request, but if then i do another=20 >> request to other page ex. toprotect.asp >> it doesn't match the second signature : >> >> Checking signature "1" at ENV(test) >> >> The env variable dissapeared between request?? > > > Oh yes, they do :) Those are per-request environment variables. > oops, that explain everything :) Thanks! --=20 _________________________________ Christian Martorella e-Security Engineer cma...@is... Internet Security Auditors, S.L. c. Santander, 101. Edif. A. 2=BA 1=AA. 08030 Barcelona Tel: 93 305 13 18 Fax: 93 278 22 48 www.isecauditors.com ____________________________________ Este mensaje y los documentos que, en su caso lleve anexos, pueden contener informaci=F3n confidencial. Por ello, se informa a quien lo reciba por error que la informaci=F3n contenida en el mismo es reservada y su uso no autorizado est=E1 prohibido legalmente, por lo que en tal caso le rogamos que nos lo comunique por la misma v=EDa o por tel=E9fono (93 305 13 18), se abstenga de realizar copias del mensaje o remitirlo o entregarlo a otra persona y proceda a borrarlo de inmediato. En cumplimiento de la Ley Org=E1nica 15/1999 de 13 de diciembre de protecci=F3n de datos de car=E1cter personal, Internet Security Auditors S.L., le informa de que sus datos personales se han incluido en ficheros informatizados titularidad de Internet Security Auditors S.L., que ser=E1 el =FAnico destinatario de dichos datos, y cuya finalida= d exclusiva es la gesti=F3n de clientes y acciones de comunicaci=F3n comercial, y de que tiene la posibilidad de ejercer los derechos de acceso, rectificaci=F3n, cancelaci=F3n y oposici=F3n previstos en la ley mediante carta dirigida a Internet Security Auditors, c. Santander, 101. Edif. A. 2=BA 1=AA, 08030 Barcelona, o v=EDa e-mail a la siguiente direcci=F3n de correo: le...@is... |