Commit graph

10206 commits

Author SHA1 Message Date
Paul Gottschling 7d968a282b
Add Enterprise installation instructions (#19552)
This addresses some observations from @stevenGravy about a couple places
in the docs where Enterprise-specific installation steps are missing.

- Edit the Machine ID Getting Started guide: Use the `install-linux.mdx`
  partial for download instructions, since these include instructiosn
  for Enterprise users.

- Add Enterprise instructions to Helm guides that only include OSS
  installation instructions.
2022-12-21 22:15:54 +00:00
Krzysztof Skrzętnicki f8fa2b9be2
Bump gravitational/trace package version (#19390) 2022-12-21 22:02:25 +00:00
Jakub Nyckowski fcdde32955
Add BPF to the test plan (#19380)
Add BPF-related tests to the test plan.
2022-12-21 19:46:21 +00:00
rosstimothy 579a453db2
Allow custom trace exporter for tsh (#19405)
* Allow custom trace exporter for tsh

Trace forwarding via `tsh --trace` only works to date if Auth is
configured with the `tracing_service` enabled. In all other scenarios
the traces are still forwarded to Auth but are silently dropped.
This makes it difficult to capture valuable traces from customers
with latency issues as they are first required to setup a Telemetry
backend and enable tracing in their cluster.

A new `--trace-exporter` flag is added to `tsh` to make it possible
to direct traces from `tsh` to a file or local instance of jaeger
without hacing to modify their Teleport cluster. The url must follow
the same semantics as the config file equivalent.

One important caveat is that **only** the `tsh` spans will be captured.
Any corresponding `teleport` spans are exported acording to the
`tracing_service`. While this only paints half the picture, it is
still a good indicator of where `tsh` may be experiencing latency.

An example usage to send traces to local files:

```bash
tsh --trace --trace-exporter=file:///some/path/traces ssh user@foo
```
2022-12-21 18:40:52 +00:00
rosstimothy 28ea98151c
Remove deprecated RecordingProxy request (#19505)
RecordingProxy was replaced by ClusterDetails and can safely be
removed for v12.
2022-12-21 18:18:02 +00:00
Michael Wilson 26268b31fc
Make a few Teleport process functions public for Enterprise use. (#19490)
The `RegisterWithAuthServer` and `SetExpectedInstanceRole` functions have
been made public for use by the Teleport Enterprise server. Additionally, a
new config option to more "Ready" events before the Teleport instance is
considered Ready has been added so that enterprise features can add to this
list.
2022-12-21 17:57:10 +00:00
Jakub Nyckowski a2e3fd94a1
Fix TestExecLongCommand - cleanup unlink (#19540)
Disable the audit log for TestExecLongCommand to fix TempDir RemoveAll cleanup: error.
2022-12-21 17:30:12 +00:00
Jakub Nyckowski 5376f1a9aa
Remove test keys (#19507)
A few of our tests that run certificate rotation fail with an error similar to this:

```
can only switch to phase update_clients from init, the current phase is
```

This happens when a duplicated private key is returned and set as a new key during CA rotation. During the CA rotation, we look for duplicated keys 962e5a25bc/lib/auth/rotate.go (L218) and try to rotate all of them at one. Because some of our tests use still use `testauthority` that only has 4 keys there is a huge chance that the same key will be returned twice, which causes the issue.
I swapped the logic to use a bigger pool with keys introduced in https://github.com/gravitational/teleport/pull/18750. I also removed the randomization part that, after some testing, I discovered was also causing some problems.

We could probably refactor the code in many tests now to make it simpler, but I want to keep this change as simple as possible. Otherwise, backporting bigger changes to older branches takes a long time.
2022-12-21 16:44:04 +00:00
Steven Martin 554dd023d5
Spell fix (#19569) 2022-12-21 16:21:11 +00:00
Michael 25e5a7a1c2
Update e ref (#19557) 2022-12-21 16:05:35 +00:00
Alan Parra f28319a6b8
Add user-visible device trust settings (#19531)
Add device trust settings to teleport.yaml and cluster_auth_preference resource.

Example configuration (teleport.yaml):

```yaml
auth_service:
  authentication:
    device_trust:
      mode: "required"  # requires Teleport Enterprise
```

gravitational/teleport.e#514
2022-12-21 15:24:12 +00:00
Alan Parra 5e3f5f4ec5
chore: Bump Go dependencies (#19528)
Keep up with latest releases.

Supersedes the following Dependabot PRs. See originals for detailed release
notes.

* https://github.com/gravitational/teleport/pull/19455
* https://github.com/gravitational/teleport/pull/19456
* https://github.com/gravitational/teleport/pull/19457
* https://github.com/gravitational/teleport/pull/19458
* https://github.com/gravitational/teleport/pull/19461
* https://github.com/gravitational/teleport/pull/19462
* https://github.com/gravitational/teleport/pull/19493
2022-12-21 15:00:23 +00:00
Paul Gottschling afa6077b1d
Remove Server Access Ansible guide redirect (#19532)
At one point, we had moved the Ansible Server Access guide to the
Machine ID section and added a redirect. Since we restored the Ansible
Server Access guide, the redirect is no longer correct.
2022-12-21 14:16:08 +00:00
Paul Gottschling 4dc1379424
Remove the Kubernetes CI/CD guide (#19529)
Closes #19198

The recommended approach is to use Machine ID for impersonated
kubeconfigs, and we already have a Machine ID guide for Kubernetes.
2022-12-21 13:58:02 +00:00
Paul Gottschling 6c9eb01dc2
Add a guide to deploying an HA cluster (#19217)
* Add a guide to deploying an HA cluster

Closes #16751

This is a general guide that prefaces our HA deployment guides.

Also adds an introduction to the "deploy-a-cluster" section.

* Respond to some PR feedback

- Add mentions of specific services (Auth and Proxy) where it would help
  with clarity.
- Edit port tables to remove ports that shouldn't be publicly exposed.
- Clarify the supported backends.
- Clarify that Let's Encrypt is not required for TLS credential
  management.

* Respond to more PR feedback

- Add context around DNS records
- Use "Layer 4" instead of "Layer Four"
- Explain optional ports more explicitly
- Fix spacing issues
- Indicate that you can use an S3-compatible object store
- Clarify cert-fetching behavior for applications
- Describe separate port configs depending on whether TLS Routing is
  enabled, and add a brief section re: whether to enable TLS Routing
- Expand the Teleport configuration section to accommodate TLS Routing
  and separate listeners

* Add more context to the "Deploy a Cluster" intro

* Small language tweaks

* Add an image

* Respond to zmb3 feedback

- Use "cluster state backend" and "session recording backend"
- Mention cross-zone load balancing
- Link to the Backends Reference instead of including example backend
  configurations
- Use v3 for example configs
- Fix example config indentation

* Add CTA for Teleport Cloud and forScopes
2022-12-21 13:46:16 +00:00
Marco André Dinis 69dc237fe2
DatabaseService resource: client and server CRUD (#19469)
* DatabaseService resource: client and server CRUD

In the context of Teleport Discover, we must be able to known if there's
any DatabaseService available to proxy a given Database resource.
If there's none available, we will offer a script for the user to run
and install a DatabaseService which proxies the desired Database
resource.

By DatabaseService, we mean the process that Teleport binary manages
when the `teleport.yaml` config has the following section:
```yaml
db_service:
  enabled: "yes"
```

To accomplish this we are creating a new resource: DatabaseService.
The UI will fetch all DatabaseServices and check if there's any
ResourceMatcher that matches the DatabaseLabels.

A previous PR created the DatabaseService resource.

This PR creates all the necessary CRUD operations:
- Add Service to manage DatabaseServices resources in the backend.
- Add GetAll, Upsert, Delete and DeleteAll operations to Client.
- Add DatabaseService support to ListResources.
- Add WebAPI endpoint to list DatabaseServices using ListResources.

The next PR will add the heartbeat mechanism to the DatabaseService
process.
2022-12-21 14:34:36 +01:00
Trent Clarke afd1fa7934
Adds a multiarch buildbox Dockerfile (#19509)
Currently only supports a minimal build of teleport on ARM32 and ARM64,
but the intent is to expand it until it becomes the single source of
truth for the linux buildboxes for all supported architectures.
2022-12-21 06:38:55 +00:00
Alan Parra 4237ad3cc7
Bump Buf to v1.11.0 (#19515)
Update Buf to the latest release. No formatting, linter, or codegen changes.

https://github.com/bufbuild/buf/releases/tag/v1.11.0
2022-12-20 22:42:27 +00:00
rosstimothy 69f672b014
Fix Flaky TestTerminalRouting tests (#19537)
* Fix Flaky TestTerminalRouting tests

Subtests that failed resolution result in the server closing the websocket
prior to the test closing the websocket on cleanup. Thus resulting in
`tls: failed to send closeNotify alert` errors. Failed subtests now
ensure that any errors returned from closing the websocket pass the
`utils.IsOKNetworkError` check.
2022-12-20 21:22:12 +00:00
Alan Parra 82e6fb9269
Wire device authentication into tsh (#19436)
Wire device authentication into `tsh`, so it attempts to acquire device
certificates after user login. This affects direct logins (`tsh login`),
indirect logins (RetryWithRelogin) and Connect.

If authentication fails (non-Enterprise cluster, device not enrolled, etc) `tsh`
proceeds as usual, but the final user certificate won't contain device
extensions.

gravitational/teleport.e#514
2022-12-20 20:53:45 +00:00
Michael 1b5bd9824d
[Connect] Add server hostnames in access request responses (#19258) 2022-12-20 14:33:47 -06:00
Paul Gottschling 9492589090
Describe enabling services in the config reference (#19440)
* Describe enabling services in the config reference

Closes #4214

Add a section to the configuration reference indicating which Teleport
services must be enabled/disabled explicitly so they run when Teleport
starts.

The configuration reference wasn't divided into H2s before this, so I
have organized the long Admonition that begins the section into H2s as
well.

* Respond to PR feedback

Co-authored-by: Steven Martin <steven@goteleport.com>
2022-12-20 14:35:57 -05:00
Isaiah Becker-Mayer 09aefe779b
Fixes noisy-square distortions 2022-12-20 10:21:54 -08:00
Isaiah Becker-Mayer e5d2b5a6c4
Clean up windows desktop access error logs on expected disconnects (#19389) 2022-12-20 17:25:25 +00:00
Rafał Cieślak 380b572152
Update Teleport Connect test plan (#17123)
Co-authored-by: Michael <michael.myers@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
2022-12-20 15:39:59 +00:00
Noah Stride 78549b88e6
GitHub Enterprise secure joining support (#19330)
* Add support for GHES joining

* Add tests for GHES ID Token validation

* Add test covering Auth server github join with GHES override

* Use correct ctx

* Name interface method parameters for clarity

* Use "scheme" instead of "proto"

* Improve docs, validation and add tests
2022-12-20 14:43:00 +00:00
Steven Martin 0caa880dc5
spell fixes (#19514) 2022-12-20 09:18:16 -05:00
rosstimothy c50ca6de5b
Fix web UI host resolution (#19435)
Web sessions were dialing with the sever hostname in cases where
the server UUID was known and should have been used which resulted
in #19415. All sessions launched via the "Connect" button from the
UI are guaranteed to use the server UUID. Manual connections via
the UI attempt find a matching host and use the UUID but may fallback
to using the hostname/ip instead if multiple matches are found.

When resolving servers by hostname or address `ListResources` is
now used directly to populate the `SearchKeywords` field to limit
the number of servers returned to only those fuzzily matching the
server. Prior to this **all** servers in the cluster were fetched
and filtered out by the web api.

The error displayed when ambiguous hosts are found has also been
improved from:

```shell
disconnected
err-node-is-ambiguous
```

to the following, which more closely mirrors the error returned by
`tsh`:

```shell
disconnected
error: ambiguous host could match multiple nodes

Hint: try addressing the node by unique id (ex: user@node-id)
```

Closes #19415
2022-12-20 13:32:28 +00:00
Trent Clarke 397d9005a5
Adds tooling to invoke a GitHub Actions Workflow (#19268)
In preparation for moving some builds from Drone to GHA, we need some
way for Drone to invoke a workflow in GHA and await the result. Handles
timeouts and workflow inputs as well.

Co-authored-by: Nic Klaassen <nic@goteleport.com>
Co-authored-by: Anton Miniailo <anton@goteleport.com>
2022-12-20 10:03:28 +00:00
Roman Tkachenko 91f7030900
Add workflows that build tools on Mac OS and Windows (#19226)
Signed-off-by: Roman Tkachenko <roman@goteleport.com>
Co-authored-by: Victor Sokolov <gzigzigzeo@gmail.com>
2022-12-20 05:25:56 +00:00
Jakub Nyckowski b4e1d5d7ae
Set OOM score to 0 for child processes (#19383)
* Set OOM score to 0 for child processes

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-12-20 02:50:27 +00:00
Paul Gottschling 78a2de9497
Add a guide to exporting events to Splunk (#17405)
* Add a guide to exporting events to Splunk

Closes #13158

Since there are multiple guides to exporting audit events now, this also
adds a new section of the docs for these guides.

Also fixes a tiny error in the Elastic Stack guide.

* Respond to PR feedback

* Fix linter issues

* Respond to PR feedback

- Use consistent naming
- Mention the `--ttl` flag for `tctl auth sign`
- Mention Machine ID
- Add a quick Troubleshooting section
- Fix `chmod` command
- Add systemd configs (also added this to the Elastic Stack Event
  Handler guide. I didn't do this to the Fluentd guide because the
  structure of the guide is different from the Splunk guide's).
2022-12-19 22:09:58 +00:00
STeve (Xin) Huang b9a1f77027
Return the actual IAM errors when configure database IAM policy fails (#19282) 2022-12-19 21:37:09 +00:00
rosstimothy 6ed5185e35
Prevent "session.start" from being overwritten by "session.exec" (#19450)
* Prevent "session.start" from being overwritten by "session.exec"

The `session.exec` event was not being passed through the session
recorder, which resulted in said event having an event index of 0.
This caused the original `session.start` event which also has an
`eid` of 0 to be overwritten by the `session.exec` event.

By emitting the `session.exec` event via the same mechanism as the
`session.start` event it gets a proper event index and no longer
overwrites the `session.start`.

Closes #13622
2022-12-19 20:25:40 +00:00
Tobiasz Heller f6f6ebb005
Bring back coreos/pkg indirect (#19491) 2022-12-19 20:46:28 +01:00
Russell Jones f44b36ada6 Added "Robustness" section to test plan.
Added "Robustness" section to test plan that tests connectivity without
access to Auth Server.
2022-12-19 11:26:39 -08:00
Brian Joerger c3a41a41fc
Address deprecation TODOs (#18992) 2022-12-19 19:08:45 +00:00
Tobiasz Heller 77e10d6ff0
Replace deprecated duo-labs/webauthn with go-webauthn/webauthn (#19476) 2022-12-19 18:07:30 +00:00
Jakub Nyckowski fc42dbb8df
Fix casting on 32 bits (#19481)
Fix for the 32bits arch introduced by this change: https://github.com/gravitational/teleport/pull/19406/files#diff-a3a7eaca752e77262c79c696fd2e46062cd411b204295927dde865d1638c539c
2022-12-19 16:42:54 +00:00
Marco André Dinis ce7ac3d621
DatabaseService: fix ResourceMatcher field (#19475)
In a previous PR (#19363) we created a new resource type:
DatabaseService

Its only spec property for now is the ResourceMatcher field
This field should mirror what we offer in the configuration within
`db_service.resurces` from `teleport.yaml`.

Even though, the current implementation of
`types.DatabaseService.ResourceMatchers` is convertible to/from
`services.ResourceMatchers` - because its only field (from the latter)
is a list of labels - we would incur in breaking changes later on if the
`services.ResourceMatchers` got new fields.

This new resource is only in master (not yet released) and the backport
to v11 must include this change to prevent a breaking change from
happening in the future.
2022-12-19 17:03:58 +01:00
Marco André Dinis 63bc0e660f
remove DELETE IN directives in types.proto operator's test file (#19479) 2022-12-19 16:13:28 +01:00
STeve (Xin) Huang 6c858c09ee
Register database engines directly from db lib (#19279) 2022-12-18 05:59:47 +00:00
rosstimothy 66b65dd2d7
Reduce latency of tsh ls -R (#19438)
* Reduce latency of `tsh ls -R`

Listing nodes across clusters was done one cluster at a time. To
improve latency the same mechanism used by `tsh db ls -R` was copied
to ensure listing happens in parallel with an upper limit.
2022-12-16 22:17:12 +00:00
rosstimothy 3f52d028fb
Dependency updates (#19329)
* Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp

Bumps [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.36.4 to 0.37.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.36.4...zpages/v0.37.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump k8s.io/apiserver from 0.25.4 to 0.26.0

Bumps [k8s.io/apiserver](https://github.com/kubernetes/apiserver) from 0.25.4 to 0.26.0.
- [Release notes](https://github.com/kubernetes/apiserver/releases)
- [Commits](https://github.com/kubernetes/apiserver/compare/v0.25.4...v0.26.0)

---
updated-dependencies:
- dependency-name: k8s.io/apiserver
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump cloud.google.com/go/storage from 1.28.0 to 1.28.1

Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.28.0 to 1.28.1.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.28.0...storage/v1.28.1)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/storage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/schollz/progressbar/v3 from 3.12.1 to 3.12.2

Bumps [github.com/schollz/progressbar/v3](https://github.com/schollz/progressbar) from 3.12.1 to 3.12.2.
- [Release notes](https://github.com/schollz/progressbar/releases)
- [Commits](https://github.com/schollz/progressbar/compare/v3.12.1...v3.12.2)

---
updated-dependencies:
- dependency-name: github.com/schollz/progressbar/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump cloud.google.com/go/iam from 0.7.0 to 0.8.0

Bumps [cloud.google.com/go/iam](https://github.com/googleapis/google-cloud-go) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/iam
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump golang.org/x/text from 0.4.0 to 0.5.0

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2022-12-16 21:53:25 +00:00
Jakub Nyckowski 9c80f3802e
Enable nolintlint linter (#19406)
* Enable nolintlint linter

* Fix nolint comments in the api package

* Fix RDP client comment

* Address review comment

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Allow unused for nolintlint linter

* Remove redundant casting

* Add comment on why allowed unused is enabled

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-12-16 21:13:58 +00:00
Steven Martin e1ebc332f8
spell fixes (#19419) 2022-12-16 19:01:28 +00:00
Mike Jensen e1c7304e21
Disable FuzzMongoRead test due to instability (#19418) 2022-12-16 16:34:10 +00:00
Marco André Dinis a7507a2658
DatabaseService resource: rpc calls (#19363)
In the context of Discover we must be able to know when a DatabaseService process is running, in order to give feedback to the user.
DatabaseService process is the process that teleport binary manages when the `teleport.yaml` has
```yaml
db_service:
  enabled: "yes"
```

To do so, we are creating a new resource: DatabaseService.

It will be similar to the way DatabaseServers work, using the same heartbeat mechanism.

To ease the review, we'll only add the RPC calls in this PR. Following PRs will:
- CRUD management over rpc
- DatabaseService hearthbeat
- webapi endpoint

Part of #19032
2022-12-16 15:59:40 +00:00
Tiago Silva 129ae1d058
Set SNI when tsh login --format kubernetes is invoked (#19422)
Fixes missing Server Name Identifier when `tsh login --format kubernetes` is invoked against a cluster with `ProxyListenerMode=multiplex`.

Fixes #19312
2022-12-16 15:36:28 +00:00
Paul Gottschling 5328a947da
Add reference links to all required Helm guides (#19355)
Closes #19189

Ensure that all Helm guides include a link to the relevant Helm chart at
the end of the guide.
2022-12-16 15:13:56 +00:00