Thread: [mod-security-users] Inspect content of file in modsecurity 2.5.4
Brought to you by:
victorhora,
zimmerletw
From: James P. S. <jam...@gm...> - 2008-05-26 11:17:04
|
Hi! I have a question I indeed to create a rule to filter content of a file (plain text) in modsecurity, what variable can give me all the file content for regular matching them? |
From: Ivan R. <iva...@gm...> - 2008-05-29 18:52:39
|
You can't match file content from ModSecurity (yet), but you can match it from a script. The easiest thing is to use Lua, writing a script that would be invoked using the @inspectFile operator. Such a script would be executed from within ModSecurity. There's an example in the reference manual. If you can't do that, just write a shell script to do the same. The name of the file to inspect will be provided to the script as the first parameter. In your shell script (this works differently from Lua) you need to output a single line of text with either 0 or 1 as the first character, followed by an error message. From the top of my head I can't remember which of the 0 and 1 mean to allow the upload to proceed. On Mon, May 26, 2008 at 12:17 PM, James P. Sullivan <jam...@gm...> wrote: > Hi! I have a question > > I indeed to create a rule to filter content of a file (plain text) in > modsecurity, what variable can give me all the file content for regular > matching them? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > mod-security-users mailing list > mod...@li... > https://lists.sourceforge.net/lists/listinfo/mod-security-users > > -- Ivan Ristic |