Commit Graph
9230 Commits
Author SHA1 Message Date
Brian Joerger 4c0a6ff5b1 tsh PIV login integration (#15335)
* Add Yubikey PrivateKey implementation for use by Teleport clients.

  - Add yubikey login logic, reusing previously stored private keys.

  - Fix identity file decoding with PIV keys, which sign ecdsa certificates.

  - Add libpcsclite-dev pre-req for building on linux.

  - Remove unnecessary keys.Signer interface and move its functionality to keys.PrivateKey.

  - Move retry and jitter utils to new api/utils/retryutils package.
2022-09-23 19:44:10 +00:00
Tiago Silva 45c065acee Adds kube_cluster watcher for kubernetes service (#16281)
This PR presents a watcher for dynamic `kube_cluster` resources. The cluster credentials can be set using a `kubeconfig` whose payload is defined in `KubernertesClusterV3.Spec.Kubeconfig`. These credentials are used to connect to the Kubernetes API server and if invalid, the cluster is not served and returns an error.

Currently, `kube_cluster` resources created via the API with a kubeconfig payload can be dynamically served by the `kubernetes_service` by enabling dynamic resources.

```yaml
kubernetes_service:
   enabled: true

   resources:
       labels:
           '*': '*'
```

# Future work
- The discovery service will have to create these resources. 
- Support Azure and AWS dynamic authentication

Part of #16135, #13376  
Related to  #12048, #16276
2022-09-23 17:07:13 +00:00
Tiago Silva 4cdc4b6f60 Fix missing conversion from EventFields for kube_cluster events (#16677)
Fix missing conversion from EventFields for kube_cluster events introduced in #16276.
2022-09-23 16:13:36 +00:00
Hugo Shaka cfb2fb01b4 helm: support imagePullSecret in kube-agent chart in statefulset mode (#16508) 2022-09-23 15:24:50 +00:00
Hugo Shaka 1cf949e5c4 helm: add minReadySeconds to teleport-cluster chart (#16465)
Fixes #13129

This PR sets minReadySeconds to 15 by default. During a rollout we still have proxies that don't have tunnels to all agents, but at least agents don't end up with 0 active tunnels.
2022-09-23 14:20:03 +00:00
Zac Bergquist 903a816a65 Correctly set the end time when completing an upload (#16566)
The upload completer would set the session end time based on the last
known event in the session, but it left the timestamp in the event's
metadata blank, which caused it to default to the time the upload was
completed.

Fixes #16555
2022-09-23 13:33:40 +00:00
Krzysztof Skrzętnicki 684956a06c Elasticsearch audit log support (#16191) 2022-09-23 11:46:15 +00:00
Marek Smoliński cbfd90601d Fix flaky integration test: TestAppServersHA/RootServer (#16628) 2022-09-23 13:01:52 +02:00
Jakub Nyckowski d6485de3de Add HostKeyAlgorithms to ssh_config (#16618) 2022-09-23 05:30:28 +00:00
Brian JoergerandJakub Nyckowski 7d2bd715c4 Add piv build dependencies (#16424)
* Add piv build dependencies.

  - Add LIBPCSCLITE build tag.

  - Add libpcsclite static linking using gravitational/pcsc fork.

  - Enable use of dynamic pcsc library with LIBPCSCLITE=dynamic.

  - Refactor CGOFLAG in Makefile.

  - Update Centos7 Dockerfile and drone.

* Refactor RELEASE_MESSAGE for readability. Now produces message like: "RELEASE_MESSAGE=Building with GOOS=linux GOARCH=amd64 REPRODUCIBLE= and with PIV support and without PAM support, FIPS support, BPF support, Windows RDP client, libfido2, Touch ID."

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2022-09-22 23:16:51 +00:00
Alan Parra d3fd9342c1 Add a timeout for device cancels (#16575)
U2F devices, like Yubikey 4, don't seem to respect cancels, locking the program
if a different security key is chosen.

There isn't a clean way to cancel when Cancel() doesn't work, so I've added a
timeout to let the program complete. It's OK for the timeout to be short, it's
not tied to user interaction and by the time we get to it all cancels were
already issued.
2022-09-22 22:04:11 +00:00
Reed Loden 0d60cfaa5e ci: Add Dependency Review linting tool (#16640)
Use https://github.com/actions/dependency-review-action to scan all PRs for
out-of-date dependencies and for license enforcement.

https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
2022-09-22 21:40:57 +00:00
Paul Gottschling ae7b77c6db Edit the FAQ (#16629)
Indicate that Enhanced Session Recording is available for Teleport
Cloud.
2022-09-22 20:54:48 +00:00
Brian Joerger 2654add770 RequireMFAType (#16034)
Replace role/authPref RequireSessionMFA (bool) with RequireMFAType
(string).

  - Add new RequireMFAType constant values with custom boolean marshalling.

  - Add RequireMFAType to role and auth preference and deprecate
RequireSessionMFA.

  - Add session-mfa override login when hardware_key_touch is enforced.

  - Add protobuf enum for RequireMFAType.

  - Add support for proto enums in protoc-gen-crd and update Kubernetes
Operator manifests.
2022-09-22 20:30:32 +00:00
rosstimothy dcf6b07d07 Enforce max connection limits for label based tsh (#16241)
Label based tsh, `tsh ssh root@foo=bar uptime`, may potentially match
a number of nodes that exceeds the users `max_connections` limit.
However, tsh would blindly connect to all matching nodes and execute
the provided command simultaneously. This results in a number of
commands to fail because the user has too many concurrent sessions
open.

Now that #15641 has introduced running multiple commands inside
an `errgroup.Group` we can adjust the limit such that tsh will
never exceed the users `max_connections` limit. In order to
prevent label based tsh from consuming all of a users connections,
the `errgroup.Group` limit is set to half of `max_connections`.

Closes #4626
2022-09-22 19:52:08 +00:00
Edoardo Spadolini a47bbf2fac Clean up old cache directory (#16622) 2022-09-22 19:27:43 +00:00
c9fbcc03ad Document MsTeams access plugin (#15941)
Co-authored-by: alexfornuto <alex@fornuto.com>
Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2022-09-22 18:35:06 +00:00
Alan Parra fe3f9332ee Update WebAuthn and U2F dependencies (#16572)
Update `duo-labs/webauthn` up to `20220122034320`, which is the latest version
we can get without dipping into dependency hell (`etcd` and `opentelemetry` woes
ensue after [2365c59d9f][1]).

`tstranex` could be dropped for a while now (we moved on to WebAuthn-like
interfaces for mocks). `cfssl` was only imported due to what I assume was an
IDE mishap.

I've elected to keep `fxamacker/cbor`, instead of trying to move to
[webauthncbor][2]. fxamacker is solid, past v0, seems more appropriate for
client-side libs and still backs webauthncbor.

There are no updates for `flynn/hid` and `flynn/u2f`.

Release notes for fxamacker/cbor:
https://github.com/fxamacker/cbor/releases/tag/v2.4.0.

[1]: https://github.com/duo-labs/webauthn/commit/2365c59d9fb666cb5f5b6bbae86910632198a8d4
[2]: https://pkg.go.dev/github.com/duo-labs/webauthn@v0.0.0-20220815211337-00c9fb5711f5/protocol/webauthncbor

* Drop tstranex/u2f dependency
* Drop direct dependency to cloudflare/cfssl
* Update fxamacker/cbor/v2 to v2.4.0
* Update duo-labs/webauthn to 2022-01-22
* Fix: Make sure all credentials are set in the user
* Simplify: Drop now unnecessary AuthenticationSelection copy
2022-09-22 17:08:47 +00:00
rosstimothy b4317d4014 Update observability dependencies (#16497) 2022-09-22 12:59:30 +00:00
Gavin Frazar 7e9e077485 Use teleport client sitename for sql server local proxy tunnel db cert lookup instead of active profile (#16613) 2022-09-21 22:59:45 +00:00
Philippe M. Chiasson 2657be4c1d Fix backport bot flow (#16609)
The backport portion of the review bot assumes its current working directory is a checkout
of teleport's master branch (see https://github.com/gravitational/shared-workflows/blob/main/bot/internal/bot/backport.go#L178)

And since `go run` needs the cwd to be right, switching to go build && exec instead

Deprecates #16608
2022-09-21 21:27:01 +00:00
rosstimothy ebfbfd496e Use testauthority instead of native to generate keys in tests (#16486)
* use test authority

* use testauthority for InitConfig RSAKeyPairSource

* add named returns to test authority
2022-09-21 20:53:09 +00:00
Alan Parra 9bc7ba815a Remove HOTP mention from reference config (#16590)
HOTP is a leftover from olden times.
2022-09-21 20:14:48 +00:00
Zac Bergquist d133fe69c9 Speed up TestTerminalPing (#16481)
This test takes between 10-20 seconds to run, because it waits for
a websocket ping message and pings run on a 10s timer by default.

It turns out, we allow specifying the keepalive interval in the
terminal request, but due to a bug we would always overwrite that
value with what's in the cluster networking config.

Fix the bug and speed up the test by overriding the keepalive interval
to something shorter for this test.

Before:

    ➜ go test -run TestTerminalPing -race ./lib/web -count=1
    ok      github.com/gravitational/teleport/lib/web       13.122s

After:

    ➜ go test -run TestTerminalPing -race ./lib/web -count=1
    ok      github.com/gravitational/teleport/lib/web       3.394s
2022-09-21 19:51:59 +00:00
Steven Martin 2615d45888 Spell fixes docs (#16600) 2022-09-21 11:42:13 -07:00
Alan Parra 65e0116512 Remove HOTP support (#16579)
While looking up github.com/gokyle/hotp I found some old deprecation warnings
and decided to address them.

* Remove HOTP support
* Update comment on checkOTP
* Remove OTPType
* Remove a few more HOTP references
2022-09-21 17:50:33 +00:00
Alan Parra 8040f091fb Update OpenSSL to 1.1.1q (#16573)
libcrypto is required by libfido2.

All other libfido2 dependencies, including the lib itself, are up-to-date.

Release notes for OpenSSL:
https://github.com/openssl/openssl/blob/OpenSSL_1_1_1q/CHANGES.
2022-09-21 17:16:58 +00:00
Alan Parra 88134100cb Update golang.org/x/ dependencies (#16591)
Update golang.org/x/crypto, exp, mod, net, oauth2, sync, sys, term and tools to
the latest version.

golang.org/x/text is already at the latest version.

* Update golang.org/x/{mod,sync,sys,tools}
* Update golang.org/x/exp
* Update golang.org/x/oauth2
* Update golang.org/x/net
* Update golang.org/x/crypto
* Update golang.org/x/term
2022-09-21 16:51:30 +00:00
Paul Gottschling c423c08fd3 Refresh the Enterprise Getting Started guide (#15780)
* Refresh the Enterprise Getting Started guide

Fixes #14249

Edit the Enterprise Getting Started guide based on manual testing to
make the guide up to date and easier to follow.

- Update the architectural description in the introduction
- Structure the guide, following out Linux Server guide for open source
  installations, to include Application Access
- Add DNS instructions rather than using the `--insecure` flag
- Add copy-pastable installation instructions
- Flesh out the license file instructions and add a screenshot of the
  customer portal
- Simplify the instructions for adding a local user
- Remove the docker-compose instructions, since we want the user to
  finish setting up a minimal Teleport cluster by the end of the guide,
  and these instructions begin a new step-by-step sequence. We also have
  a separate docker-compose guide that users can follow for a local
  demo
- Add a "Next steps" section and move relevant content there

* Respond to PR feedback
2022-09-21 16:27:36 +00:00
Paul Gottschling 24498a04c9 Add a version support table to the FAQ (#15924)
* Add a version support table to the FAQ

Fixes #15582

List the minor Teleport versions we currently support, plus their
release dates and minimum `tsh` versions. This restores the table that
we removed in PR #12641. Unlike that table, this change does not
list versions that are EOL, as this is now quite a lengthy list.
Instead, this change makes it explicit that the table lists currently
supported versions.

* Respond to PR feedback

Add a note about cross-component version compatibility to the FAQ by
creating a partial from a similar compatibility note in our Upgrading
guide.
2022-09-21 16:15:46 +00:00
Michelle Bergquist f4ec8c33a2 add cluster alert links (#16426) 2022-09-21 15:49:54 +00:00
Łukasz Kozłowski 69197efb1d Add webapi endpoints for desktop access configuration 2022-09-21 14:52:10 +02:00
Łukasz Kozłowski ef65792247 Add PEM certificate support in desktop access config 2022-09-21 14:52:10 +02:00
Alex McGrath e2fab63ba9 Introduce discovery_service and automatically run an SSM Document on discovered EC2 nodes (#14094)
* Add initial version of installer

* Resolve comments

- Use aws waiters when checking commands
- Use SSMRunRequest rather than passing instances
- General comments

* Resolve comments, (rebase) pass scriptname parameter

This resolves comments regarding running on multiple ec2 instances at
once by adding state to the instances cache to check if the instance
is known about and how far into installation it is

* Revert cache

* Dont cache on non discovery nodes

* Resolve some comments

* Move discovery out to its own serviec

* Add a `discovery_service` section

* Fix messed up conflict merge

* Make starting a standalone discovery agent work

* Resolve comments

* Resolve comments

- use a regular events.Emitter
- resolve a thousand typos :)

* Resolve comments

* resolve comments, fix a bad merge

* Fail when a non ec2 matcher type is configured

* fix lint-go

* Resolve comments

* Resolve comments, add initial test (currently broken)

* Fix log string so only 1 pair of [] are used

* Chunk instances for sending commands

* add 'isInitialized' to watchers

* Add test for chunked discovery, log output

* lints

* explicetly set matcher.Tags to "*":"*" if its unset
2022-09-21 12:23:06 +00:00
Grzegorz Zdunek 399526cff2 Connect: Fix premature proxyClient.Close() when getting kube clusters (#16538) 2022-09-21 12:17:27 +02:00
Trent Clarke 7fb49ab840 Revert "Update Helm publishing Drone pipeline (#16542)" (#16583)
We are pushing bach the switch to the new Helm reposiotory, so this
needs to be rolled back and re-applied when the switch happens.

See-Also: #16582
2022-09-21 09:20:40 +02:00
Trent Clarke 23878cccc4 Update Helm publishing Drone pipeline (#16542)
The drone S3 uploader plugin requires more and/or different permissions than we allow the repository deploy user, and so won't work with the new repository.

This patch changes the promotion pipeline to use s3 sync instead.
2022-09-20 23:09:08 +00:00
Roman Tkachenko 9d04ee27c2 Fix CA pool loading for etcd backend (#16484) 2022-09-20 22:03:07 +00:00
Roman Tkachenko 60a98847bc [auto] Update AMI IDs for 10.2.2 (#16524) 2022-09-20 21:41:38 +00:00
Michelle Bergquist 3b914719e8 add status interface for cluster alerts (#16505) 2022-09-20 18:42:55 +00:00
Joel fbb23cf68c Implement RFD 82: Session Tracker Resource RBAC (#15760) 2022-09-20 15:38:48 +00:00
Paul Gottschling 0bf13f235f Update the docs issues contributing guide (#16529)
Remove the table of labels. We no longer use these, so this change
removes the table to ensure that instructions are up to date.
2022-09-20 15:06:11 +00:00
Philippe M. Chiasson bb59734edf Move GitHub review bot to shared-workflows repository (#16226)
* RFD 0029 : Move GitHub review bot to shared-workflows repository

Apart from relocating the code to a different location and renaming the package, this
is a no-op change

Depends-on: gravitational/shared-workflows#12

* remove mentions of the GitHub review bot from Makefile targets
2022-09-20 14:10:31 +00:00
rosstimothy 7e036cdf42 Generic retrieval of FnCache values (#16485)
Coverts getting values in the `FnCache` from `FnCache.Get` to
`utils.FnCacheGet[T any]`. This allows us to have compile time
guarantees for the type being loaded, which allows us to remove
some of the manual type checking required of callers today.
2022-09-20 12:36:03 +00:00
Justinas Stankevičius c4153b937e Register Windows native artifacts in release API (#16197)
* Register Windows native artifacts in release API

* Update relcli
2022-09-20 13:42:04 +03:00
a90334f48c azure mysql postgres auto discovery docs (#15986)
* Add screenshots for azure IAM setup

* Update azure mysql postgres guide to explain discovery

* Update db service config yaml reference

* Update docs/pages/database-access/guides/azure-postgres-mysql.mdx

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>

* Fix typo in admonition type

* Redact IDs in azure screenshots

* Clarify that role assignment applies to either principal type

* Advise restarting db service after checking credentials

* optimize images

* Update docs/pages/database-access/guides/azure-postgres-mysql.mdx

Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>

* Update docs/pages/database-access/guides/azure-postgres-mysql.mdx

Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>

* Update docs/pages/database-access/guides/azure-postgres-mysql.mdx

Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>
Co-authored-by: alexfornuto <alex@fornuto.com>
Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>
2022-09-20 05:24:32 +00:00
Roman Tkachenko d3cdc45ab2 Fix lint warnings (#16532) 2022-09-20 01:43:36 +00:00
Alan Parra a75fcc21d8 Update golangci-lint to 1.49.0 (#16507)
Update metalinter, fix a few lint warnings and replace deprecated linters.

`deadcode`, `structcheck` and `varcheck` are abandoned and now replaced by [`unused`][1].

Since 1.19, `go fmt` reformats godocs according to https://go.dev/doc/comment. I've done a bulk-reformatting of the codebase to keep the linter happy. Backporting is mostly harmless (the exception being `lib/services/role_test.go`, that for some reason breaks the _old_ linter using the new format).

[1]: https://golangci-lint.run/usage/linters/

* Bump golangci-lint version
* Replace abandoned linters
* Fix bodyclose on lib/auth/github.com
* Fix bodyclose on lib/kube/proxy/streamproto/proto_test.go
* Fix bodyclose on lib/srv/alpnproxy/proxy_test.go
* Fix bodyclose on lib/web/conn_upgrade_test.go
* Silence staticcheck on lib/kube/proxy/forwarder_test.go
* Silence staticcheck on lib/utils/certs_test.go
* Address BuildNameToCertificate deprecation warnings
* Run `go fmt ./...`
* Run `go fmt ./...` on api/
* Ignore formatting in role_test.go
* Remove redundant initializers in lib/srv/uacc/
* Update e/
2022-09-19 22:38:59 +00:00
rosstimothy 739e4e12b4 Update buf version (#16499) 2022-09-19 21:41:24 +00:00
rosstimothy 26126ba457 Update gRPC and Protobuf related dependencies (#16496) 2022-09-19 21:12:15 +00:00