Commit graph

10172 commits

Author SHA1 Message Date
rosstimothy 54b8fce42b
Multiplex Proxy SSH port (#19813) 2023-01-06 11:54:05 -05:00
Gus Luxton 4ba2de8462
docs: Flip sync/async in session recording reference (#19944)
Noticed an incorrect inversion
2023-01-06 16:04:59 +00:00
rosstimothy e99f77b834
Add comments explaining cache backward compatibility (#19925)
When modifying the `types.WatchKind` of `ForRemoteProxy` a series of
steps need to be performed to prevent bricking remote cluster caches.

First, the `cfg.Watches` of `ForOldRemoteProxy` must be replaced
with the current `cfg.Watches` of `ForRemoteProxy`. Next, the
version used by `lib/reversetunnel/srv.go` to determine whether
to use `ForRemoteProxy` or `ForOldRemoteProxy` must be updated
to be the release in which the new resource(s) will exist in.
Once both of these are done, `ForRemoteProxy` may be updated.

Comments are added to `ForRemoteProxy`, `ForOldRemoteProxy`, and
`createRemoteAccessPoint` to help prevent backward incompatible
changes like https://github.com/gravitational/teleport/issues/17211
and https://github.com/gravitational/teleport/issues/19907 from
occurring again in future releases.
2023-01-06 15:25:51 +00:00
Isaiah Becker-Mayer 11a076a289
Fix connections to desktops in leaf clusters where w_d_s is connected via reverse tunnel (#19918) 2023-01-06 14:40:40 +00:00
Brian Joerger 488af75797
Client store generalization (#19420)
- Add a generalized client store made up of a key, profile, and trusted certs store. Each sub store can support different backends (~/.tsh, identity_file, in-memory). 
- Replace custom identity file handling with in-memory client store.
- Fix issues with trusted certs handling.
2023-01-06 01:34:04 +00:00
Zac Bergquist fb850a7d2b
docs: add overview of session recording (#18717)
Co-authored-by: alexfornuto <alex.fornuto@goteleport.com>
Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2023-01-05 16:20:26 -07:00
Anton Miniailo cbdec15d05
Fix panic when printing ascii table while running in debugger (#19930)
When running in debugger width was returning as 0, even though there was no error.
This resulted in panic further down the code, because column maxCellLength
ended up to be negative.
2023-01-05 23:02:51 +00:00
Paul Gottschling 800170ba10
Add redirects to the new Audit Events section (#19553)
The changes in #17405 added a section to the docs for guides to
exporting audit events, and moved guides from
`docs/pages/management/guides`, but failed to add redirects. This change
adds the missing redirects.
2023-01-05 22:45:04 +00:00
Alan Parra b84afe0783
Enable device authorization for k8s access (#19923)
Follow up on #19659 by enabling device authorization for k8s access.

All relevant changes and tests are already part of the aforementioned PR, I was
simply holding this out until I could do more thorough manual testing.

Without session MFA:

```shell
$ tsh logout; tsh login
$ kubectl get ns
> ERROR: unauthorized device
> 
> Unable to connect to the server: getting credentials: exec: executable tsh failed with exit code 1

$ ./tsh logout; ./tsh login # tsh signed for device authn
$ kubectl get ns
> NAME                 STATUS   AGE
> default              Active   27h
> kube-node-lease      Active   27h
> kube-public          Active   27h
> kube-system          Active   27h
> local-path-storage   Active   27h
> teleport             Active   126m
```

With session MFA:

```shell
$ tsh logout; tsh login
$ kubectl get ns
> ERROR: rpc error: code = PermissionDenied desc = unauthorized device
>
> Unable to connect to the server: getting credentials: exec: executable tsh failed with exit code 1

$ ./tsh logout; ./tsh login # tsh signed for device authn
$ kubectl get ns
> Tap any security key
*taps*
> NAME                 STATUS   AGE
> default              Active   27h
> kube-node-lease      Active   27h
> kube-public          Active   27h
> kube-system          Active   27h
> local-path-storage   Active   27h
> teleport             Active   122m
```

gravitational/teleport.e#514
2023-01-05 22:29:36 +00:00
Steven Martin 9f233ede61
Update federation data xml warning (#19837)
the federation data xml had a warning to treat as a password.  RAther it should be treated securely like a certificate so the values are loaded correctly.
2023-01-05 22:08:39 +00:00
Noah Stride 503a2731ca
Update documentation for GitHub joining to use actions (#19775)
* Fix Teleport version

* Update GitHub actions guide with new actions and GHES support

* Fix SPAG

* Add note on ommitting -i

* Changes notes order to make things make more sense

* Apply suggestions from code review

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

* More spag tidying in github actions article and removed some chaff

* Fix SPAG

* Introduce next steps sectionm

* Add missing hyphen

* Move Enterprise instructions to tabbs

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-01-05 21:55:04 +00:00
Lisa Kim f488007ce1
[Discover] Database related tweaks (#19824)
* Return db users and names with fetch databases
* Include checking for AWS RDS Resource ID as valid RDS type
2023-01-05 19:16:45 +00:00
Michael 7d78090841
Update webapi/sessions route (#19892) 2023-01-05 12:23:28 -06:00
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