Download Apache Benchmark for Unix - Secure Configuration Benchmarks

Transcript
The Center for Internet Security
Apache Benchmark for Unix
•
Pause Feature: This will cause Mod_Security to wait a specified period of time (in milliseconds)
before acting on a request trigger. The main benefit here is that time delays can significantly
slowdown, and in some cases break, vulnerability scanners. Syntax is –
SecFilterDefaultAction "deny,log,pause:10000,status:403"
•
Buffer Overflow Protection: Mod_Security can set limits on acceptable byte ranges for user
input (excluding the POST Payload of a request). This can be useful for avoiding many stack
overflow attacks (since they often contain random “binary” data). Default byte range is 0-255,
meaning all bytes are allowed. Typically, byte ranges between 32–126 are all you need for http
communication. This link provides an ASCII Chart showing the byte ranges - http://itechnica.com/whitestuff/asciichart.html.
•
Server Identity Masking: Instead of editing and recompiling source code, Mod_Security has a
directive, which will change your HTTP “Server:” banner token just before it is sent to the client.
Example – SecServerSignature “Microsoft-IIS/5.0”
•
HTTPS Filtering: Since the engine is embedded in the web server, it gets access to request data
after decryption takes place. Normal NIDS cannot inspect SSL/Encrypted traffic, but
Mod_Security can!
Action: Execute the following commands to implement Mod_Security
Prior to implementing Mod_Security, it is HIGHLY recommended that you read the full User’s Manual at
this location: http://www.modsecurity.org/documentation/. This document will provided full descriptions of
Mod_Security’s capabilities and will help to clarify the quickstep information below. First you must install
mod_security.
Installing mod_security via yum
# yum install mod_security
Review and edit the /etc/httpd/conf.d/mod_security.conf to suit your needs. The following are enabled by
default for Fedora Core 5 and recommended and are likely to be safe for most web servers, also review
suggestions from the Mod_security website http://www.modsecurity.org/documentation/quickexamples.html
LoadModule security_module modules/mod_security.so
<IfModule mod_security.c>
# Turn the filtering engine On or Off
SecFilterEngine On
# The audit engine works independently and
# can be turned On of Off on the per-server or
# on the per-directory basis
SecAuditEngine RelevantOnly
# Make sure that URL encoding is valid
SecFilterCheckURLEncoding On
# Unicode encoding check
SecFilterCheckUnicodeEncoding On
# Only allow bytes from this range
SecFilterForceByteRange 1 255
Version 1.6
Page 19 of 70