-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listen only localhost by default #2387
Comments
Thanks for the feedback, and yes, our current thinking is that we'll cut over to listening on localhost only by default for our 2.0 release, though there are a few details to work out around making sure it's easy for users who want the current behavior to still get it. Stay tuned. |
Update: as mentioned, we plan on changing the default to Users who specifically want to expose TensorBoard (e.g. in a lab context to let other users access the instance) can either pass Strictly speaking the default behavior is actually to attempt to bind to Since the existing behavior can't be achieved by specifying either This change should mostly resolve the following issues:
|
Summary: Prior to this change, TensorBoard would default to serving on the entire local network; now, TensorBoard serves to the local machine only, and the flag `--host='*'` can be used to dual-bind to IPv4 and IPv6 on the entire local network (the previous default). See #2387 and comments therein for details. Test Plan: On my Debian machine, running with `strace -e trace=%network`, and testing connection with `curl -4 localhost:6006/data/logdir` (or `-6`): - running with no `--host` flag, or `--host=localhost`: - can connect to loopback on IPv4 only - cannot connect over LAN - `strace` shows binding on `AF_INET` - running with `--host='::1'`: - can connect to loopback on IPv6 only - cannot connect over LAN - `strace` shows binding on `AF_INET6` - running with `--host=0.0.0.0`: - can connect to loopback on IPv4 only - **can** connect over LAN - `strace` shows binding on `AF_INET` - running with `--host='*'`: - can connect on both IPv4 and IPv6 - **can** connect over LAN - `strace` shows binding on `AF_INET6` with an additional syscall to `setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4)` to facilitate the dual-binding, which is not present in any other tested case wchargin-branch: localhost-only
Summary: Prior to this change, TensorBoard would default to serving on the entire local network; now, TensorBoard serves to the local machine only, and the flag `--bind_all` can be used to dual-bind to IPv4 and IPv6 on the entire local network (the previous default). See #2387 and comments therein for details. Test Plan: On my Debian machine, running with `strace -e trace=%network`: - running with no `--host` flag: - can connect to loopback on IPv4 only - cannot connect over LAN - `strace` shows binding on `AF_INET` - a notice about `--bind_all` is printed to stderr - running with `--host=localhost`: - same behavior as with no `--host` flag, but no notice is printed - running with `--host='::1'`: - can connect to loopback on IPv6 only - cannot connect over LAN - `strace` shows binding on `AF_INET6` - running with `--host=0.0.0.0`: - can connect to loopback on IPv4 only - **can** connect over LAN - `strace` shows binding on `AF_INET` - running with `--host='::0'`: - can connect on both IPv4 and IPv6 - **can** connect over LAN - `strace` shows binding on `AF_INET6` - running with `--bind_all`: - can connect on both IPv4 and IPv6 - **can** connect over LAN - `strace` shows binding on `AF_INET6` with an additional syscall to `setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4)` to facilitate the dual-binding, which is not present in any other tested case In all cases, the printed serving URL (“TensorBoard x.y.z running at…”) bears the exact `--host` flag, or my full hostname if `--bind_all` was given, or `localhost` if neither was given. In all cases, the URL is a clickable link in my `gnome-terminal`. Note that on my system dual binding to `::0` works without an explicit syscall—i.e., `IPV6_V6ONLY` defaults to `0`—but this is not portable. Connection testing was performed via ```shell for ipv in 4 6; do if curl -sfL -"${ipv}" localhost:6006/data/logdir >/dev/null; then printf 'v%d OK\n' "${ipv}" else printf 'v%d FAIL\n' "${ipv}" fi done ``` in all cases. wchargin-branch: localhost-only
Fixed by #2589, which will be in TensorBoard 2.0.0. |
Thanks. |
By default tensorbord listens all interfaces, which may be a security issue. IMHO by default it should listen only on localhost, and if one uses it on a server, he usually configures the stuff, so it is not an issue for him.
The text was updated successfully, but these errors were encountered: