--- /dev/null
+Test eve/alert/xff/forward/extra-data output.
+
+## PCAP origin
+
+https://redmine.openinfosecfoundation.org/attachments/1424/xff-extradata.pcap
+
+### Request Headers
+
+GET /~sgtatham/putty/0.60/x86/pscp.exe HTTP/1.1
+User-Agent: Wget/1.17.1 (linux-gnu)
+Accept: */*
+Accept-Encoding: identity
+Host: the.earth.li
+Connection: Keep-Alive
+X-Forwarded-For: 10.1.23.250, 10.1.23.250
+
+### Response Headers
+
+HTTP/1.1 200 OK
+Date: Wed, 27 Sep 2017 18:58:30 GMT
+Server: Apache
+Last-Modified: Sun, 29 Apr 2007 13:02:37 GMT
+ETag: "48000-42f3ffb92f540"
+Accept-Ranges: bytes
+Content-Length: 294912
+Keep-Alive: timeout=5, max=100
+Connection: Keep-Alive
+Content-Type: application/x-msdos-program
--- /dev/null
+%YAML 1.1
+---
+
+include: ../../etc/suricata-4.0.3.yaml
+
+outputs:
+ - eve-log:
+ enabled: yes
+ types:
+ - alert:
+ metadata: no
+ xff:
+ enabled: yes
+ mode: extra-data
+ deployment: forward
--- /dev/null
+alert http any any -> any any (msg:"TEST RULE"; content:"uid"; http_server_body; sid:1; rev:1;)
--- /dev/null
+args:
+ - -k none
+
+checks:
+ - filter:
+ count: 1
+ match:
+ xff: 10.2.2.2
+
--- /dev/null
+Test eve/alert/xff/forward/overwrite output.
+
+## PCAP origin
+
+https://redmine.openinfosecfoundation.org/attachments/1424/xff-extradata.pcap
+
+### Request Headers
+
+GET /~sgtatham/putty/0.60/x86/pscp.exe HTTP/1.1
+User-Agent: Wget/1.17.1 (linux-gnu)
+Accept: */*
+Accept-Encoding: identity
+Host: the.earth.li
+Connection: Keep-Alive
+X-Forwarded-For: 10.1.23.250, 10.1.23.250
+
+### Response Headers
+
+HTTP/1.1 200 OK
+Date: Wed, 27 Sep 2017 18:58:30 GMT
+Server: Apache
+Last-Modified: Sun, 29 Apr 2007 13:02:37 GMT
+ETag: "48000-42f3ffb92f540"
+Accept-Ranges: bytes
+Content-Length: 294912
+Keep-Alive: timeout=5, max=100
+Connection: Keep-Alive
+Content-Type: application/x-msdos-program
--- /dev/null
+%YAML 1.1
+---
+
+include: ../../etc/suricata-4.0.3.yaml
+
+outputs:
+ - eve-log:
+ enabled: yes
+ types:
+ - alert:
+ metadata: no
+ xff:
+ enabled: yes
+ mode: overwrite
+ deployment: forward
--- /dev/null
+alert http any any -> any any (msg:"TEST RULE"; content:"uid"; http_server_body; sid:1; rev:1;)
--- /dev/null
+args:
+ - -k none
+
+checks:
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ dest_ip: 10.2.2.2
--- /dev/null
+Test eve/alert/xff/reverse/extra-data output.
+
+## PCAP origin
+
+https://redmine.openinfosecfoundation.org/attachments/1424/xff-extradata.pcap
+
+### Request Headers
+
+GET /~sgtatham/putty/0.60/x86/pscp.exe HTTP/1.1
+User-Agent: Wget/1.17.1 (linux-gnu)
+Accept: */*
+Accept-Encoding: identity
+Host: the.earth.li
+Connection: Keep-Alive
+X-Forwarded-For: 10.1.23.250, 10.1.23.250
+
+### Response Headers
+
+HTTP/1.1 200 OK
+Date: Wed, 27 Sep 2017 18:58:30 GMT
+Server: Apache
+Last-Modified: Sun, 29 Apr 2007 13:02:37 GMT
+ETag: "48000-42f3ffb92f540"
+Accept-Ranges: bytes
+Content-Length: 294912
+Keep-Alive: timeout=5, max=100
+Connection: Keep-Alive
+Content-Type: application/x-msdos-program
--- /dev/null
+%YAML 1.1
+---
+
+include: ../../etc/suricata-4.0.3.yaml
+
+outputs:
+ - eve-log:
+ enabled: yes
+ types:
+ - alert:
+ metadata: no
+ xff:
+ enabled: yes
+ mode: extra-data
+ deployment: reverse
--- /dev/null
+alert http any any -> any any (msg:"TEST RULE"; content:"uid"; http_server_body; sid:1; rev:1;)
--- /dev/null
+args:
+ - -k none
+
+checks:
+ - filter:
+ count: 1
+ match:
+ xff: 10.3.3.3
+
--- /dev/null
+Test eve/alert/xff/reverse/overwrite output.
+
+## PCAP origin
+
+https://redmine.openinfosecfoundation.org/attachments/1424/xff-extradata.pcap
+
+### Request Headers
+
+GET /~sgtatham/putty/0.60/x86/pscp.exe HTTP/1.1
+User-Agent: Wget/1.17.1 (linux-gnu)
+Accept: */*
+Accept-Encoding: identity
+Host: the.earth.li
+Connection: Keep-Alive
+X-Forwarded-For: 10.1.23.250, 10.1.23.250
+
+### Response Headers
+
+HTTP/1.1 200 OK
+Date: Wed, 27 Sep 2017 18:58:30 GMT
+Server: Apache
+Last-Modified: Sun, 29 Apr 2007 13:02:37 GMT
+ETag: "48000-42f3ffb92f540"
+Accept-Ranges: bytes
+Content-Length: 294912
+Keep-Alive: timeout=5, max=100
+Connection: Keep-Alive
+Content-Type: application/x-msdos-program
--- /dev/null
+%YAML 1.1
+---
+
+include: ../../etc/suricata-4.0.3.yaml
+
+outputs:
+ - eve-log:
+ enabled: yes
+ types:
+ - alert:
+ metadata: no
+ xff:
+ enabled: yes
+ mode: overwrite
+ deployment: reverse
--- /dev/null
+alert http any any -> any any (msg:"TEST RULE"; content:"uid"; http_server_body; sid:1; rev:1;)
--- /dev/null
+args:
+ - -k none
+
+checks:
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ dest_ip: 10.3.3.3