webhook icon indicating copy to clipboard operation
webhook copied to clipboard

The whitelist cannot use X-forwarded-for or X-real-ip to identify whether a user is on the whitelist.

Open vimers01 opened this issue 4 years ago • 4 comments

How to use the http header X-forword-for or X-real-ip for white names to identify the whitelist, otherwise, when there is a proxy server nginx in front of my webhook, the whitelist cannot identify the real user IP .

vimers01 avatar Jan 31 '21 03:01 vimers01

webhook doesn't currently support that. You'll have to do your filtering in nginx for now.

moorereason avatar Jan 31 '21 21:01 moorereason

Proposed Solution

Add a new cidr match type and deprecate the ip-whitelist match type.

"match":
{
  "type": "cidr",
  "value": "1.2.3.0/24",
  "parameter":
  {
    "source": "request",
    "name": "remote-addr"
  }
}
"match":
{
  "type": "cidr",
  "value": "2001:db8::/32",
  "parameter":
  {
    "source": "header",
    "name": "X-forwarded-for"
  }
}

moorereason avatar Jan 31 '21 22:01 moorereason

Change another method to achieve the whitelist, thank you very much!

vimers01 avatar Feb 01 '21 09:02 vimers01

I also encountered this issue. Has the new version already fixed it?

0x5c0f avatar Feb 22 '24 07:02 0x5c0f