Commit graph

6348 commits

Author SHA1 Message Date
a-palchikov ee6e2c85d8
AuditLog/grpc server data race (#6170)
* Avoid test flake by ensuring the gRPC server is shutdown gracefully before closing the audit log

* Fix lint warnings. Nove tunnel server's Close to earlier to close the proxy watcher and release grpc traffic

* Use graceful shutdown selectively until all tests have improved support for it

* Move session recorder clean up to session.Close

* Always use graceful shutdown for TLS.
2021-05-18 17:57:57 -07:00
Roman Tkachenko fc713b7216
Application and database access documentation updates (#6932) 2021-05-18 17:03:49 -07:00
Roman Tkachenko 0e5793456f
Bump e-ref (#6925) 2021-05-18 16:15:07 -07:00
Lisa Kim 059be55bb6
Add kube/db ui testing steps to test plan (#6926) 2021-05-18 15:25:37 -07:00
Andrew Lytvynov d3e1be2064 make update-vendor: run 'go mod tidy' in api/ 2021-05-18 21:56:02 +00:00
Andrej Tokarčík 60f7692353
Add CheckAndSetDefaults call to UnmarshalAuthPreference (#6898) 2021-05-18 12:23:10 -07:00
Roman Tkachenko 6be68ff055
Add missing database cli flags (#6739) 2021-05-18 11:10:16 -07:00
Joel 799702b43d
Update e ref to master (#6906) 2021-05-18 18:04:07 +02:00
Joel b68c519b4c
Implement RFD 19: Event Iteration API (#6731) 2021-05-18 16:46:01 +02:00
Marek Smoliński 99e82bb750
tsh: Return more descriptive error on unimplemented grpc server method (#6812) 2021-05-18 13:21:51 +02:00
Nic Klaassen be98566523
Fix typo in trusted clusters docs (#6904) 2021-05-17 17:35:33 -07:00
Gus Luxton 8767fb81f5
helm: Fixes for Linux/Mac interoperability (#6891) 2021-05-17 12:01:16 -07:00
Gus Luxton 91304f22db
Don't pull docsbox image if it's already present (#6228) 2021-05-17 11:43:22 -07:00
Lisa Kim f0fc07711f
Remove http.NoBody check for web renew token endpoint (#6893) 2021-05-17 11:19:05 -07:00
Andrej Tokarčík 17ff928381
RFD 21 (Cluster Routing): Mark as implemented (#6835)
The feature was introduced in Teleport 6.1.0.
2021-05-17 19:42:55 +02:00
Gus Luxton 925801440a
helm: Adds 'aws', 'gcp', 'standalone' and ‘custom’ modes to teleport-cluster chart (#6344) 2021-05-17 11:35:11 -03:00
Gus Luxton 906bfeb7d4
docs: Add Helm guides (#6390) 2021-05-17 10:38:13 -03:00
Trent Clarke 1d0dd975ce Update lib/client/api.go
Co-authored-by: Nic Klaassen <nic@goteleport.com>
2021-05-14 16:09:48 -07:00
Trent Clarke ea9627ee39 Review feedback 2021-05-14 16:09:48 -07:00
Trent Clarke b4c3b16d03 More review additions 2021-05-14 16:09:48 -07:00
Trent Clarke 03ae893846 Review feedback 2021-05-14 16:09:48 -07:00
Trent Clarke 47daff7c0b Doc fix 2021-05-14 16:09:48 -07:00
Trent Clarke eea8dde38e Addressing review feedback 2021-05-14 16:09:48 -07:00
Trent Clarke a6de1c202a Addressing review feedback 2021-05-14 16:09:48 -07:00
Trent Clarke 7fb9cb15f0 Address review feedback 2021-05-14 16:09:48 -07:00
Trent Clarke 17ffe33821 Adds concurrent default-port selection to tsh
Addresses issue #4924

If a default Web Proxy port is not specified by the user, either via
config or on the command line, `tsh` defaults to `3080`. Unfortunately
`3080` is often blocked by firewalls, leading to an unacceptably long
timeout for the user.

This change adds an RFC8305-like default-port selection algorithm,
that will try multiple ports on the supplied host concurrently and
select the most reponsive address to use for Web Proxy traffic. I
have included the standard HTTPS port (443) in the defaulut set,
and this can be easily expanded if other good candidates come along.

If the port selection fails for any reason, `tsh` reverts to the
legacy behaviour of picking `3080` automatically.
2021-05-14 16:09:48 -07:00
Steven Martin d867edadae
Add sudo to systemd example commands (#6603) 2021-05-14 06:37:54 -07:00
jane quin aee7523535
Add session_recording field to session start and end event (#6664) 2021-05-13 18:55:25 -07:00
Trent Clarke 4284fc3586
Forbids use of --insecure in FIPS mode (#6191)
Forbids the use of the `--insecure` mode when FIPS mode is enabled in teleport
Disables the `--insecure` tsh command line option when built with FIPS support

See-Also: #5073
2021-05-14 09:22:46 +10:00
Andrew Lytvynov 84a7230e6e
Move CheckAndSetDefaults definition to types.Resource (#6825)
All resources should implement it, reduce some code duplication in
interfaces.
2021-05-13 14:02:56 -07:00
Andrew Lytvynov 8922554f0d Revert TLS cert usage for database certs
Database service doesn't fully support the cert usage restrictions yet
so we need an unrestricted cert again.
2021-05-13 20:44:39 +00:00
Andrew Lytvynov e987caa292
client: set TLS certificate usage for k8s/app/db certs (#6824)
* client: set TLS certificate usage for k8s/app/db certs

--- TLS usage field

The certificate usage field prevents a certificate from being used for
other purposes. For example, a k8s-specific certificate will not be
accepted by a database service endpoint.

Server-side enforcement logic was already in place for a long time, but
we stopped setting the correct Usage in UserCertRequest during keystore
refactoring in 5.0 (with introduction of k8s certs).

--- TLS certificate overwrite

As part of this, client.ReissueUserCerts will no longer write
usage-restricted certificates into the top-level TLS certificate used
for Teleport API authentication.

For example, when generating a k8s-specific certificate, we used to
overwrite both:
- `~/.tsh/keys/$proxy/$user-x509.pem`
- `~/.tsh/keys/$proxy/$user-kube/$cluster/$kubeCluster-x509.pem`
This PR stops overwriting `~/.tsh/keys/$proxy/$user-x509.pem`.
This is not a breaking change.

--- Selected k8s cluster

Prior to this PR, `tsh status` printed the selected k8s cluster based on
the top-level TLS certificate. Since we no longer overwrite that
certificate, it will not contain a k8s cluster name.

Instead, we extract it from the kubeconfig, which is actually more
accurate since a user could switch to a different context out-of-band.

* Document UserCertRequest CertUsage enum values
2021-05-13 10:26:12 -07:00
Paul Schisa bbee1537d9
Update admin-guide.mdx Teleport Upgrade section for clarity around the 4.4.x to 5.x transition (#6841) (#6842)
Port of PR 6780 to master branch
2021-05-13 06:42:52 -07:00
Trent Clarke 540906768b
Making log lines proper sentences. (#6772) 2021-05-13 15:02:52 +10:00
Ben Arent 9eb97d7aba
YAML formatting (#5817) 2021-05-12 17:15:43 -05:00
Russell Jones 8ecae74768 Update CODEOWNERS 2021-05-12 11:51:44 -07:00
Russell Jones f879de6798 Update CODEOWNERS 2021-05-12 11:51:44 -07:00
Gus Luxton 94a28faaf2
Update locks.tf (#6798) 2021-05-12 11:35:49 -07:00
Steven Martin 0b2f39d86c
Gives inline info for Google Service account for SSO (#6728) 2021-05-12 09:52:18 -07:00
Andrew Lytvynov 3cfdc9b6f7
mfa: fix startup crash when SSO users with MFA expire (#6779)
The user loading code is kind of convoluted: it loads all the separate
backend items from the `/web/users/` prefix into a struct. That struct
is then converted to a full `types.User` object.

For each user there are 3 kinds of backend items:
- `/params` which is the main one, containing a marshalled `types.User`
  object
- `/pwd` which contains the hashed password for local users
- `/mfa/...` which contain registered MFA devices

When an SSO user expires, we delete the first two items but not
`/mfa/...`. This is intentional, to persist MFA devices across logins.
The user loading code would fail because the user was "found" (thanks to
MFA items), but didn't have the mandatory `/params` item.

This PR ignores any users that don't have `/params` instead of
hard-failing all `GetUsers` calls.
2021-05-12 09:00:36 -07:00
Andrew Lytvynov 7d662e531f
Generate MinClientVersion based on server Version (#6018)
Per
https://github.com/gravitational/teleport/blob/master/rfd/0012-teleport-versioning.md,
we only support one major version backwards.
2021-05-11 17:18:26 -07:00
Andrew Lytvynov bff7c322d0 docs: update merge-kubeconfigs.sh reference to master
The reference used a branch commit originally to pass docs CI tests (link reachability).
The file now exists on the `master` branch, so it can be linked.
2021-05-11 23:53:54 +00:00
jane quin 6c67067c6e
Emit session end event when completer finishes upload (#6756) 2021-05-11 12:58:12 -07:00
Joel Wejdenstal 363348d32d
Align atomics to prevent segmentation faults on ARMv7 (#6711)
align atomics
2021-05-10 20:31:38 +02:00
Nic Klaassen 82185f232a
Stop changing kube context by default on tsh login (#6721)
With this change `tsh login` will still always add teleport contexts and credentials to the kubeconfig, but will only update the current context if:
- `tsh login` is called with `--kube-cluster` set, or
- `tsh kube login <kube cluster>` is called.
2021-05-07 11:18:29 -07:00
Andrej Tokarčík ad00c6c789
Introduce ClusterNetworkingConfig extracting fields from ClusterConfig (#6638) 2021-05-07 13:54:08 +02:00
Brian Joerger f3a03e4391
Add GetNode endpoint. (#6539) 2021-05-06 18:22:41 -07:00
Trent Clarke 769b4b5eec
Implements RFD-0022 - OpenSSH-compatible Agent Forwarding (#6525)
Prior to this change, `tsh` will only ever forward the internal key
agent managed by `tsh` to a remote machine.

This change allows a user to specify that `tsh` should forward either
the `tsh`-internal keystore, or the system key agent at `$SSH_AUTH_SOCK`.

This change also brings the `-A` command-line option into line with
OpenSSH.

For more info refer to RFD-0022.

See-Also: #1571
2021-05-06 17:17:50 -07:00
Lisa Kim 1879807d3c Remove whitespace 2021-05-06 16:33:40 -07:00
Lisa Kim 3ad844c785 Add configure u2f for mfa test and add switchback test 2021-05-06 16:33:40 -07:00