Commit Graph
24 Commits
Author SHA1 Message Date
Isaiah Becker-Mayer 9a06ca404c Windows Certificate SID Mapping (#19340) 2022-12-22 21:54:50 +00:00
Christopher Cooper 9c2192ebb6 Prepare sql server kinit authorization (#18299) 2022-12-06 22:55:20 +00:00
Nic Klaassen 962e5a25bc plumb context to keystore methods (#18034)
* plumb context to keystore methods

Contexts are more relevant now with the GCP KMS keystore which makes
http requests, this commit makes sure they are passed everywhere they
are needed, with only a few `context.TODO`s sprinkled in.
2022-11-10 18:57:17 -08:00
Nic Klaassen 46f0265546 cleanup: shrink/remove keystore interface (#17908)
* shrink/remove keystore interface

This commit introduces the keystore.Manager type to handle all
interaction between CA and the keystore backends.

Why:

* reduces the code that needs to be implemented per keystore backend to
  only the necessary operations
* separate concerns of managing key material and handling CA data
  structures
* define interfaces where they're used, not implemented
* delete net 245 lines of code
* reduce keystore.KeyStore stutter
2022-11-09 01:44:22 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Edoardo Spadolini 58b01b964b Embed auth.Cache in auth.Server (#14698)
* Embed auth.Cache in auth.Server

* Hit the backend during Auth initialization

* Bypass the cache when rotating CAs

* Services.UpsertTrustedCluster is different

* Bypass the cache in waitForTunnelConnections

* Fix infinite recursion

* More cache bypassing during init and rotations

* Rename Services to Uncached in auth.Server

* Further cleanups

* Don't start the auth cache immediately

* Go back to Services rather than Uncached

* Comments and a missing method
2022-07-27 21:05:53 +00:00
Jakub Nyckowski c4e28beb5c Fix Snowflake JWT token is invalid error. (#14121)
Use "account locator" instead of the "account name," when generating Snowflake JWT.
2022-07-06 22:34:46 +00:00
Jakub NyckowskiandMarek Smoliński 9c046930ff Snowflake integration (#12564)
Add Snowflake integration.

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-06-06 17:49:38 +00:00
Jakub NyckowskiandJim Bishopp 1f7a934584 Use new TLS key to sign DB cert during rotation (#11879)
Why
---
Current CA rotation require you to rotate the key 3 times
* `init` - to add new CA to the DB
* `update_clients` - to generate new client certificate and add it to DB 
* `standby` to remove the old CA from DB.

If any of the steps is skipped the integration will stop working as either Teleport or DB are not able to authenticate the connection.

Solution
---
Signing the client certificate with the new CA will allow to reduce the number of certificate updates and potencial DB restarts/reloads that should make the procedure simpler and less error prone. From now on the certificate will only need to be updated on `init` phase and after `standby` to remove the old CA.

Co-authored-by: Jim Bishopp <jamesbishopp@gmail.com>
2022-05-10 20:18:43 +00:00
Jakub NyckowskiandMarek Smoliński 1aa38f4bc5 Create Database CA (#9593)
Introduce Database Certificate Authority. New CA is used by Database Access to sign database certificates making them independent from Host CA. 

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-04-05 19:44:46 +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
Roman Tkachenko 288c5519ce Accept multiple SANs in tctl auth sign for databases (#8449) 2021-10-05 16:00:28 -07:00
Nic Klaassen a8db09fe1e Use KeyStore instead of raw keys with CAs (#7615) 2021-08-03 10:13:08 -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
Steven Martin fc1b6c4859 Update db.go 2021-06-23 10:10:06 -07:00
Steven Martin 1b269e2e52 Update db.go 2021-06-23 10:10:06 -07:00
Steven Martin aad24d7f71 db license message 2021-06-23 10:10:06 -07:00
Andrew Lytvynov d4247cb150 hsm: migrate CA storage schema (#7245)
* hsm: migrate CA storage schema

Migrate types.CertAuthorityV2 schema according to
https://github.com/gravitational/teleport/blob/master/rfd/0025-hsm.md#backend-storage

Includes proto changes, types.CertAuthority wrapper changes and data
migration.

Note that we keep and update the old fields for backwards-compatibility.
If a cluster is upgraded to v7 and then downgraded back to v6,
everything should keep working.

* Address review feedback
2021-06-16 12:17:03 -05:00
Brian Joerger 4d36870ff0 Remove remaining API aliases (#7137) 2021-06-08 12:08:55 -07:00
Brian Joerger 7bff7c41bd Remove API aliases (#6983) 2021-06-04 13:29:31 -07:00
Roman Tkachenko 21b90a64cf Add app and db access flags to license (#5627) 2021-02-22 08:35:08 -08:00
Brian Joerger c3e86f1696 Refactor API Dependencies - tlsca and gosaml2 (#5242) 2021-01-20 17:30:03 -08:00
Roman Tkachenko 8e1865464b Database access (#5005) 2021-01-14 18:21:38 -08:00