CloFix (CRS) Guide
Complete OWASP CRS v4 protection with CloFixRule custom directives, intelligent bypass management, and comprehensive coverage of OWASP Top 10 vulnerabilities.
01 Introduction
The CloFix OWASP Core Rule Set (CRS) is a complete implementation of the OWASP CRS v4 — the industry standard for web application firewall rules. It provides comprehensive protection against the OWASP Top 10 vulnerabilities and countless other attack vectors.
| Feature | Description |
|---|---|
| 25 Rule Files | Complete OWASP CRS v4 rule set covering all attack categories |
| 4 Paranoia Levels | Adjustable protection from low (1) to maximum (4) |
| Anomaly Scoring | Threshold-based blocking with configurable scores |
| CloFixRule Directive | CRS-style custom rules with CloFix branding |
| Intelligent Bypass | Bypass specific rules, tags, phases, paths, or IPs |
02 Architecture
The CloFix CRS engine processes every HTTP request through multiple phases, applying rules in sequence.
HTTP Request
│
▼
┌─────────────────────────────────────────────┐
│ Phase 1: Request Headers │
│ - Method enforcement, protocol validation │
│ - IP reputation, bot detection │
└───────────────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ Phase 2: Request Body │
│ - SQL injection detection │
│ - XSS detection, LFI/RFI detection │
│ - Command injection, NoSQL injection │
└───────────────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ Phase 3: Response Headers │
│ - Data leakage detection │
│ - Security header validation │
└───────────────────┬─────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ Phase 4: Response Body │
│ - Information disclosure detection │
│ - Error message sanitization │
└───────────────────┬─────────────────────────┘
│
▼
Backend / Proxy
03 Rule Files
CloFix CRS loads all 25 standard OWASP CRS rule files in the correct order.
| File | Purpose |
|---|---|
| REQUEST-901-INITIALIZATION.conf | Initial setup, paranoia level, anomaly thresholds |
| REQUEST-905-COMMON-EXCEPTIONS.conf | Common false positive exceptions |
| REQUEST-910-IP-REPUTATION.conf | IP reputation and blacklist detection |
| REQUEST-911-METHOD-ENFORCEMENT.conf | HTTP method restrictions |
| REQUEST-912-DOS-PROTECTION.conf | DoS attack detection |
| REQUEST-913-SCANNER-DETECTION.conf | Security scanner detection |
| REQUEST-920-PROTOCOL-ENFORCEMENT.conf | HTTP protocol validation |
| REQUEST-921-PROTOCOL-ATTACK.conf | Protocol-level attacks |
| REQUEST-930-APPLICATION-ATTACK-LFI.conf | Local File Inclusion attacks |
| REQUEST-931-APPLICATION-ATTACK-RFI.conf | Remote File Inclusion attacks |
| REQUEST-932-APPLICATION-ATTACK-RCE.conf | Remote Command Execution |
| REQUEST-933-APPLICATION-ATTACK-PHP.conf | PHP injection attacks |
| REQUEST-934-APPLICATION-ATTACK-GENERIC.conf | Generic application attacks |
| REQUEST-941-APPLICATION-ATTACK-XSS.conf | Cross-Site Scripting (XSS) |
| REQUEST-942-APPLICATION-ATTACK-SQLI.conf | SQL Injection (SQLi) |
| REQUEST-943-APPLICATION-ATTACK-JAVA.conf | Java injection attacks |
| REQUEST-949-BLOCKING-EVALUATION.conf | Blocking decision based on anomaly score |
| RESPONSE-950-DATA-LEAKAGES.conf | Data leakage detection |
| RESPONSE-951-DATA-LEAKAGES-SQL.conf | SQL data leakage detection |
| RESPONSE-959-BLOCKING-EVALUATION.conf | Response blocking evaluation |
| RESPONSE-980-CORRELATION.conf | Correlation of multiple rules |
04 CloFixRule Syntax
CloFix CRS supports both standard CloFixRule directives and custom CloFixRule directives with the same powerful syntax.
CloFixRule [VARIABLES] "[OPERATOR] [PATTERN]" \
"id:[RULE_ID],\
phase:[1-4],\
t:[TRANSFORMATIONS],\
name:'[RULE_NAME]',\
msg:'[MESSAGE]',\
severity:'[CRITICAL|ERROR|WARNING|NOTICE|INFO]',\
tag:'[TAGS]',\
status:[HTTP_STATUS],\
[ACTION]"
# CloFixRule custom rule
CloFixRule ARGS|BODY "@rx (union.*select|insert.*into|drop.*table)" \
"id:1000001,\
phase:2,\
t:lowercase,\
t:urlDecode,\
name:'SQL Injection Protection',\
msg:'SQL injection attempt blocked',\
severity:'CRITICAL',\
tag:'clofix',\
tag:'attack-sqli',\
status:403,\
block"
# Standard OWASP CloFixRule (also supported)
CloFixRule ARGS|BODY "@rx
