How dndrmwn/modsecurity works
ModSecurity 2 is a web application firewall integrated with Apache, IIS, or its standalone server. Its main workflow accepts HTTP traffic, applies configured rules and request-body processing, then allows or intercepts the transaction and can produce audit logs. The tree also shows remote-rule, status-reporting, and audit-log-collector capabilities. Several integration and engine implementations were not sampled, so their connections are omitted or marked unverified rather than inferred as definite calls.
Main entry points: re_operators.c Rules and operators · modsecurity.c Transaction engine · api.c Standalone API · mymodule.cpp IIS module
Components 26
Server integrations
- Apache module
apache2/mod_security2.c - Standalone server
standalone/server.c - Standalone API
standalone/api.c - IIS module
iis/mymodule.cpp - IIS module factory
iis/mymodulefactory.h
Rule engine
- Transaction engine
apache2/modsecurity.c - Configuration
apache2/apache2_config.c - Rules and operators
apache2/re_operators.c - Rule transformations
apache2/re_tfns.c - Engine utilities
apache2/msc_util.c - Geolocation
apache2/msc_geo.c - Regular expressions
apache2/re.c - Cryptography
apache2/msc_crypt.c - Google Safe Browsing
apache2/msc_gsb.h - Pattern matching
apache2/acmp.c - Rule extensions
ext/mod_op_strstr.c
Request processing
- Request body handling
apache2/msc_reqbody.c - Body parsers
apache2/msc_parsers.c - Multipart parser
apache2/msc_multipart.c
Logging and operations
- Audit logging
apache2/msc_logging.c - Remote rules
apache2/msc_remote_rules.c - Status reporting
apache2/msc_status_engine.c - Persistent storage
apache2/persist_dbm.c
Audit log tools
- Audit log collector
mlogc/mlogc.c - Audit log parser
alp2/alp2_pp.c
Other components
- HTTP client
Connections 24
- HTTP client → Standalone server: sends requests
standalone/server.c - Standalone server → Standalone API: uses API
- Standalone API → Transaction engine: processes transactions
- IIS module → IIS module factory: registers factory
iis/mymodule.cpp - IIS module → Standalone API: uses API
iis/mymodule.cpp - Apache module → Transaction engine: dispatches requests
- Configuration → Transaction engine: configures
- Transaction engine → Rules and operators: evaluates rules
- Rules and operators → Rule transformations: applies transforms
- Rules and operators → Regular expressions: matches patterns
apache2/re_operators.c - Rules and operators → Geolocation: checks geolocation
apache2/re_operators.c - Rules and operators → Google Safe Browsing: checks reputation
apache2/re_operators.c - Rules and operators → Pattern matching: uses matching
apache2/re_operators.c - Rules and operators → Cryptography: uses cryptography
apache2/re_operators.c - Rules and operators → Engine utilities: uses utilities
apache2/re_operators.c - Transaction engine → Request body handling: handles bodies
- Request body handling → Body parsers: selects parsers
- Body parsers → Multipart parser: parses multipart
- Transaction engine → Audit logging: writes audit logs
- Transaction engine → Remote rules: loads rules
- Transaction engine → Persistent storage: stores state
- Transaction engine → Status reporting: reports status
- Audit log collector → Audit log parser: parses log entries
- Rules and operators → Rule extensions: registers extensions