Project

General

Profile

Actions

Feature #478

closed

XFF (X-Forwarded-For)

Added by Ignacio Sanchez over 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Target version:
Effort:
Difficulty:
Label:

Description

XFF support so that Suricata could be placed behind a reverse proxy which terminates the SSL and SNATs the HTTP connections to the web servers.

Currently, in this scenario Suricata sees all inbound HTTP connections as coming from the internal IP address of the reverse proxy. Therefore if an attack is detected, the reverse proxy IP address will be recorded as the attacker's IP. The http-log will also just display the reverse proxy IP.

Reverse proxies, when deployed in non transparent mode, typically insert the original client IP address into an HTTP header such as X-Forwarded-For.

Snort, since version 2.9.0 supports the extraction of this header (--enable_xff) and inserts it as a extrahdr record in the unified2 files.

Suggested features:

  • Insert into an extrahdr unified2 record the actual client IP address if it is present in the HTTP header of the HTTP request which triggered the alert. XFF feature and XFF header name could be configured via suricata's yaml configuration file.
  • Add client XFF IP address to the extended http-log (if XFF is configured via suricata's yaml configuration file).

Files

XFF_basic_extended-http-log.patch (885 Bytes) XFF_basic_extended-http-log.patch X-Forwarded-For (XFF) header Ignacio Sanchez, 06/13/2012 10:29 AM
log-httplog.c (26.9 KB) log-httplog.c Custom logging feature (patched log-httplog.c) Ignacio Sanchez, 07/05/2012 11:36 AM
0001-Custom-logging-feature-for-log-httplog.patch (18.3 KB) 0001-Custom-logging-feature-for-log-httplog.patch Custom logging feature patch #1 Ignacio Sanchez, 07/06/2012 05:50 AM
0002-SCMalloc-result-check-strncpy-replaced-by-strlcpy-im.patch (17 KB) 0002-SCMalloc-result-check-strncpy-replaced-by-strlcpy-im.patch Custom logging feature patch #2 (fixing Victor's comments) Ignacio Sanchez, 07/06/2012 05:50 AM
0003-XFF-support-for-alert-debuglog.patch (8.87 KB) 0003-XFF-support-for-alert-debuglog.patch XFF support for alert-debug Ignacio Sanchez, 08/07/2012 06:02 AM
0001-Custom-logging-feature-for-log-httplog_REBASED.patch (19.4 KB) 0001-Custom-logging-feature-for-log-httplog_REBASED.patch Custom logging feature for log-httplog (rebased) Ignacio Sanchez, 08/22/2012 10:53 AM
u2-test-patchv2.diff (20.7 KB) u2-test-patchv2.diff Ignacio Sanchez, 09/28/2012 08:32 AM

Related issues 2 (0 open2 closed)

Related to Suricata - Feature #38: Configuration for custom log format for HTTP logClosedEric Leblond01/02/2010Actions
Related to Suricata - Feature #530: Custom http loggingClosedIgnacio Sanchez08/23/2012Actions
Actions

Also available in: Atom PDF