Re: [mod-security-users] allow only integer for a list of params
Brought to you by:
victorhora,
zimmerletw
From: Reindl H. <h.r...@th...> - 2012-01-12 11:37:29
|
hm - it does not like it [root@rh:~]$ apachectl -t Syntax error on line 202 of /etc/httpd/modsecurity.d/modsecurity_99_local_rules.conf: Error creating rule: Unknown variable: s2id > By adjusting the regular expression, you can extend the type > of integers you want to track. what do you mean with this? i like to protect id-params for a cms-systems against non-numeric input and do not understand what you mean with "type of integers" Am 12.01.2012 12:26, schrieb Christian Bockermann: > Hi, > > you want to ensure the parameter values are integers, right? > What about using regular expressions and negation for that? > > SecRule ARGS:/sid|s2id|gi_id/ !^\d{1,2} "id:78,phase:2,block \ > ,msg:'Found non-integer where 2-digit integer values was expected!'" > > > By adjusting the regular expression, you can extend the type > of integers you want to track. > > Is that what you had in mind? > > Regards, > Chris > > > Am 12.01.2012 um 12:16 schrieb Reindl Harald: > >> Hi >> >> ASCII 48-57 are the numbers 0-9 >> >> i would like to have a rule like this for cms-params which >> must be integer but do not know how to marry this with >> @validateByteRange >> >> SecRule ARGS_NAMES "^(sid|s2id|gi_id)$" "id:'78',phase:2,capture,logdata:'%{TX.0}',block,msg:'only integer allowed'" >> ______________________ >> >> SecRule ARGS|ARGS_NAMES|REQUEST_HEADERS|!REQUEST_HEADERS:Referer "@validateByteRange 48-57" >> "id:'960901',t:urlDecodeUni,block,msg:'Invalid character in request'" >> >> -- >> >> Reindl Harald >> the lounge interactive design GmbH >> A-1060 Vienna, Hofmühlgasse 17 >> CTO / software-development / cms-solutions >> p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 >> icq: 154546673, http://www.thelounge.net/ >> >> http://www.thelounge.net/signature.asc.what.htm >> >> ------------------------------------------------------------------------------ >> RSA(R) Conference 2012 >> Mar 27 - Feb 2 >> Save $400 by Jan. 27 >> Register now! >> http://p.sf.net/sfu/rsa-sfdev2dev2_______________________________________________ >> mod-security-users mailing list >> mod...@li... >> https://lists.sourceforge.net/lists/listinfo/mod-security-users >> Commercial ModSecurity Rules and Support from Trustwave's SpiderLabs: >> http://www.modsecurity.org/projects/commercial/rules/ >> http://www.modsecurity.org/projects/commercial/support/ > -- Mit besten Grüßen, Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / software-development / cms-solutions p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm |