Log X-Forwarded-For for rpc #9397

issue gmaxwell opened this issue on December 21, 2016
  1. gmaxwell commented at 3:25 AM on December 21, 2016: contributor

    Our recommend config for remote use of RPC advise people to use stunnel. One consequence of this is the logs lose all information about where the connection came from. I believe stunnel sets x-forwarded-for (but haven't verified), if so we should log this information.

  2. fanquake added the label Docs and Output on Dec 21, 2016
  3. fanquake added the label RPC/REST/ZMQ on Dec 21, 2016
  4. laanwj commented at 8:33 AM on December 21, 2016: member

    Slight NACK.

    • I remember fun adventures with X-forwarded-for "IP spoofing" more than 10 years ago. This information can be inserted by anyone and set to anything, it should not be taken seriously.
    • I'm fairly sure stunnel doesn't set X-forwarded-for at all, see the TODO: https://www.stunnel.org/sdf_todo.html
    • Also stunnel is usually set up as a protocol-neutral tunnel, so it won't do anything in the sense of HTTP header manipulation

    I'd say the proper way to do logging w/ multiple tunnels is one of, or both:

    • Bind RPC on multple ports, give each tunnel its own destination address/port, log that
    • Use the RPC multi-account feature and give every tunnel user their own account.
  5. gmaxwell commented at 9:43 AM on December 23, 2016: contributor

    My suggestion would be to log the x-forwarded-for as additional information, like xff: <foo>. Not to replace the IP address. Just preserve additional information. But on the todo and protocol neutrality you've got me there.

    This feature suggestion was tendered on the basis of encountering someone who had their stunnel rpc port open to the internet and they were being DOS attacked via it, and had no idea it wasn't their own hosts... it was pre-auth.

  6. pinheadmz commented at 3:17 PM on April 6, 2023: member

    I think this issue can be closed as wont-fix. However, I think the only docs we have regarding stunnel are in the 0.12 release notes and were not sufficient for me trying to follow them (we could mention the stunnel conf file, firewall rules, etc -- not to mention @laanwj suggestions in the above comment).

  7. maflcko commented at 4:02 PM on April 13, 2023: member

    Closing for now due to lack of progress and direction. Pull requests with improvements are welcome, and it is possible to re-open this issue or create a new one if this feature is requested again.

  8. maflcko closed this on Apr 13, 2023

  9. bitcoin locked this on Apr 12, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me