r2 - 14 Feb 2007 - 14:15:51 - ChristianFoliniYou are here: TWiki >  Main Web > Task34Start

Task34Start - Use LocationMatch in rules

See TasksExplained? for more infos about tasks. This task is based on the template at TaskTemplateStart

Status : closed
Category : gui
Date opened : 2007-10-02
Description : Use LocationMatch in rules
Referenced in stories/tasks :
Testsuite : test/functional/rules_generator_test.rb
Commited revision : 115

Remarks :
This has been a suggestion by Ofer Shezaf.


Changelog

2007-02-14 - implemented

Example ruleset looks as follows:

...
# allow: GET /index.html
<LocationMatch "^/index.html$">
  SecRule REQUEST_METHOD "^GET$" "allow,t:none,nolog,id:6"
</LocationMatch>

<LocationMatch "^/.*$">
  SecAction "deny,status:501,severity:3,msg:'Unknown request. Access denied by fallback rule.'"
</LocationMatch>

Notes:

  • The t:none covers for the fact, that t:lowercase is applied by default. T:lowercase is a standard transformation of the request parameters.
  • status:501 covers an unexpected behaviour in modsecurity 2.1.0-rc7. SecAction would not take the SecDefaultAction into consideration but trigger a 403.

TaskStati
TaskStatus? closed
Task-Categories gui
Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
Main.TaskTemplateStart moved from Main.TaskTemplate on 19 Jan 2007 - 12:41 by ChristianFolini
 

No permission to view WebTopBar?

No permission to view WebBottomBar?