Teleport: Address of proxy host is not set correctly in output of 'teleport status' or SSH_SESSION_WEBPROXY_ADDR environment variable

Created on 16 Dec 2019  路  3Comments  路  Source: gravitational/teleport

What happened: When logging into a server via tsh and running teleport status, the proxy host address is not set correctly - it appears as <proxyhost>:3080 (which appears to be the default value) instead of example.gravitational.co:3080:

$ teleport status
User ID     : [email protected], logged in as root from 1.2.3.4 41152 3022
Cluster Name: example.gravitational.co
Host UUID   : b2a41144-77c5-41cc-9706-a957b4ee3dca
Session ID  : 732bd7eb-<redacted>
Session URL : https://<proxyhost>:3080/web/cluster/example.gravitational.co/node/b2a41144-77c5-41cc-9706-a957b4ee3dca/root/732bd7eb-<redacted>

This issue means that sharing the link to join the session with other users will not work as intended.

The SSH_SESSION_WEBPROXY_ADDR is also set incorrectly:

$ env | grep SSH_SESSION_WEBPROXY_ADDR
SSH_SESSION_WEBPROXY_ADDR=<proxyhost>:3080

The Teleport config file does specify the correct public_addr for the cluster:

teleport:
  log:
    output: stderr
    severity: DEBUG
  data_dir: /var/lib/teleport
  storage:
    type: dir

auth_service:
  enabled: true
  license_file: /var/lib/license/license.pem
  authentication:
    type: oidc
  public_addr: example.gravitational.co:3025
  cluster_name: example.gravitational.co

ssh_service:
  enabled: yes
  labels:
    environment: demo
    role: auth
  commands:
  - command:
    - uptime
    - -p
    name: uptime
    period: 1m
  - command:
    - uname
    - -r
    name: kernel
    period: 1h

proxy_service:
  enabled: true
  public_addr: example.gravitational.co:3080
  ssh_public_addr: example.gravitational.co:3023
  web_listen_addr: 0.0.0.0:3080
  listen_addr: 0.0.0.0:3023
  https_key_file: /var/lib/certs/privkey.pem
  https_cert_file: /var/lib/certs/fullchain.pem
  kubernetes:
    enabled: true
    listen_addr: 0.0.0.0:3026
    public_addr: example.gravitational.co:3026

What you expected to happen: Both the output of teleport status and the SSH_SESSION_WEBPROXY_ADDR environment variable should contain the correct hostname to access the proxy.

How to reproduce it (as minimally and precisely as possible): Set up a Teleport cluster using a similar config to that shown here, log into a host and see that that the output of teleport status is not set correctly.

Environment:

  • Teleport version (use teleport version): Teleport Enterprise v4.1.2git:v4.1.2-0-g7886df10 go1.12.1
  • Tsh version (use tsh version): Teleport v4.1.4 git:v4.1.4-0-gc487a75c go1.13.2
  • OS (e.g. from /etc/os-release): Fedora 30
bug c-ab c-m good-starter-issue qol-s

All 3 comments

Related to < proxyhost >

If you run teleport start with no configuration, an SSH session within this cluster will report a correct Session URL (the value is replaced with the proxy public address). However, if you run teleport start -c teleport.yaml (using a defined configuration file) the Session URL value includes the <proxyhost>:3080 value.

Also, if using Teleport Cloud the 3080 will probably need to be removed/changed since the Teleport Cloud runs off 443 vs 3080.

Was this page helpful?
0 / 5 - 0 ratings