Skip to content

[BUG] Parameters forwardedheaderstrustedips and forwardedheaderscustomname have weird behaviourΒ #274

@david-garcia-garcia

Description

@david-garcia-garcia

Describe the bug πŸ›

While working on #273 I found out that

      - "traefik.http.middlewares.bouncer-test.plugin.bouncer.forwardedheaderstrustedips=172.20.0.1/32"
      - "traefik.http.middlewares.bouncer-test.plugin.bouncer.forwardedheaderscustomname=X-Forwarded-For"

Does not behave as:

      - "traefik.http.middlewares.bouncer-test.plugin.bouncer.forwardedheaderstrustedips=0.0.0.0/8"
      - "traefik.http.middlewares.bouncer-test.plugin.bouncer.forwardedheaderscustomname=X-Forwarded-For"

My expectation is that they would. I am either not getting something, or the implementation we rely on (ip.GetRemoteIP) is weird.

When using 0.0.0.0/8 the forwardedheaderscustomname is actually ignored, and the remoteAddr is used always.

As I read it:

  • forwardedheaderstrustedips means "you can trust the contents of forwardedheaderscustomname when the remoteAddr - that is the real IP connecting to us - is in forwardedheaderstrustedips"

Expected behavior πŸ‘€

Not sure.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions