Commit graph

10144 commits

Author SHA1 Message Date
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
Gabriel Corado 7444cb61c4
Renew cloud-hosted database CAs (#18958) 2022-12-29 23:46:06 +00:00
Tiago Silva c3fe7c092f
Update Kubernetes Dependencies (#19695)
This PR replaces the following PRs opened by dependabot:
- #19678 
- #19677 

It also bumps:

- Bump k8s.io/api from v0.25.4 to v0.26.0
- Bump k8s.io/apiextensions-apiserver from v0.25.4 to v0.26.0
- Bump k8s.io/apimachinery from v0.25.4 to v0.26.0
- Bump k8s.io/apiserver from v0.25.4 to v0.26.0
- Bump k8s.io/cli-runtime from v0.25.4 to v0.26.0
- Bump k8s.io/kubectl from v0.25.4 to v0.26.0
- Bump k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed to v0.0.0-20221128185143-99ec85e7a448
- Bump sigs.k8s.io/controller-runtime from v0.13.1 to v0.14.1
2022-12-29 22:49:22 +00:00
Sam Freiberg 2c10c558e9
Fix known cases where audit log events can be bypassed by exceeding limit (#19486)
* Limit Device Name and User Agent lengths

* Spelling correction

* Increase ballast size while trimming message size

* Cleanup error message

* Remove additional check

* Adjust tests

* Add tests for large AuditEvent

* Rename func to add clarity

* Move limit to const and lowercase field name

* Add test for invalid device name length

* Add a test for trimming the user agent

* Replace custom emitter with MockEmitter

* Add additional background to const

* Add additional comments

* Fix import ordering

* Refactor trimN to better handle heavily quoted queries and add tests

* Convert to error assetion func

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>

* Finish test refactor

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2022-12-29 21:41:05 +00:00
rosstimothy d27f63a49b
Dependency updates (#19686)
* Bump libc from 0.2.138 to 0.2.139

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.138 to 0.2.139.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.138...0.2.139)

---
updated-dependencies:
- dependency-name: libc
  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-v2/credentials from 1.13.6 to 1.13.7

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.13.6 to 1.13.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/service/mq/v1.13.6...service/mq/v1.13.7)

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

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

* Bump cloud.google.com/go/container from 1.8.0 to 1.9.0

Bumps [cloud.google.com/go/container](https://github.com/googleapis/google-cloud-go) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/documentai/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/dlp/v1.8.0...asset/v1.9.0)

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

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

* Bump github.com/bufbuild/connect-go from 1.3.2 to 1.4.1

Bumps [github.com/bufbuild/connect-go](https://github.com/bufbuild/connect-go) from 1.3.2 to 1.4.1.
- [Release notes](https://github.com/bufbuild/connect-go/releases)
- [Commits](https://github.com/bufbuild/connect-go/compare/v1.3.2...v1.4.1)

---
updated-dependencies:
- dependency-name: github.com/bufbuild/connect-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump github.com/go-webauthn/webauthn from 0.5.0 to 0.6.0

Bumps [github.com/go-webauthn/webauthn](https://github.com/go-webauthn/webauthn) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/go-webauthn/webauthn/releases)
- [Commits](https://github.com/go-webauthn/webauthn/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/go-webauthn/webauthn
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump github.com/mdlayher/netlink from 1.7.0 to 1.7.1

Bumps [github.com/mdlayher/netlink](https://github.com/mdlayher/netlink) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/mdlayher/netlink/releases)
- [Changelog](https://github.com/mdlayher/netlink/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mdlayher/netlink/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/mdlayher/netlink
  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.8.0 to 0.9.0

Bumps [cloud.google.com/go/iam](https://github.com/googleapis/google-cloud-go) from 0.8.0 to 0.9.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.8.0...v0.9.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 github.com/aws/aws-sdk-go-v2/service/ec2 from 1.76.1 to 1.77.0

Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.76.1 to 1.77.0.
- [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/service/ec2/v1.76.1...service/ec2/v1.77.0)

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

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

* Bump github.com/gocql/gocql from 1.3.0 to 1.3.1

Bumps [github.com/gocql/gocql](https://github.com/gocql/gocql) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/gocql/gocql/releases)
- [Changelog](https://github.com/gocql/gocql/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gocql/gocql/compare/v1.3.0...v1.3.1)

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

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

* Bump github.com/pquerna/otp from 1.3.0 to 1.4.0

Bumps [github.com/pquerna/otp](https://github.com/pquerna/otp) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/pquerna/otp/releases)
- [Commits](https://github.com/pquerna/otp/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/pquerna/otp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* revert cloud.google.com/go/iam update

* revert github.com/go-webauthn/webauthn update

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-29 20:12:50 +00:00
Steven Martin 7b5564d6c4
Webapi url update to prevent errors (#19723) 2022-12-29 18:50:31 +00:00
Alex Fornuto 3fc2712a7d
[Docs] Consolidate install partials (#19623)
* add version compatibility callout to Cloud section

* consolidate partial usage in various guides

* remove partial consolidated into

* Apply suggestions from code review
2022-12-29 18:26:56 +00:00
Anton Miniailo 50aeb630cb
Correctly set protocol version in signed PROXY header based on source address (#19707) 2022-12-29 17:04:36 +00:00
Zac Bergquist fee0457aa0
terraform: update README.md (#19712)
Add missing roles to the tctl users add command and replace
the old admin role with the preset access and editor roles.

Signed-off-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Rob Langford <rob.langford1@gmail.com>
2022-12-29 16:49:20 +00:00
Noah Stride 33f28b7140
Require enterprise license to use GHES support (#19644)
* Require enterprise license to create tokens including GHES support

* Enforce Enterprise on joining as well as token creation

* Fix tests and file formats for GHES enteprrise licenseing

* Use ErrRequiresEnterprise

* Fix imports >:(
2022-12-29 16:34:55 +00:00
Steven Martin c5e4355f96
Add tsh proxy types aws,db,ssh to CLI ref (#17716) 2022-12-29 16:15:42 +00:00
Marek Smoliński 18c5d9979a
ALPN Proxy change log level for remote client errors (#19478) 2022-12-29 14:05:39 +01:00
Trent Clarke d9ac0d43ae
Update makefile with targets to build from GHA (#19637)
The existing `build.assets` makefile targets had the actual build steps 
coupled together with building the build box image. Because of how GHA
image builds work, we need to uncouple those tasks.

GHA also builds OSS and Enterprise teleports in parallel, so we needed 
a new target to build the Enterprise release without also automatically
building the OSS bundle in series.

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2022-12-28 23:16:57 +00:00
Zac Bergquist 7ae959be5b
Fix RBAC rules for desktop session recordings (#19629)
Desktop session playback is currently the only playback that leverages
the StreamSessionEvents API (though that will change with RFD 91).

For this API, we were checking for VerbList instead of VerbRead.
(The SSH session APIs were correctly checking VerbRead).

Since all uses of actionForKindSession now use the same verb, I've
removed the verb as an argument to prevent this mistake from happening
again.
2022-12-28 21:09:15 +00:00
Noah Stride 55d1b899cf
Remove duplicate expires field in GH join docs (#19704) 2022-12-28 20:05:09 +00:00
thameezb 43faf51b1e
fix: correct script path (#19607)
Co-authored-by: ThameezBo <thameez.bodhanya@finoa.io>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-12-28 18:37:27 +00:00