Mod-Security Rules

Rund um die Sicherheit des Systems und die Applikationen
danu
Posts: 264
Joined: 2005-02-02 11:15
 

Autsch

Post by danu »

@blackbird
bittebittebitte. Die perfekte mod_security installation lässt sich nicht in einem vierzeiler beschreiben und für ein kompletes Tutorial fehlt mir die Lust und Zeit.

Ob SuSe oder Debian spielt überhaupt keine Rolle, wenn man Apache2 ein bisschen kennt. Ich habe die mod_security Configs im
conf.d Verzeichnis, weil ich es praktisch fand, dass sie dort sind.
Sie könnten ebensogut woanderst sein, je nach Pfad den ich nach "include" angegeben habe :roll:
blackbird
Posts: 22
Joined: 2006-02-05 09:54
 

Re: Mod-Security Rules

Post by blackbird »

@danu
Ist eh logisch und ich habe eh schon alles installiert.
Ich brauche ebenfalls keine Erklärungen zu einzehlnen Vorgängen.

Ich habe bloss gefragt, welche Configs Du verwendest, ob was selbstgemachtes, oder was "vorgefertigtes" wie z.B.: das von gotroot.com.


Grüße,
blackbird
danu
Posts: 264
Joined: 2005-02-02 11:15
 

Alles durchgelesen

Post by danu »

Ich habe alles, was ich sonst über mod_security gooogeln konnte durchgesehen, ebenfalls in diesem Forum, das mod_security Manual kenne ich schon bald auswendig. Doch dies bringe ich noch nicht auf die Reihe.

Aus dem mod_security Manual:
The LOCATION parameter consist of a series of location
identifiers separated with a pipe.

Examine the following example:

SecFilterSelective "REMOTE_ADDR|REMOTE_HOST" KEYWORD

It will apply the regular expression only the IP address of the
client and the host name. The list of possible location identifiers
includes all CGI variables, and some more. Here is the full list:

REMOTE_ADDR

REMOTE_HOST

REMOTE_USER

REMOTE_IDENT

REQUEST_METHOD

.
.
.etc
soweit alles klar. Es sind ja alles ebenfalls PERL-Variable, und vom
Sinn her verständlich.

jetzt der schwierige Teil:
There are some special locations:

POST_PAYLOAD â?? filter the body of the POST request

ARGS - filter arguments, the same as QUERY_STRING|POST_PAYLOAD

ARGS_NAMES â?? variable/parameter names only

ARGS_VALUES â?? variable/parameter values only
und das Beispiel aus meine Config:
# Allow only letters, digits, underscore, and square brackets (for arrays)
# in variable names
#
SecFilterSelective ARGS_NAMES "!^[][a-zA-Z0-9_]+$"

# GLOBALS attack against PHP 4.x
#
SecFilterSelective ARGS_NAMES "(^globals[|^globals$)"

# URL in a parameter, possible allow_url_fopen attack
#
SecFilterSelective ARGS_VALUES "^http:/"

# Possible code execution attack (targets valid PHP streams constructs)
# see http://www.securityfocus.com/bid/10427
#
SecFilterSelective ARGS_NAMES "^php:/"
Wann schreibt man "ARGS_NAMES" und wann "ARGS_VALUES" ?? 8O

Wie kann ich das konkret voneinander unterscheiden ?
Post Reply