#1
Proteger son serveur apache 2.2.3 avec un firewall : mod_securityVous avez dut surement remarquer que des robots cherchent des faillent ou lancent des requetes automatisées sur des failles potentielement éxistentes. Code:<IfModule mod_security.c> # Turn the filtering engine On or Off SecFilterEngine On # Make sure that URL encoding is valid SecFilterCheckURLEncoding On # Unicode encoding check SecFilterCheckUnicodeEncoding Off # Only allow bytes from this range SecFilterForceByteRange 0 255 # Only log suspicious requests SecAuditEngine RelevantOnly # The name of the audit log file SecAuditLog logs/audit_log # Debug level set to a minimum SecFilterDebugLog logs/modsec_debug_log SecFilterDebugLevel 0 # Should mod_security inspect POST payloads SecFilterScanPOST On # By default log and deny suspicious requests # with HTTP status 500 SecFilterDefaultAction "deny,log,status:500" </IfModule> 2ème exemple : Code:# Turn ModSecurity On SecFilterEngine On # Reject requests with status 403 SecFilterDefaultAction "deny,log,status:403" # Some sane defaults SecFilterScanPOST On SecFilterCheckURLEncoding On SecFilterCheckUnicodeEncoding Off # Accept almost all byte values SecFilterForceByteRange 1 255 #Injection SQL SecFilter "delete[[:space:]]+from" SecFilter "insert[[:space:]]+into" SecFilter "select.+from" #Attaque par chemin transversal SecFilter "\.\./" #Injection javascript SecFilter "<script" #Attaques XSS SecFilter "<.+>" SecFilter "<[[:space:]]*script" #Necessite headers HTTP_USER_AGENT ou HTTP_POST SecFilterSelective "HTTP_USER_AGENT|HTTP_HOST" "^$" # Server masking is optional # SecServerSignature "Microsoft-IIS/5.0" SecUploadDir /tmp SecUploadKeepFiles Off # Only record the interesting stuff SecAuditEngine RelevantOnly SecAuditLog logs/audit_log # You normally won't need debug logging SecFilterDebugLevel 0 SecFilterDebugLog logs/modsec_debug_log # Only accept request encodings we know how to handle # we exclude GET requests from this because some (automated) # clients supply "text/html" as Content-Type SecFilterSelective REQUEST_METHOD "!^(GET|HEAD)$" chain SecFilterSelective HTTP_Content-Type \ "!(^application/x-www-form-urlencoded$|^multipart/form-data;)" # Do not accept GET or HEAD requests with bodies SecFilterSelective REQUEST_METHOD "^(GET|HEAD)$" chain SecFilterSelective HTTP_Content-Length "!^$" # Require Content-Length to be provided with # every POST request Le module doit être activé comme ça : #2
Re: Proteger son serveur apache 2.2.3 avec un firewall : mod_securityD'apres ta configuration, dans le premier exemple, il s'agirait plutot d'une erreur 500 :p. Réponse rapide|==> Faire un lien vers ce sujet ??<a href="http://www.brakstar.com/forum/braktopic_34.html" title="Proteger son serveur apache 2.2.3 avec un firewall : mod_security">Proteger son serveur apache 2.2.3 avec un firewall : mod_security</a> | |||||||||||||||||||
| |||||||||||||||||||