-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Hi all,
I face a problem passing client's IP from reverse proxy to modsecurity. Scoreboard info always shows c->client_ip instead of r->useragent_ip. Diving into source there isn't any way to change modsecurity to fetch r->useragent_ip. Function's parameter is only conn_rec.
I tried to set using mod_remoteip IP variable to c->notes table, and fetching it inside mod_security2.c, but with no success.
I have to comment the whole function because we don't need any information about global scoreboards, etc.
--- modsecurity-2.8.0/apache2/mod_security2.c 2014-10-03 08:11:43.960123305 +0000
+++ modsecurity-2.8.0/apache2/mod_security2.c 2014-10-03 08:12:20.293007633 +0000
@@ -1373,8 +1373,7 @@ static int hook_connection_early(conn_re
char *error_msg;
worker_score *ws_record = NULL;
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 2
- ap_sb_handle_t *sbh = NULL;
- char *client_ip = conn->client_ip;
+ return DECLINED;
#else
char *client_ip = conn->remote_ip;
#endif
Metadata
Metadata
Assignees
Labels
No labels