Commit graph

10206 commits

Author SHA1 Message Date
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
Tobiasz Heller 5f07b284b0 security: Prevent access to SSH nodes using SessionJoinPrincipal 2022-12-28 09:24:02 -08:00
Tim Ross 53f08bd74f security: Purge nonexistent sessions
The session cache routine to purge expired sessions would not consider
a session which was not found in the cache or backend to be expired.
It would instead defer to the expiry of the session token. This results
in a window after a user has logged out for that session to still be
considered valid by any Proxy which did not process the logout request.
On logout the Proxy manually removes the session from the cache. So in
an HA configuration there is an inconsistent state between Proxies after
a user logs out which results in #197.

To remedy this the expiration routine should consider all sessions which
were not found in the cache/backend to be expired and purge them from
their session cache. This causes all Proxies to honor the logout as soon
as the deletion of the web session is processed.

Closes #197
2022-12-28 09:24:02 -08:00
Anton Miniailo cd595c5d37 security: Prevent IP pinning bypass 2022-12-28 09:24:02 -08:00
Gavin Frazar 4330e43cc9 security: Prevent app access authz bypass 2022-12-28 09:24:02 -08:00
Tim Buckley 07de55d45d
Generate prehog protos in genproto.sh (#19631)
This adds a `buf generate` for the prehog protos in `genproto.sh`,
which was previously missing from the usual `make grpc` flow.
2022-12-28 09:32:31 -07:00
Marco André Dinis 6286488be3
Database: validate AWS Account ID (#19638)
When the AWS Account ID is provided, we must check that it is a valid
one.

AWS Account ID is a well documented field: 12-digit string

This check is meant to prevent typos when creating Databases mainly from
the Web UI in the context of Teleport Discover.
2022-12-28 12:42:39 +00:00
Steven Martin 8fe2a74d02
Make Kubernetes capitalization consistent across cli (#19650) 2022-12-27 16:11:11 +00:00
STeve (Xin) Huang be77dadd55
Move database fetchers to discovery service (#19510) 2022-12-26 20:46:25 +00:00
Roman Tkachenko 77742ed3b0
[auto] Update AMI IDs for 11.1.4 (#19661) 2022-12-23 22:56:02 +00:00
Anton Miniailo a039ce1cf9
Add secure IP propagation from teleport proxy to auth server via ALPN (#19008)
* Add secure IP propagation from proxy to auth server when using ALPN

We're using PROXY protocol extensions called TLVs to send
signed JWT and proxy's certificate to the auth server. Auth
validates JWT using provided signing certificate and host CA
to make sure that IP information comes from our internal proxy.
2022-12-23 22:12:42 +00:00
Jakub Nyckowski 98d8a30959
Add t.Parallel() to tsh tests (#19595)
Run tsh tests in parallel.
2022-12-23 20:28:15 +00:00
Steven Martin 9afffee6ed
include Kubernetes in tsh join description (#19646) 2022-12-23 15:00:38 -03:00
Alan Parra 390396dcd2
Update e/ reference (#19610)
Update e/ submodule to the latest commit.
2022-12-23 15:12:18 +00:00
Łukasz Kozłowski d85795c7af
Fix Rust warnings (#19643) 2022-12-23 15:03:40 +00:00
Łukasz Kozłowski 3a781212c9
Update Rust to 1.66.0 (#19605) 2022-12-23 11:29:14 +01:00
STeve (Xin) Huang 39cee50cc9
Fix Too many requests error in github actions test (#19606) 2022-12-23 03:47:02 +00:00
Trent Clarke b0de5a2752
Fix GOLANG_VERSION in multiarch buildbox (#19599)
Update use of $GOLANG_VERSION to expect a leading go
2022-12-23 03:21:09 +00:00
Gavin Frazar eccfd9342e
Refactor app access (#19387)
* Move logic out of RoundTrip and into ServeHTTP as a middleware before handing off to oxy forwarder
* Move AWS signing service code into lib/utils/aws/signing.go
* use app server close context for audit event emitting
* add go doc comments.
* refactor request rewriting to make the copy in a more robust way.
* pass status code as uint32 rather than casting in audit emitter
* clone request instead of making a new request, and rewrite url to force https
* update header handling
* Set oxy forwarder to PassHostHeader=false to ensure the host header is
  the URL being sought.
* Remove code that deleted forwarding headers previously, we should keep
  those (X-Forwarded-*).
* Audit log the AWS Host sought rather than the incoming request Host
  header (prior behavior maintained, we just rewrite the request
  differently using Clone).
* Remove obsolete header copying helper func
2022-12-23 00:56:27 +00:00
Zac Bergquist 17bb5855de
docs: fix references to IBM cloud file storage (#19590)
We should be referring to IBM cloud _object_ storage instead.

Closes #18287
2022-12-23 00:00:21 +00:00
Russell Jones 431d6e486e Added documentation for Access Requests TTLs.
Added documentation for Access Requests TTLs.

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2022-12-22 14:52:26 -08:00
Isaiah Becker-Mayer 9a06ca404c
Windows Certificate SID Mapping (#19340) 2022-12-22 21:54:50 +00:00
Zac Bergquist 749dbcd5a2
Disable disk-based recording for TestWebAgentForward (#19580)
Also improve the correctness of web tests that use waitForOutput
by checking if the output was received even when the read fails
with an error.

Fixes #17918
2022-12-22 21:13:47 +00:00
Roman Tkachenko c286e4cd94
Run GHA tests on Dockerfile updates (#19622) 2022-12-22 20:08:52 +00:00
Vitor Enes 87f706d0ec
Track active migrations in Prometheus and tctl top (#19520)
This commit adds a new Prometheus gauge `teleport_migrations` that
tracks for each migration if it is active (1) or not (0).

This gauge is then leveraged in `tctl top` to show a set of active
migrations.
2022-12-22 19:37:44 +00:00
Roman Tkachenko 1b387aba2c
Run GHA tests when build.assets/Makefile changes (#19616) 2022-12-22 19:04:44 +00:00
Vitor Enes 693b164897
[buddy] Error if TTL in tctl auth sign is too long (#19563) 2022-12-22 18:46:43 +00:00
Tiago Silva 2d89c20867
RFD 101: Kubernetes Per-pod RBAC (#18434)
RFD 101: Kubernetes Per-pod RBAC
2022-12-22 17:57:58 +00:00
Alex Fornuto 4c960c0ed2
[Docs] Refactor Install From Linux Instructions (#17498)
* refactor Linux Install partial

* update download source

* use nested scoped tabs

* lint bulleted list
2022-12-22 17:17:24 +00:00
Yassine Bounekhla f87f37b9a3
[auto] Update webassets in teleport/master from webassets/master (#19489) 2022-12-22 15:29:03 +00:00
Paul Gottschling 54f7c0fcd9
Document license file expiration logic (#19485)
* Document license file expiration logic

Closes #19109

* Respond to PR feedback

* optimize images

* Respond to PR feedback

Co-authored-by: alexfornuto <alex.fornuto@goteleport.com>
2022-12-22 14:40:54 +00:00
Paul Gottschling e777e7abbe
Reorganize early-stage docs sections (#19205)
* Reorganize early-stage docs sections

Closes #18127

Currently, there are two sections of the docs related to the earliest
stages of setting up Teleport, "Try out Teleport" and "Deploy a
Cluster". While the organization of our top-level docs sections attempts
to correspond to the stages a user goes through when setting up
Teleport, these combine some tasks that should probably be separated:

- **Choosing an edition and deploying a production cluster**: While the
  "Deploy a Cluster" section includes our deployment guides as well as
  our edition guides, user will likely commit to setting up Teleport
  Cloud, Open Source, or Enterprise before they plan a full HA
  production deployment.

- **Deploying a production cluster and deploying a small-scale Teleport
  cluster:** While the "Deploy a Cluster" section includes the Linux
  Server and Digital Ocean 1-Click guides, these two guides are more for
  small-scale deployments than full production clusters.

This change improves the early-stage docs experience for new Teleport
users by:

Splitting the "Deploy a Cluster" section
----------------------------------------

The "Deploy a Cluster" section includes subsections related to choosing
a Teleport edition as well as subsections related to deploying a
production cluster. The problem with this approach is that it leaves no
room for adding introductory guides to help users with these two
purposes.

By splitting the "Deploy a Cluster" section into two top-level sections,
one related to choosing an edition and the other to dpeloying to
production, we can add introductory pages that put the subsections of
these sections in context.

_This change accompanies the work on #16751 to write a general guide to
HA Teleport deployments, since the new guide will have a prominent
place in the reorganized "Deploy a Cluster" section._

Adding introductory pages
-------------------------

Sections related to getting started with Teleport, "Try out Teleport"
and "Deploy a Cluster", were missing introductory pages. This change
adds them, and also adds one to the new "Choose an Edition" section.

Moving the Linux Server and Digital Ocean guides
------------------------------------------------

Move these to "Try out Teleport". The Digital Ocean guide didn't fit
with the rest of the deployment guides, since it's not about
architecting an HA deployment.

This is also a better home for the "Linux Server" guide, so this change
moves that as well.

Removing the "getting-started.mdx" page
---------------------------------------

This page is not reachable via the navigation menu.

* Respond to PR feedback

* Respond to PR feedback

Also minor text tweaks
2022-12-22 13:34:06 +00:00
Krzysztof Skrzętnicki 71b19fa61d
Implement teleport app start --cloud=... flag. (#19331) 2022-12-22 11:02:19 +01:00
Marco André Dinis adcdc2459f
Add DatabaseService heartbeat (#19570)
n 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.

Previous PRs created the DatabaseService resource and its CRUD methods.

This PR adds an heartbeat for DatabaseServices similar to what we have for Databases.
There's also a new command to list DatabaseServices using `tctl`:
```
$ tctl get db_service --format text
Name                                 Resource Matchers                      
------------------------------------ -------------------------------------- 
a6065ee9-d5ee-4555-8d47-94a78625277b (Labels: <all databases>)              
d4e13f2b-0a55-4e0a-b363-bacfb1a11294 (Labels: env=[prod],aws-tag=[xyz abc]) 
```


Test using Teleport Cloud
```
dinis@lenix ~/p/cloudagents> tctl get db_services
kind: db_service
metadata:
  expires: "2022-12-21T18:05:10Z"
  id: 1671645310983808522
  name: 2a28d394-900c-42ea-a120-eed918e4526b
spec:
  resources:
  - labels:
      aws-tag:
      - xyz
      - abc
      env: prod
version: v1
dinis@lenix ~/p/cloudagents> tctl status
Cluster  marcoacme.cloud.gravitational.io                                        
Version  12.0.0-dev 
```

Part of #19032
Related #19363 #19469
2022-12-22 09:19:02 +01:00
Trent Clarke e29fabd3b1
Adds GitHub App based auth (#19562)
As we're now using a GitHub app to dispatch workflow requests from Drone to GHA, this patch updates the workflow runner script to handle app authentication.
2022-12-22 03:09:07 +00:00
Roman Tkachenko f873cbe0ce
Fix skipped but required checks for Github Actions (#19594) 2022-12-22 01:44:11 +00:00
Jakub Nyckowski 44715e1d58
Update e ref (#19596) 2022-12-22 00:45:40 +00:00
rosstimothy 3845f5b000
Fix TestExportingTraces race (#19592) 2022-12-21 23:12:29 +00:00
Alan Parra ecf9e5c7d1
Enforce device extensions for SSH access (#19574)
Add device-aware authorization for SSH access, including both long-lived and
single-use certificates.

If the device trust mode is set to "required", then the presence of the
corresponding extensions is enforced. (Requires Teleport Enterprise.)

Adds logic related to TLS validation and single-use certificates as well, where
appropriate. TLS device-aware validation is not wired into Teleport yet, but
will be in follow up PRs.

gravitational/teleport.e#514
2022-12-21 22:54:13 +00:00