Commit graph

10209 commits

Author SHA1 Message Date
Tiago Silva 6d98acfc03
Include active access requests into Kube Proxy credentials cache key (#19889)
When users access a cluster, Teleport caches their credentials to avoid generating a new cert key pair each time they run a command on the cluster. If the user's certificate includes an active access request that was later discarded, the Teleport Kubernetes Proxy continues to use the cached credentials - which include the dropped access request - resulting in subsequent requests being denied by Teleport. The problem persists even if the user assumes another access request that grants him access to the cluster.

This situation happens because Kubernetes Proxy stores in a TTL map the user's certificate to avoid generating and signing it each time the user hits the proxy. The lookup in cache happens using a key that includes the `kubeCluster`, `username`, `certificate_expiration`, `kube_users`, and `kube_groups` but does not include the `active_requests`.

This PR adds the `active_requests` into the cache's key to distinguish different certificate requests for the same user.

Fixes #19884
2023-01-05 17:42:44 +00:00
Zac Bergquist 1716a15113
dronegen: remove tdr requirement (#19755)
Since the release of `tsh proxy app` we no longer need a
Teleport-aware Drone CLI and can leverage the standard
drone tool from https://docs.drone.io/cli/install/
2023-01-05 15:46:56 +00:00
rosstimothy 3ebbfdd222
Batch Dependabot PRs (#19745) 2023-01-05 13:13:05 +00:00
Tiago Silva 40861809a6
Add RoleV6 resource type (#19324)
This PR includes a new Role resource version that is compatible with V5 spec.

The new resource introduces the `kubernetes_resources` definition that allows operators to limit the Kubernetes resources that each member can access. The `kubernetes_resources` entries must follow the following format: `{"kind":"<kind>", "namespace":"<namespace>","name":"<pod>"}`. Currently, it only supports objects of `kind` `pod`. Valid examples `<namespace>/<name>:
- `*/*`: matches all pods in all namespaces.
- `default/*`: matches all pods in the `default` namespace.
- `*/nginx-*`: matches every pod prefixed with `nginx-` in every namespace.

For older resource versions - V5, V4, V3 - `kubernetes_resources` is automatically populated with `{"kind":"pod","namespace":"*","name":"*"}` to keep compatibility. For the newest version, it's mandatory to define its value otherwise access to pods will be denied.

Part of #18434
2023-01-05 09:58:12 +00:00
Philippe M. Chiasson 02e61991f9
Bump cloud version to 11.1.4 (#19883) 2023-01-05 03:26:38 +00:00
Trent Clarke e2c795a4b1
Drone and tagging updates trigger GHA buildsfrom drone (#19830)
This patch performs the (hopefully final) switchover that will make drone
defer to GHA in order to build Teleport ion arm64.

This patch:
 - Replaces all of the Dronegen code to generate arm64 builds locally with
   steps that invoke the GHA builder workflow
 - Changes the release tagging behavior in the Makefile to tag `teleport.e`
   with the same tag as teleport. This is required to for Drone to identify
   the revision of the arm64 build workflow to invoke
 - Updates the e reference to include a revision of `teleport.e` that 
   contains the builder workflows

Thanks to everyone involved in getting this working.
2023-01-04 23:28:50 +00:00
Tiago Silva dd39253288
Fixes TestModeratedSessions flaky test (#19878)
The `fileStreamer` continues to write events after the server shuts down and races against the `os.RemoveAll` call during the test cleanup causing the test to fail.

Using `node-sync` recording mode to write the events and session recordings directly to AuthClient solves the issue.

Fixes #19847
2023-01-04 23:04:59 +00:00
Steven Martin 608978da3a
Update etcd backend docs to include recommendations (#19744)
* Update etcd backend docs to include recommendations

- Update links to currently maintained docs
- Include link to hardware recs including mentioning storage
2023-01-04 22:24:12 +00:00
rosstimothy 347db018d5
Dependency updates (#19859)
* Bump golang.org/x/text from 0.5.0 to 0.6.0

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.5.0...v0.6.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>

* Bump golang.org/x/sys from 0.3.0 to 0.4.0

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

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

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

* Bump github.com/aws/aws-sdk-go from 1.44.171 to 1.44.172

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.171 to 1.44.172.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.171...v1.44.172)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* go mod tidy

* Bump golang.org/x/term from 0.3.0 to 0.4.0

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

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

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

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

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

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  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>
2023-01-04 22:12:40 +00:00
STeve (Xin) Huang 33cd984ed3
Fix unknown status type "ACTIVE" for Redshift Serverless Endpoint (#19855) 2023-01-04 21:46:05 +00:00
STeve (Xin) Huang 1b9bc2fd09
Fix certificate signed by unknown authority after reconciling a dynamic RDS resource (#19413) 2023-01-04 21:06:27 +00:00
rosstimothy 77bb4c3da4
Disable disk based logging in TestTerminal (#19835)
Switch from `types.RecordAtRecordNode` to `types.RecordAtNodeSync`
to prevent directory not empty errors.

Fixes 19697.
2023-01-04 20:52:14 +00:00
Zac Bergquist 206511a90b
docs: document tctl edit command (#19748) 2023-01-04 20:39:46 +00:00
Paul Gottschling bc214dbebf
Remove versions from URL paths in docs links (#19836)
Closes #19765

The CHANGELOG includes some links to docs pages that use a full URL,
including the `ver` path segment. These links broke once we changed the
docs engine to recognize the `[0-9]+.x` format for versions, rather than
`[0-9]+.[0-9]+`.

If we were to change these links to use the new version format, though,
they would break once we deprecate that version.

This change turns all of the paths in these links to relative paths to
MDX files. In the CHANGELOG.md file, they will now link to pages on
GitHub. In the the docs changelog page, they will link to the current
version of the docs. Users who want to see how the pages looked when we
released the appropraite version can do so by using the version switcher
dropdown.
2023-01-04 20:07:15 +00:00
Jakub Nyckowski d68cb9377b
Switch golang.org/x/crypto to gravitational fork (#19579)
* Switch golang.org/x/crypto to gravitational fork

* Update golden files

* Add comment to go.mod

* Update api module to use crypto fork.

* Move x/crypto to replaced section in dependabot.yml
2023-01-04 19:30:58 +00:00
Sam Freiberg 9726a3dd93
Add rate limiting to unauthenticated routes (#19593)
* Remove deprecated router

* Add rate limiting to additional routes

* Fix rate limiting bug
2023-01-04 19:20:34 +00:00
Gavin Frazar 213d4be6e7
Remove unused yaml tags (#19802)
* Move ldap discovery config struct for parsing into fileconf
2023-01-04 18:24:30 +00:00
Anton Miniailo d7f304f164
Fix flaky tsh test 'TestList' (#19843) 2023-01-04 18:04:58 +00:00
rosstimothy 566f94d274
Disable disk based logging for sshserver tests (#19831)
Converts usage of `newFixture` to `newFixtureWithoutDiskBasedLogging`
to prevent directory not empty errors caused by `t.TempDir` still
containing upload parts.

Fixes #19826
2023-01-04 17:51:25 +00:00
Rafał Cieślak 7cc2dc4286
RFD 99: Making bundled tsh available outside of Connect (#19284) 2023-01-04 16:42:20 +00:00
Alex Fornuto 16379344c2
[DOCS] Reverse suggested install tool for RHEL (#19816)
* reverse suggested install tool for RHEL

* Update docs/pages/includes/install-linux.mdx

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-01-04 16:02:26 +00:00
Zac Bergquist d94334374c
Correctly marshal role options to string (#19750)
This creates a more human-readable representation of a role.

Fixes #7549

Signed-off-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: David Heitman <david.heitman@checkr.com>
2023-01-04 15:51:28 +00:00
Alan Parra ac0129bd9d
Bump libcbor from v0.9.0 to v0.10.1 (#19797)
Keep up with latest releases.

Dropped `-DCBOR_CUSTOM_ALLOC=ON`, since it's now obsolete (custom alloc is always on).

Release notes:
* https://github.com/PJK/libcbor/releases/tag/v0.10.0
* https://github.com/PJK/libcbor/releases/tag/v0.10.1
2023-01-04 15:26:46 +00:00
rosstimothy d3cb592304
Dependency Updates (#19814)
* Bump github.com/aws/aws-sdk-go-v2/config from 1.18.6 to 1.18.7

Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.6 to 1.18.7.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.6...config/v1.18.7)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump github.com/aws/aws-sdk-go from 1.44.163 to 1.44.171

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.163 to 1.44.171.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.163...v1.44.171)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2023-01-04 15:03:24 +00:00
Grzegorz Zdunek 25507e6ccd
[Connect] Add authClusterId to cluster struct (#19829) 2023-01-04 14:05:02 +00:00
Gavin Frazar e944f17d0c
Update doc reference (#19815) 2023-01-04 08:26:10 -05:00
Trent Clarke 60264f5f62
Moves GHA docker invocation from action to Makefile (#19784)
Consolidates more of the build logic into the build.assets Makefile, transplanted from the workflow file in teleport.e

See comment gravitational/teleport.e#673 (comment)
2023-01-04 03:04:36 +00:00
Jakub Nyckowski 7b3f01470e
Initialize fanout before creating watcher (#19800) 2023-01-04 02:27:39 +00:00
Anton Miniailo 10dee1a24b
Fix listing all nodes in tsh (#19796)
* Fix listing all nodes in tsh

Usage of channels was flipped, we tried to write to collecting channel,
but nobody was reading from it, so we blocked forever. Now using simpler
version with mutex for synchronization, and doing it for db listings as
well for consistency.
2023-01-03 22:58:57 +00:00
Michael 3877461d25
[Connect] Add SuggestedReviewers and RequestableRoles to LoggedInUser (#19466) 2023-01-03 16:01:56 -06:00
Adam Strawson e6d2485d66
Fix issue where gcp.credentialSecretName isn't needed (#17964)
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-01-03 19:50:12 +00:00
rosstimothy 08349a3a74
RFD 100: Proxy gRPC transport (#19439) 2023-01-03 19:08:39 +00:00
Alan Parra f942a4ebc8
Enable Authorizer-based device authorization (#19659)
Enable device authorization by plugging into auth.Authorizer and selectively
disabling it for processes that don't (yet) want device authz.

`GenerateUserCerts` is modified to issue device-aware certificates (DB/k8s
access), as well as `CreateAppSession`. The latter is not necessary for DB
access, but it does enable App Access to issue device-aware certs - commands
such as `tsh apps login` and `tsh proxy app` can benefit from those.

DB access is now ready to benefit from trusted devices. k8s access is likely
supported with these changes as well, but I've postponed enabling it after I've
done more testing.

Both `GenerateUserCerts` and `GenerateUserSingleUseCerts` now do early
device-aware authorization; this creates a better UX, as it allows us to return
error messages directly via `tsh`, instead of having to pipe them through
database-specific protocols. Further PRs could improve errors for scenarios
where the existing certificate became lacking due to higher server-side authz
enforcement.

gravitational/teleport.e#514
2023-01-03 17:09:15 +00:00
Michael Wilson 6fa75978e4
Add an access request watcher. (#19626)
An accesss request watcher has been added to support access requests that
will require downstream reconciliation based on access request approval. This
will be useful for requests that trigger external APIs in other Teleport
services once they've been approved. This will be useful for the upcoming
Okta integration work.
2023-01-03 14:23:54 +00:00
matheus 78a83b0b64
Add ListReleases and GetLicense endpoints (#19565)
* Add GetReleases and GetLicense methods

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>
2023-01-03 12:52:22 +00:00
Gabriel Corado b6dbf7a236
Fix Azure hosted CA download error (#19757) 2023-01-02 15:02:27 +00:00
Steven Martin 331989dadf
Add in allows ignoring missing DB CLIs like mysql which not all users have (#19762) 2023-01-02 11:01:34 +00:00
Tiago Silva ae90d5f4df
Fix goroutine leak when using multiResizeQueue and spdy connection leak (#19732)
This PR fixes multiple goroutine and memory leaks when interactive sessions are used. 

- When the session terminates, the `multiResizeQueue` never returns, and the resize stream goroutine blocks. 
- A goroutine leak exited when the server received resizing events after the connection terminated - this happens with fast exec requests.
- A memory leak existed when users tried to leave the session after the `session.tracker` was closed. 

This PR also releases the connection monitor earlier. When the server is under heavy load, it might take a while for the connection to return an `EOF` - which triggers the service monitor automatic release - and the service monitor resources were leaking until the server resumed normal operation.

It also fixes reloads when new parties join and leave the `multiResizeQueue`.
2022-12-31 14:43:27 +00:00
Roman Tkachenko 844fff1767
Add merge_group triggers to GHA CI workflows (#19749) 2022-12-30 21:11:48 +00:00
Gabriel Corado 8ca903742e
Fix Azure Managed SQL fetcher available definition (#19746) 2022-12-30 21:04:18 +00:00
Forrest Marshall ecef3465b6 instance heartbeats 2022-12-30 12:09:11 -08:00
Ulysses ff9065b2b5
Update Teleport capitalization (#11399) 2022-12-30 19:55:39 +00:00
Grzegorz Zdunek 831474c490
Update e ref (#19751) 2022-12-30 19:38:08 +00:00
Peter C 5dd0ee7d72
Fix documentation for access request parameter ordering (#11852)
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-12-30 19:16:28 +00:00
Peter Abeln 6cf0053fe7
fix up teleport_acct script (#10093)
* Correct redirect syntax

Redirects are evaluated in order left-to-right so cloning err from out (`2>&1`) before redirecting stdout (`> /dev/null`) has the effect of sending stderr to fd 1 and stdout to the redirected file.

* Do not expand here document text

Avoids need to escape quotes and variable references in pasted script.

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-12-30 19:07:37 +00:00
Roman Tkachenko c6d2b1d3ea
Add docs section to test plan (#18179) 2022-12-30 18:50:27 +00:00
Gavin Frazar 5bb0ef15db
add dynamodb database access (#18843)
* Add a new db engine
* Add tests for new engine
* Update tsh db subcommands
* Refactor error message and suggestions for unsupported tsh commands
* Add dynamodb to test plan
* Add AWS external ID to db config and update protos
2022-12-30 18:22:30 +00:00
Grzegorz Zdunek ea9530d3ad
Make UsageReporter reusable (#19378) 2022-12-30 18:24:44 +01:00
Roman Tkachenko f690008528
Fix missing closing apostrophe on operator workflow (#19740) 2022-12-30 00:56:25 +00:00
Zac Bergquist cfb40186e1
tctl: add edit command (#18826)
This command allows you to modify a resource in place by opening
the resource YAML in your text editor.

The editor is selected by checking the following, in order of
precedence:

- the TELEPORT_EDITOR environment variable
- the VISUAL environment variable
- the EDITOR environment variable
- defaulting to 'vi'

We also prevent renaming resources with this command.
See gravitational/webapps#1465 where we do the same for the web UI.
2022-12-29 17:30:14 -07:00