Skip to content
Snippets Groups Projects
  1. Jul 01, 2022
    • Robert Edmonds's avatar
      Support haproxy PROXY v2 protocol on incoming UDP packets · 4c394545
      Robert Edmonds authored and Daniel Salzman's avatar Daniel Salzman committed
      This commit adds minimal support for the haproxy PROXY v2 protocol which
      is described at
      https://www.haproxy.org/download/2.5/doc/proxy-protocol.txt.
      
      Only the UDP-over-IPv4 and UDP-over-IPv6 PROXY v2 family/transports are
      supported, and only the original source address/port of the proxied
      client are recovered from the PROXY v2 payload. Only the PROXY command
      is supported.
      
      There is a hardcoded ACL check to verify that the query was sent from
      127.0.0.0/8 before PROXY v2 decapsulation is attempted. This prevents
      spoofing of the PROXY v2 header and avoids exposing the PROXY v2 parsing
      code to the Internet. This should probably be converted to a real ACL
      check that can be configured.
      
      If a proxied client address/port was successfully extracted from the
      PROXY v2 payload, the 'remote' field in the knotd_qdata_params_t
      structure will be updated to represent the address of the real (proxied)
      client. This way query modules (e.g. whoami) don't need to be updated to
      continue to produce correct source address dependent behavior. The
      address of the proxy that actually sent the proxied packet will be saved
      in a new 'proxy' field in knotd_qdata_params_t in case this value needs
      to be processed.
      
      The 'sdig' utility that comes with PowerDNS supports generating queries
      with a PROXY v2 header, which is in the 'pdns-tools' package on
      Debian/Ubuntu systems. Example command-line invocations:
      
       * sdig 127.0.0.1 53053 example.net a proxy 0 192.0.2.1:49153 198.51.100.1:53
      
       * sdig 127.0.0.1 53053 example.net a proxy 0 '[2001:db8::1]:49153' '[2001:db8::100:1]:53'
      4c394545
  2. Jun 29, 2022
  3. Jun 28, 2022
  4. Jun 27, 2022
  5. Jun 24, 2022
  6. Jun 22, 2022
  7. Jun 21, 2022