ModSecurity Configuration for Tiki | |
|
1. Introduction | |
ModSecurity is a powerful, open-source web application firewall (WAF) module that enhances security by protecting web applications, including Tiki sites, from a wide range of threats such as SQL injection, cross-site scripting (XSS), and malicious bots attempting to scrape content or exploit vulnerabilities. It operates based on predefined rules to filter and block potentially harmful requests. This guide provides a comprehensive walkthrough for setting up and configuring ModSecurity, ensuring optimal security while preserving Tiki's usability and functionality.
|
2. Installation | |
Step 1: Install ModSecurity | |
For Apache (Debian/Ubuntu) Copy to clipboard
|
Step 2: Enable ModSecurity | |
Enable ModSecurity by copying the recommended configuration file: Copy to clipboard
Then, edit the file: Copy to clipboard
Find: apache Copy to clipboard
Change it to: apache Copy to clipboard
Save and close the file. |
Step 3: Verify Installation | |
Check if ModSecurity is enabled: Copy to clipboard
Expected output: Copy to clipboard
If the module is not loaded, restart Apache: Copy to clipboard
|
3. Basic Configuration | |
Step 1: Enable the OWASP CRS Rules | |
Enable the OWASP Core Rule Set (CRS): Copy to clipboard
Ensure this line is included: apache Copy to clipboard
Restart Apache: Copy to clipboard
|
Step 2: Adjust Anomaly Scoring | |
Modify anomaly scoring to reduce false positives: Copy to clipboard
Change: apache Copy to clipboard
Restart Apache: Copy to clipboard
|
4. Tiki-Specific Configuration | |
Step 1: Handling False Positives | |
Exclude static files: Copy to clipboard
Add: apache Copy to clipboard
apache Copy to clipboard
Restart Apache: Copy to clipboard
|
Step 2: Handling Language-Specific False Positives | |
Some actions by users on Tiki sites may trigger alerts or blocking due to ModSecurity's filtering rules. For example, words with multiple accented characters in a single word, like "Měšťáček" (Czech), can be flagged as suspicious. To prevent such cases from causing a 500 error or blocking the page: |
Review ModSecurity logs for blocked requests: | |
Copy to clipboard
|
Identify the specific rule blocking the request. | |
Create an exception rule in `REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf`. | |
apache Copy to clipboard
|
Restart Apache: | |
Copy to clipboard
|
Conclusion | |
This guide helps secure Tiki with ModSecurity, prevent false positives, and block malicious bots. Regularly monitor logs and adjust exclusion rules for usability.
related pages
Security Admin
external links
aliases for this page
|