Commit Graph
29 Commits
Author SHA1 Message Date
Brian Joerger b1d62883de Fix tctl not defaulting to local auth when no config provided (#20461) 2023-01-26 23:07:56 +00:00
Krzysztof Skrzętnicki 888e3db928 Add missing assignment of GCPServiceAccounts, lost in merge. (#20120) 2023-01-12 11:18:29 +00:00
Krzysztof Skrzętnicki e053cba973 GCP CLI support: tsh and tctl changes (#19790) 2023-01-11 16:33:38 +00:00
Brian Joerger 488af75797 Client store generalization (#19420)
- Add a generalized client store made up of a key, profile, and trusted certs store. Each sub store can support different backends (~/.tsh, identity_file, in-memory). 
- Replace custom identity file handling with in-memory client store.
- Fix issues with trusted certs handling.
2023-01-06 01:34:04 +00:00
Brian Joerger 32c4ae255f Add Credential loader support for tsh profiles. (#5993) 2021-03-23 16:35:42 -07:00
xacrimon d162b02060 implement rfd 18 2021-03-17 19:04:06 +01:00
Roman Tkachenko 81e1102250 Add MySQL support for database access (#5453) 2021-02-10 11:08:13 -08:00
Andrew Lytvynov 92ed2db38a Fixing golint warnings, batch 1
Mostly cosmetic changes:
- making receiver names consistent
- renaming `foo.FooBar` to `foo.Bar` (using package name as prefix)
- removing redundant `else` branches
- changing `a += 1` to `a++`
2020-10-13 00:22:49 +00:00
Forrest Marshall b2faac1d0d track current profile via regular file instead of symlink 2020-09-29 10:15:17 -07:00
Andrew Lytvynov b1eae4ac4c Remove unused functions and methods throughout lib/...
This code is not caught by linters because it's exported and they assume
there's some external users.
Since teleport is relatively self-contained, we can tell for sure
whether something is called or not.
2020-05-06 00:02:53 +00:00
Russell Jones 9c2cfa1cd8 Cleanup of dead code.
* Removed legacy backends no longer supported.
* Removed code marked for deletion.
* Updated Makefile to use $ instead of ` to match Enterprise.
2019-07-02 18:01:44 -07:00
Sasha Klizhentas 9d2a881f48 Break endless retry loop.
Previous Login code path was calling itself recursively.
In some cases that lead to endless loops with browser
opening up forever.

This commit factors out retry logic to RetryWithLogin
decorator handler that is used by CLI explicitly.

Client code became better as a result as there are no
hidden side effects.
2019-04-25 14:22:49 -07:00
Alexander Klizhentas 269706691c Use relevant SSHProxyAddr after Login (#2657)
Login could change the SSH proxy address based
on the information from "ping" endpoint

The function ConnectToProxy was saving
old version of the variable and kept using
it during login procedure.

This commit fixes that so the relevant
variable is always referenced.
2019-04-24 16:02:23 -07:00
Russell Jones f603bd1c5a Refactoring of SOCKS5 server. 2018-10-15 11:52:02 -07:00
Steven Aerts e1d896621f FIX 1693: SOCKS5 dynamic port forwarding
Implements the -D flag of ssh, but only with a SOCKS5 proxy.
OpenSSH also supports a SOCKS4 proxy.

This commit also fixes a bug in the server which prevented it from
forwarding raw IPv6 sockets, as the addresses were incorrectly
escaped.
2018-10-15 11:52:02 -07:00
Russell Jones 97074076cb Split public_addr into web_proxy_addr and ssh_proxy_addr. 2018-08-31 16:33:54 -07:00
Russell Jones 1439408b34 If the server has a public address set, use that as the address instead
of the one passed in by the user.
2018-08-31 16:33:54 -07:00
Sasha Klizhentas 1f3b4e2c96 Kubernetes configuration, fetch proxy settings.
This commit moves proxy kubernetes configuration
to a separate nested block to provide more fine
grained settings:

```yaml
auth:
  kubernetes_ca_cert_path: /tmp/custom-ca
proxy:
  enabled: yes
  kubernetes:
    enabled: yes
    public_addr: [custom.example.com:port]
    api_addr: kuberentes.example.com:443
    listen_addr: localhost:3026
```

1. Kubernetes config section is explicitly enabled
and disabled. It is disabled by default.

2. Public address in kubernetes section
is propagated to tsh profile

The other part of the commit updates Ping
endpoint to send proxy configuration back to
the client, including kubernetes public address
and ssh listen address.

Clients updates profile accordingly to configuration
received from the proxy.
2018-08-06 11:57:36 -07:00
Sasha Klizhentas e570b24eeb Update tsh login to select clusters.
The following changes have been introduced
to tsh login behavior:

1. tsh login now accepts cluster name
as an optional positional argument:

$ tsh login clustername

2. If tsh login is called without arguments
and the current credentials are valid,
tsh login now prints status, previous behavior
always forced login:

$ tsh login
... print status if logged in...

2. If tsh login is called with the proxy
equal to current, tsh login selects cluster,
otherwise it will re-login to another proxy:

$ tsh login one
... selected cluster one

$ tsh login two
... selected cluster two

$ tsh login --proxy=example.com three
... selected cluster three because
proxy is the same

$ tsh login --proxy=acme.example.com four
...will switch to proxy acme.example.com
and cluster four
2018-06-25 18:28:46 -07:00
Sasha Klizhentas 5d9113de59 Populate tsh profile after ad-hoc login.
If user has not logged in yet, and runs

tsh --proxy=example.com ls

Teleport launches ad-hoc login screen, however
because tsh did not write profile, username
and proxy were lost, so any next execution

tsh --proxy=example.com ls

Will launch the same login screen and will
ask for proxy, what is not user-friendly.

This PR fixes it by saving profile after
ad-hoc login attempts.
2018-02-19 17:00:26 -08:00
Russell Jones 07e90d0ad6 LocalKeyAgent only loads keys for a user logged into a proxy. 2018-01-20 00:40:38 +00:00
Russell Jones 2590e716c3 Always read tsh profile. 2017-06-07 11:37:55 -07:00
Russell Jones ac1173bacd Fixes, refactoring, and tests for LocalKeyAgent.
* Updated LocalKeyAgent to load both certificate and private key into Teleport and system agent.
* Refactored LocalKeyAgent to consolidate key loading code.
* Added test coverage for LocalKeyAgent.
2017-02-09 18:27:10 -08:00
Ev Kontsevoy 4ec54dfdf0 Merge branch 'master' into ev/667 2017-01-30 16:55:58 -08:00
Ev Kontsevoy e988630783 tsh logout + tctl create
This commit closes #667

- `tsh logout` will now log you out of everything
- `tctl upsert` has been renamed to `tctl create`
2017-01-29 19:26:27 -08:00
Ev Kontsevoy a8889271c6 Finished polish of tsh login
This commit:

* Improves on the previous commit on better name resolution by the proxy
  (and fixes a bug introduced by the previous commit)

* Removes 'host_login' from tsh client profile. Closes #729
2017-01-29 17:52:42 -08:00
Ev Kontsevoy c40c0139df Removed automatic profile saving on every successful session
Now, profiles are created when you explicitly type `tsh login`
2016-12-14 16:47:35 -08:00
Ev Kontsevoy fba70be1e2 PR comments implemented. 2016-10-23 11:32:48 -07:00
Ev Kontsevoy 7964bfc54e Client profiles for TSH 2016-10-22 12:54:16 -07:00