Skip to content

Usage intructions for x-forwarded-for http header #771

Closed
@ohardy

Description

@ohardy

Hi,

Just a question because it's not clear for me.

Imagine that we have a load balancer with IP 10.0.0.10.
A kubernetes pod 10.0.0.20.

A client with an ip address 1.2.3.4 will connect to the LB that will redirect the traffic to the kubernetes pod.
The LB will add an header x-forwarded-for:10.0.0.10

The result ECS log:

{
  "client": {
    "address": "LB IP ? x-forwarded-for ip ?",
    "bytes": 1687,
    "ip": "LB IP ? x-forwarded-for ip ?",
    "port": 56910
  },
  "source": {
    "address": "LB IP ? x-forwarded-for ip ?",
    "bytes": 1687,
    "ip": "LB IP ? x-forwarded-for ip ?",
    "port": 56910,
    "nat": {
      "ip": "LB IP ? x-forwarded-for ip ?",
    }
  },
  "destination": {
    "domain": "example.com",
    "bytes": 691404,
    "address": "10.0.0.20",
    "ip": "10.0.0.20",
    "port": 51501
  },
  "network": {
    "ip": "10.0.0.20",
    "port": 51501,
    "forwarded_ip": "LB IP ? x-forwarded-for ip ?",
    "protocol": "http",
    "transport": "tcp",
    "type": "ipv4",
    "direction": "inbound",
    "bytes": 693091
  },
  ...other_fields
}

Thanks,
Olivier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions