The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mod Security but how?

Discussion in 'Security' started by MrNone, Nov 2, 2004.

  1. MrNone

    MrNone Active Member

    Sep 25, 2004
    Likes Received:
    Trophy Points:
    Hi friends.

    Im new. I install mod_security for apache. My server have redhat 9.0, cpanel+whm. Where i must paste it?

    <IfModule mod_security.c>
        # Turn the filtering engine On or Off
        SecFilterEngine On
        # Change Server: string
        SecServerSignature " "
        # Make sure that URL encoding is valid
        SecFilterCheckURLEncoding On
        # This setting should be set to On only if the Web site is
        # using the Unicode encoding. Otherwise it may interfere with
        # the normal Web site operation.
        SecFilterCheckUnicodeEncoding Off
        # Only allow bytes from this range
        SecFilterForceByteRange 1 255
        # The audit engine works independently and
        # can be turned On of Off on the per-server or
        # on the per-directory basis. "On" will log everything,
        # "DynamicOrRelevant" will log dynamic requests or violations,
        # and "RelevantOnly" will only log policy violations
        SecAuditEngine RelevantOnly
        # The name of the audit log file
        SecAuditLog /var/log/httpd/audit_log
        # Should mod_security inspect POST payloads
        SecFilterScanPOST On
        # Action to take by default
        SecFilterDefaultAction "deny,log,status:500"
        # Require HTTP_USER_AGENT and HTTP_HOST in all requests
        SecFilterSelective "HTTP_USER_AGENT|HTTP_HOST" "^$"
        # Prevent path traversal (..) attacks
        SecFilter "../"
        # Weaker XSS protection but allows common HTML tags
        SecFilter "<[[:space:]]*script"
        # Prevent XSS atacks (HTML/Javascript injection)
        SecFilter "<(.|n)+>"
        # Very crude filters to prevent SQL injection attacks
        SecFilter "delete[[:space:]]+from"
        SecFilter "insert[[:space:]]+into"
        SecFilter "select.+from"
        # Protecting from XSS attacks through the PHP session cookie
        SecFilterSelective ARG_PHPSESSID "!^[0-9a-z]*$"
        SecFilterSelective COOKIE_PHPSESSID "!^[0-9a-z]*$"

    Help me please :confused:
  2. sawbuck

    sawbuck Well-Known Member

    Jan 18, 2004
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    If you installed mod_security from WHM or from source those directives are placed in the httpd.conf file.

Share This Page