Skip to content

Instantly share code, notes, and snippets.

View aderumier's full-sized avatar

alexandre derumier aderumier

View GitHub Profile
@winzig
winzig / ClientIP.cs
Last active June 26, 2021 17:54
If you're using a load balancer that obscures the remote client's true IP address, you can run this IHttpModule to take the first IP address from the X-Forwarded-For header, and overwrite the REMOTE_ADDR and REMOTE_HOST server variables. (We tried to use the URL Rewrite module that everyone normally recommends to do this, but it's buggy.)
using System;
using System.Web;
using System.Text.RegularExpressions;
namespace HttpModules
{
/// <summary>
/// This module handles complications from our load balancer configuration not properly passing the client's true IP
/// address to our code via the REMOTE_ADDR and REMOTE_HOST variables. We tried to use URL Rewrite to compensate for
/// this, but it does not run when default documents are being accessed (a longstanding bug).
@regit
regit / Suricata dashboard
Last active August 29, 2020 20:41
A sample Kibana dashboard using Suricata JSON output.
{
"title": "Suricata EVE Dashboard",
"services": {
"query": {
"list": {
"0": {
"query": "event_type:http",
"alias": "HTTP",
"color": "#7EB26D",
"id": 0,