|
| 1 | + |
| 2 | + |
| 3 | +#include <ctype.h> |
| 4 | + |
| 5 | +#include <modsecurity/modsecurity.h> |
| 6 | +#include <modsecurity/rules.h> |
| 7 | +#include <modsecurity/intervention.h> |
| 8 | + |
| 9 | +#include "apr_buckets.h" |
| 10 | +#include "apr_general.h" |
| 11 | +#include "apr.h" |
| 12 | +#include "apr_hash.h" |
| 13 | +#include "apr_lib.h" |
| 14 | +#include "apr_strings.h" |
| 15 | +#define APR_WANT_STRFUNC |
| 16 | +#include "apr_want.h" |
| 17 | +#include "util_filter.h" |
| 18 | + |
| 19 | +#include "httpd.h" |
| 20 | +#include "http_config.h" |
| 21 | +#include "http_connection.h" |
| 22 | +#include "http_core.h" |
| 23 | +#include "http_log.h" |
| 24 | +#include "http_protocol.h" |
| 25 | +#include "http_request.h" |
| 26 | + |
| 27 | +#include "msc_filters.h" |
| 28 | + |
| 29 | +#ifndef _SRC_APACHE_HTTP_MODSECURITY__ |
| 30 | +#define _SRC_APACHE_HTTP_MODSECURITY__ |
| 31 | + |
| 32 | +#define NOTE_MSR "modsecurity3-tx-context" |
| 33 | +#define MSC_APACHE_CONNECTOR "ModSecurity-Apache v0.1.1-beta" |
| 34 | +#define REQUEST_EARLY |
| 35 | + |
| 36 | +extern module AP_MODULE_DECLARE_DATA security3_module; |
| 37 | +extern const command_rec module_directives[]; |
| 38 | + |
| 39 | +int msc_apache_init(apr_pool_t *pool); |
| 40 | +int msc_apache_cleanup(); |
| 41 | +static apr_status_t msc_module_cleanup(void *data); |
| 42 | + |
| 43 | +static int msc_hook_pre_config(apr_pool_t *mp, apr_pool_t *mp_log, |
| 44 | + apr_pool_t *mp_temp); |
| 45 | +static int msc_hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, |
| 46 | + apr_pool_t *mp_temp, server_rec *s); |
| 47 | +static void msc_register_hooks(apr_pool_t *pool); |
| 48 | + |
| 49 | +void *msc_hook_create_config_directory(apr_pool_t *mp, char *path); |
| 50 | +static void *msc_hook_merge_config_directory(apr_pool_t *mp, void *parent, |
| 51 | + void *child); |
| 52 | + |
| 53 | +static int hook_request_early(request_rec *r); |
| 54 | + |
| 55 | +typedef struct |
| 56 | +{ |
| 57 | + ModSecurity *modsec; |
| 58 | + request_rec *r; |
| 59 | + Transaction *t; |
| 60 | +} msc_t; |
| 61 | + |
| 62 | + |
| 63 | +typedef struct |
| 64 | +{ |
| 65 | + Rules *rules_set; |
| 66 | + int msc_state; |
| 67 | + char *name_for_debug; |
| 68 | +} msc_conf_t; |
| 69 | + |
| 70 | + |
| 71 | +extern msc_t *msc_apache; |
| 72 | + |
| 73 | + |
| 74 | +#endif /* _SRC_APACHE_HTTP_MODSECURITY__ */ |
0 commit comments