Commit Graph
31 Commits
Author SHA1 Message Date
Noah Stride d6fa9ace5f Remove http-fallback for deprecated ChangePassword RPC (#21801) 2023-02-14 18:05:35 +00:00
Noah StrideandZac Bergquist 11010018db Migrate ChangePassword RPC from HTTP to gRPC (#18682)
* Migrate ChangePassword RPC from HTTP to gRPC

* Fix incorrect jsontag on webauthn field of ChangePasswordRequest

* Fix broken tests

* reorder imports :D

* Fix REMOVE IN -> DELETE IN comment

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

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-11-26 12:47:43 +00:00
Brian Joerger ce20b20753 PIV login enforcement (#15874)
Add private key policy enforcement.

  - Add private key policy cert extensions and enforcement.

  - Add private key policy settings and attestation logic.

  - Wire attestation request through login endpoints.

  - Store attestation data for reissue requests.

  - Add private key policy discovery and logic.

  - Relogin on hardware key policy errors.

  - Include integration with Teleport Connect.
2022-09-30 23:27:48 +00:00
Brian Joerger b5472d41ec Convert GenerateToken to gRPC. (#9024) 2022-06-14 17:43:39 +00:00
Brian Joerger 9cc58cca44 gRPC conversions - SSO Auth Connectors (#13073) 2022-06-08 01:45:06 +00:00
Brian Joerger 0431c0f0fb Remove deprecated node http endpoints (#12970) 2022-06-03 18:15:49 +00:00
Brian Joerger ca617fb462 Remove deprecated trusted cluster http endpoints (#12968) 2022-06-02 00:30:35 +00:00
Noah Stride 7e73d1a501 Convert GetDomainName and GetClusterCACert to gRPC (#12937)
* convert GetDomainNAme endpoint to gRPC

* migrate GetClusterCACert from http to grpc

* fix tests failing due to switch to gRPC transport

* Correct mispelt json tag

* remove `GetLocalClusterName` and `UpsertLocalClusterName` which are unused

* remove unused prefix constant from presence
2022-06-01 22:53:42 +00:00
Brian Joerger f6adb1ecfa Remove deprecated auth connector http endpoints. (#12969) 2022-05-27 23:18:32 +00:00
Noah Stride a7f9030104 Remove deprecated Auth HTTP Tokens endpoints (#12844)
* delete deprecated tokens endpoints in auth http api

* remove marshal opts from GetTokens
2022-05-25 15:25:31 +00:00
Lisa Kim 628564c801 Update 'tctl apps/db/nodes ls' to accept filter flags (#11003) 2022-03-11 17:57:40 +00:00
rosstimothy 550d23d15d Fix goroutine and memory leak in watchCertAuthorities (#10871)
* Fix goroutine and memory leak in watchCertAuthorities

The CA Watcher was blocking both on writing to a channel when the watcher
was closed and on HTTP calls that had no request timeout or context passed
to cause cancellation.

All resourceWatcher implementations that had a bug which may cause them to block
on writing to a channel forever were fixed by selecting on the write and ctx.Done.

Adding context.Context to all Get/Put/Post/Delete methods on the auth HTTPClient to
force callers to propagate context. Prior all calls used context.TODO which
prevents requests from being properly cancelled.

Add context propagation to RotateCertAuthority, RotateExternalCertAuthority,
GetCertAuthority, GetCertAuthorities. This is needed to get the correct ctx
from the CertAtuhorityWatcher all the way down to the HTTPClient that makes
the call.

Closes #10648
2022-03-10 11:05:39 -05:00
Lisa Kim 350ea5bb95 Updates tsh ls for node/app/db/kube to accept new filter flags (#10980)
* Also adds a search keyword parser that takes in different
  delimiters (comma is used for tsh, space is used for web UI)

part of RFD 55
2022-03-09 23:56:55 +00:00
Alan Parra bac0ccdc99 Remove U2F support (#10476)
Follows up on #10466 by removing remaining U2F references, including proto/gRPC
surface and the lib/auth/u2f package itself.

#10375

* Remove U2F from lib/auth/ (1)
* Remove U2F from lib/auth/ (2)
* Remove U2F from lib/auth/ (3)
* Remove U2F from lib/services/
* Remove U2F from tsh mfa add suggestions
* Remove U2F protos
* Update generated protos
* Cleanup a few stragglers
* Remove lib/auth/u2f package
* Fix references to auth.MFAAuthenticateChallenge
* Revert needless lib/auth/password.go change
* Update e/ to ad8fd4a (U2F cleanup)
* Fix stragglers from latest master rebase
* Fix lint and compile failures
2022-02-24 19:54:28 +00:00
Zac Bergquist e256170d60 Remove the legacy JSON API for requesting host certs
In Teleport 8 we migrated all uses of this API to GRPC, but left
the JSON API in place so that Teleport 7 nodes could still join
the cluster.

In Teleport 9, the oldest nodes we support are v8, which use the
GRPC API, so we can safely remove the old API.
2022-02-15 18:40:48 -07:00
Joel ea810d30d9 Implement Moderated Sessions (#8563)
* Implement Moderated Sessions
2022-02-15 17:02:10 +01:00
Forrest Marshall 7f39084def fix nits 2021-10-22 16:42:33 -07:00
Forrest Marshall 19c5768873 server-side filtering 2021-10-22 16:42:33 -07:00
Brian Joerger 549b72c5a5 Fix GenerateHostCerts http fallback with LegacyCerts. (#8469)
* Fix GenerateHostKeys http fallback with LegacyCerts (PackedKeys).

* Replace registerUsingTokenResponseJSON.

* Remove redundant fallback logic for pre v8 clusters.
2021-10-06 11:42:02 -07:00
Lisa Kim c2016bbae7 Unify creating u2f, totp, and webauthn MFA register challenges (#8342)
One endpoint is now responsible for creating/returning 
MFA register challenges:
- Deprecates RotateUserTokenSecrets 
- Deprecates GetSignupU2FRegisterRequest
2021-09-24 08:59:48 -07:00
Andrej Tokarčík bddc54d8c4 Remove ClusterConfig resource (#8150) 2021-09-23 13:56:35 -07:00
Lisa Kim e624dd1730 Allow getting MFA authenticate challenge with recovery token (#8231)
Created a new rpc `CreateAuthenticateChallenge` that 
replaces/deprecates `GetMFAAuthenticateChallenge`

Allows 3 ways to invoke this request:
1. with username + password 
2. with token ID (username retrieved from token)
3. with empty request (username retrieved from context)
2021-09-14 14:48:41 -07:00
Zac Bergquist 839cdcfa97 Convert GenerateServerKeys to GRPC (#8193)
This commit contains 2 changes:

1. Rename GenerateServerKeys to GenerateHostCerts.
   This is a more accurate name and consistent with the existing
   GenerateUserCerts endpoint.
2. Change the request type to include a single role, rather than a
   list of roles. We only ever allowed a single role in the list
   anyway, so this change will prevent future mis-use of the API.

Note: a side effect of this change is we now have two similar endpoints:
- GenerateHostCert: old API that generates SSH cert only
- GenerateHostCerts: a newer API that generates SSH and TLS certs

To avoid making this change too big, we'll aim to deprecate
GenerateHostCert in the future.
2021-09-13 14:37:28 -07:00
Lisa Kim 6c1a5b7b87 Implement Account Recovery Codes (#8034)
* Add dice-ware library to create the recovery codes
* Add new recovery code "generated" and "used" events
* Implement create, upsert, and get recovery codes
* Create ChangeUserAuthentication grpc endpoint that is essentially a rework
  of ChangePasswordWithToken that returns both a web session and
  recovery codes (if user meets requirement)
* Add custom rate limit for grpc endpoint for ChangeUserAuthentication

* This commit also includes unused methods related to verifying recovery
  code and recovery attempts that isn't utilized until later PRs
2021-08-26 17:29:08 -07:00
Brian Joerger eaa750445c ClusterConfig fallback (#7702) 2021-08-09 10:17:49 -07:00
Brian Joerger 9b8b9d6d0c rollback - Upgrade api version. (#7751) 2021-07-30 15:34:19 -07:00
Brian Joerger c040aca4c1 Upgrade api version. (#7609) 2021-07-28 13:51:21 -07:00
Brian Joerger 917df5ad02 gRPC conversions - Auth Preference (#7220) 2021-06-18 12:30:56 -05:00
Brian Joerger 7bff7c41bd Remove API aliases (#6983) 2021-06-04 13:29:31 -07:00
Andrew Lytvynov cd2f4fceb7 Remove JSON schema validation (#6685)
* Remove JSON schema validation

Removing JSON schema validation from all resource unmarshalers.

--- what JSON schema gets us

Looking at the JSON schema spec and our usage, here are the supposed benefits:
- type validation - make sure incoming data uses the right types for the right fields
- required fields - make sure that mandatory fields are set
- defaulting - set defaults for fields
- documentation - schema definition for our API objects

Note that it does _not_ do:
- fail on unknown fields in data
- fail on a required field with an empty value

--- what replaces it

Based on the above, it may seem like JSON schema provides value.
But it's not the case, let's break it down one by one:
- type validation - unmarshaling JSON into a typed Go struct does this
- required fields - only checks that the field was provided, doesn't actually check that a value is set (e.g. `"name": ""` will pass the `required` check)
  - so it's pretty useless for any real validation
  - and we already have a separate place for proper validation - `CheckAndSetDefaults` methods
- defaulting - done in `CheckAndSetDefaults` methods
  - `Version` is the only annoying field, had to add it in a bunch of objects
- documentation - protobuf definitions are the source of truth for our API schema

--- the benefits

- performance - schema validation does a few rounds of `json.Marshal/Unmarshal` in addition to actual validation; now we simply skip all that
- maintenance - no need to keep protobuf and JSON schema definitions in sync anymore
- creating new API objects - one error-prone step removed
- (future) fewer dependencies - we can _almost_ remove the Go libraries for schema validation (one transient dependency keeping them around)

* Remove services.SkipValidation

No more JSON schema validation so this option is a noop.
2021-06-01 15:27:20 -07:00
Brian Joerger 9def18cb9f gRPC conversions - Nodes (#6535) 2021-04-28 18:27:12 -07:00