Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice