Commit Graph
196 Commits
Author SHA1 Message Date
Michael 9c55a33e01 Add Unified Resource watcher (#28296)
* Adds a UnifiedResource watcher to the auth server. This watcher
will watch all the types that are displayed in the web UI and store
them in-memory to allow us to search/filter/query and get multiple
kinds returned at the same time.
[RFD](https://github.com/gravitational/teleport/pull/28162)

* Add ListUnifiedResources gRPC and web endpoints (#29661)

Adds the `ListUnifiedResources` grpc endpoint that returns paginated unified resources and exposes it in the web apiserver

* Fix test
2023-08-14 21:13:46 +00:00
64d3e8c505 Add discovery for Kubernetes apps (#28988)
* Add discovery for Kubernetes apps

* Address review comments

* Init nil slice instead of empty one

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

* Improve comment wording.

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

* Optimize discovery clients initiation code

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

* Combine var usages

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

* Fix error message

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

* Handle the error

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

* Remove unneeded input

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

* Use once for kubernetes client getter

* Simplify clients structure for discovery

* Add umbrella field for discovery matchers

* Move port protocol detection into discovery

* Add automatic protocol detection to the Kuberentes fetcher

* Simplify kube apps discovery test

* Return concrete fetcher instead of interface

* Remove parallelization of a test.

* Fix race condition in the test

* Fix after rebase

* Address review comments

* Use var instead of empty slice

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

* Optimize switch

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

* Decapitalize error message

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

* Use var instead of empty slice

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

* Use t.Parallel()

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

* Remove unneeded test parameter

* Use t.Parallel()

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

* Use var instead of empty slice

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

* Fix tests

* Improve wording.

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Address review comments

* Refactor discovery clients location

* Fix flaky tests

* Fix comment

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

* Address review comments

* Fix tests after rebase

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2023-08-09 14:44:58 +00:00
Michael Wilson 54c7343c9b Add user login state to the cache. (#30139)
* Add user login state to the cache.

The user login state has been added to the cache. This will allow user login
state lookups to be quickly looked up on login.

* Add in user login state service to attach to cache.

* Use fallback for user login state.

* Defer after checking branch, address new logger.
2023-08-09 02:53:03 +00:00
Tiago Silva 1178971b3d Remove GetAppSessions and deprecated DatabaseServerSpecV3 fiels (#30141)
This PR removes `GetAppSessions` functions in favor of
`ListAppSessions`.

It also removed all the deprecated fields in the `DatabaseServerSpecV3`
message.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2023-08-08 16:59:46 +00:00
Mike Jensen 1022fe926c collections.go: Fix Memory Aliasing in getAll (#30127)
Resolved a memory aliasing issue flagged by gosec in the getAll function.  The issue being reuse of the loop variable's memory address.
This commit fixes the issue by creating a unique variable per loop iteration, avoiding the aliasing.
2023-08-07 15:14:23 +00:00
Brian Joerger 29ff71ef09 Implement headless watcher approval logic in the Electron App. (#29097) 2023-08-01 18:44:47 +00:00
Michael Wilson d9ea2061d7 Add the AccessList to the cache. (#29119)
* Add the AccessList to the cache.

The AccessList has been added into the cache. The AccessList resource
and its supporting resources had to be moved back into api for this so that
it can be properly referenced in api/client/events.go, which is necessary
for cache propagation.

* Address remaining lib/types references.

* Add in additional test to events_test.go.

* GCI.

* Add back in client wrapper so that the cache will work properly.

* Traits ToProto order is deterministic.

* Add in compile time access list client check.
2023-07-18 15:29:22 +00:00
Michael Wilson 983e0cc611 Support non-gogo objects for auth service events. (#29056)
* Support non-gogo objects for auth service events.

Auth service events will now support non-gogo objects. This was done by
generating the events and associated objects with regular go protobuf
instead of gogo and then correcting the code for the differences in
code generation.

* Correct lock copying in event protobuf.

* Temporarily ignore event.proto in buf breaking.

* Attempt to keep buf breaking from breaking.

* Remove comment.

* Rename gproto to googleproto.

* Rename api/client/proto import to authpb and googleproto to proto.

* Correct comment, add in test exercising proto.Equal.

* GCI.

* Events test actually does work.
2023-07-17 15:32:03 +00:00
Gabriel Corado a62b109b87 Move database validation to gRPC methods (#28619)
* refactor: move database validation to grpc

* test(local): update CRUD databases test
2023-07-04 13:39:17 +00:00
Brian Joerger f7bd643652 * Enable headless authentication event watch. (#28234)
* Add WatchPendingHeadlessAuthentications rpc.
2023-06-28 18:03:53 +00:00
Michael Wilson 4bc2c04e63 Add mapping between user groups and applications. (#27812)
* Add mapping between user groups and applications.

Within Okta, user groups can assign permission to many applications and
applications can belong to many user groups. This commit establishes that
mapping so that the Okta service can perform more user friendly access
requests by adding all applications from a user group to the access request
and additionally allowing application access requests to request associated
user groups as well.

* Adjust NewUserGroup to take a spec.
2023-06-16 17:52:31 +00:00
Edoardo Spadolini 94aea6f188 Pass context through UpsertAuthServer (#27867)
* Pass context through UpsertAuthServer

* Pass context in (*ProcessStorage)GetState
2023-06-15 14:52:21 +00:00
Edoardo Spadolini 604ad19791 Delete proxy heartbeats on graceful shutdown (#27686)
* Pass the context through DeleteProxy

* Delete proxy heartbeats on graceful shutdown

* Pass context through UpsertProxy

* Tweak logging

* Move heartbeat deletion to proxy.shutdown
2023-06-12 18:18:57 +00:00
Michael Wilson 892883fbcd Simplify Okta assignment statuses. (#25166)
* Simplify Okta assignment statuses.

The Okta assignment statuses have been simplfieid so that there's only a
status on the Okta assignment object itself and the number of states is
reduced.

* Fix tests, remove unused code.

* Add in Duration for update statuses to prevent changing status too soon.

* Make sure LastTransition is UTC.

* Remove actions in favor of targets, make cleanup time non-nullable.
2023-04-26 13:30:10 +00:00
Andrey Bulgakov 5b2998a455 Generic read guards (#24425) 2023-04-15 20:52:16 +00:00
Andrey Bulgakov ad80fa3e17 Partial cache healthiness (#24080)
* Partial cache healthiness

* IsSupersetOf -> Contains

* NewWatchStatus fixes

* make map[kindSubKind]types.WatchKind with capacity

* fixed TestRootNetwork?

* post-rebase fix

* fixes regarding docs/comments

* const noSubKind = ""

* preallocate slices for validKinds

* DisablePartialHealth

* test fixes

* fixed struct logging field name

* use custom identity in TestEventsPermissionsPartialSuccess

* fixed TestNodeCAFiltering

* don't look at versions in events APIs

* RFD state: implemented
2023-04-15 20:07:43 +00:00
Michael Wilson 3906b36c0e Allow the Okta role to read the cluster name. (#24538)
The Okta role is now able to read the cluster name.
2023-04-13 15:59:51 +00:00
Marco André Dinis c0e5e1a1ef Integration: add service to server and client (#24133)
* Integration: add service to server and client

* Add cache for Integration to Proxy

* Add RO for Integration resource for Proxy role
2023-04-12 11:34:21 +00:00
Michael Wilson f958facdac Add CA, Role, Lock AuthPreference RO persmissions to RoleOkta. (#24089)
* Add CA, Role, Lock AuthPreference RO persmissions to RoleOkta.

RoleOkta now has read only access for CertAuthority, Role, Lock, and
ClusterAuthPreference objects so that it can utilize an authorizer when
redirecting apps.

* Remove lock from Okta cache, remove tasks*.go.
2023-04-11 15:44:56 +00:00
ef8da1724e Security fixes 03/23 (#23864)
* Prevent tunneling if the os login doesn't exist

A user.Lookup was added to srv.RunForward to prevent dialing
and forwarding any data if the os login is not found. The check
alone only terminates the direct-tcpip ssh channel and not the
underlying ssh connection.

In order for the parent process to determine if the ssh connection
should be terminated it needs to know why the child exited. That was
not possible by looking at the exit code and any data written to
standard error of the child process was forwarded to standard error
on the parent; which was used to simply log the error and move on.
To pass more detailed errors to the parent, the child process spawned
by srv.RunForward now json marshals the trace.Error to standard
error which is then decoded by the parent process. If the parent
detects the error was due to a missing user it terminates the ssh
connection.

tsh ssh -N was also modified to terminate if the command context
of tsh OR the ssh connection to the node is closes. Prior, it
only terminated if the user cancelled the process by blocking on
ctx.Done(). While this was necessary to end session if the os
login does not exit, it also forces tsh to exit if the node
goes offline.

Note: This does not include any propagation of error messages to the user,
so there won't be any indication from tsh about why the connection was closed.
The session also will not be terminated until the first attempt to forward data and
NOT when the session is created due to the way -N is implemented.

Fixes #217

* Prevent unauthorized access to kube clusters by upserting kube_servers

This PR changes the behavior of the kubernetes_service when validating access
to kubernetes clusters. Previously, the kubernetes_service would use the first
kubernetes cluster it found in the Auth server backend to validate access. This was
problematic because if the first kubernetes cluster was upserted with a
the same name as a kubernetes cluster the user was trying to access but
with different labels, the user would be able to access the cluster even
though they shouldn't be able to.

This PR changes the behavior of the kubernetes_service to use the
in memory kubernetes cluster representation used for heartbeats
instead of relying on the information received from the auth server. This would
block the user from accessing the cluster if the cluster was upserted
with a different set of labels since the kubernetes_service would not
have the updated labels in memory and would deny access.

Fixes #469

---------

Co-authored-by: Tim Ross <tim.ross@goteleport.com>
Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2023-03-31 21:55:13 +00:00
Michael Wilson c5d54c411c Allow Okta service reverse tunnel access. (#23702)
* Allow Okta service reverse tunnel access.

In order to allow the Okta service to be connectable via the reverse
tunnel, the following things were added.

* The cache has permissions to retrieve cluster configuration objects.
  While here, I removed access to the App objects, which was not necessary.
* The permissions have been updated to allow for AppServer access and
  ClusterNetworkingConfig access.
* The cache has been updated to cache app servers and cluster networking
  configuration resources. While here, access to App objects has been
  removed.
* The reverse tunnel now recognizes the Okta role.

* Add in ListResources to the Okta access point.

* Remove access to apps and to access requests.

* Add in Semaphore read/write permission.

* Include cache entry for app server. Remove read access for access request.
2023-03-30 16:10:57 +00:00
Michael Wilson d1708a3095 Refactor UserGroups local service to use generic service. (#23548)
* Refactor UserGroups local service to use generic service.

The UserGroups local service now uses the generic service. This came about
due to a bug in the pagination logic for the user group listing. This fixes
that issue and simplifies the user group service logic.

* Turn *Svc vars into *Cache vars to make things uniform.
2023-03-24 17:19:30 +00:00
Michael Wilson 0225f94dc4 Add application RW permissions to the Okta role. (#23525)
* Add application RW permissions to the Okta role.

Application read/write permissions have been added to the Okta role along with
modifications to the cache and to the OktaAccessPoint to support application
object management.

* Add in app label wildcards.
2023-03-24 13:42:46 +00:00
Forrest 924dcdd664 reduce cache retry load (#23025)
* add exponential backoff

* improve cache backoff
2023-03-21 05:03:51 +00:00
Michael Wilson 547d9773e7 Introduce Okta objects into the cache. (#23059)
* Introduce Okta objects into the cache.

The OktaImportRule and the OktaAssignment objects have been added into the
cache. This takes a slightly different take than has been done previously
because the Okta service lives outside of the `auth.ClientI` interface.
However, the additions are pretty straightforward.

* Export NewLocalCache for enterprise.

* Add the Okta services into , fix missing events for the Okta resources.

* Re-add err check for Okta client.

* Add in comment clarifying the usage of access requests in the Okta service cache.

* Add in user groups to Okta cache.
2023-03-20 20:18:58 +00:00
rosstimothy b0dc78610e Migrate upserting CAs to gRPC (#23140)
Adds `UpsertCertAuthority` to the `teleport.v1.trust.TrustService`
and deprecates the HTTP api. The `services.Trust` interface was
also updated to include a `context.Context` in both
`CreateCertAuthority` and `UpsertCertAuthority.

To ensure backwards compatibility the `auth.Client` will first
attempt to use the gRPC client and if that fails with a not
implemented error it will fallback to using HTTP.

Part of #6394
2023-03-16 14:46:43 +00:00
rosstimothy f02468e9fb Migrate the delete ca api to gRPC (#23070)
Adds `DeleteCertAuthority` to the trust grpc service and deprecates
the legacy HTTP api. Additionally the `DeleteCertAuthority` method
in the `services.Trust` interface now takes a `context.Context` as
the first parameter. In order to plumb the context through from all
the call sites `DeleteRemoteCluster` from `services.Presence` was
also modified to take a `context.Context` as the first parameter.
2023-03-15 13:11:37 +00:00
rosstimothy 9d066364a8 Migrate GetCertAuthorities to gRPC (#22985)
Adds a new `GetCertAuthorities` unary RPC to
`teleport.v1.trust.TrustService` and deprecates the equivalent
HTTP endpoint. All associated interfaces have been updated to remove
the marshal options as well.
2023-03-14 14:45:01 +00:00
Michael Wilson 144992b67f Fix locks not propagating in cache. (#23010)
The locks were not being properly upserted to the cache after the collections
refactor. This was due to a typo when writing the `upsert` logic for the locks
collection.
2023-03-14 00:26:35 +00:00
Tiago Silva 674a3a1ec1 Removes deprecated KindKubeService objects (#22663)
This PR removes the `types.KindKubeService` objects that were
deprecated in Teleport 11.

Teleport 12 removed the double heartbeat and for Teleport 13 we can
safely drop the support of the old hearbeat based on `types.Server`
objects.

Clients older than Teleport 12 connecting to a Teleport 13 server will
fail since they cannot heartbeat using the old mechanism.
2023-03-13 10:55:39 +00:00
rosstimothy 95d6d0fee1 Migrate GetCertAuthority to gRPC (#22624)
The HTTP client created by `auth.NewClient` has an idle timeout of
30s and each instance periodically gets cert authorities in
`TeleportProcess.syncRotationStateCycle`. If there has been no
activity when the ticker expires then the request will result in a
brand new connection to Auth to be established. This can cause a
spikes in open file descriptors on the Proxy when there are a large
number of instances connected via a tunnel.

To prevent periodic dialing when retrieving cert authorities the
endpoint has been migrated to the new Trust gRPC service. For now
only the get endpoint has been migrated but the rest of the CRUD
operations for cert authorities should be migrated from the HTTP
api to the gRPC service as well.
2023-03-10 14:32:34 +00:00
Michael Wilson 80aaf610ef Refactor cache collections. (#22352)
Most of the cache collections had an extremely similar structure. Where
possible, the cache collections have been adjusted to make use of common
functions to minimize the amount of duplication within the cache collections.
2023-03-07 18:07:52 +00:00
Forrest aaee695927 node hb and watcher scalability improvements (#21490)
* node hb and watcher scalability improvements

* ensure that node has ample time to hb

* fix degraded state

* hbv2 test cov
2023-03-03 17:39:00 +00:00
rosstimothy cb3b6febcd Remove network I/O from database_service collection apply (#22397)
All network I/O should be done in the cache collection fetch and
not the appy function returned from fetch. This moves the
`ListResources` request for database services out of the apply
function to be compliant with the collection requirements.
2023-03-03 14:31:41 +00:00
MichaelandJeff Pihach d94fed7b0d Add static and dynamic web ui configuration options (#21945)
* Add UiConfig option to proxy service config

* Add uiConfig to GRV_CONFIG window object and use in terminal constructor

* Update configuration reference docs

* Remove extra structs and change property to scrollbackLines

* Update web/packages/teleport/src/config.ts

Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>

* Use a common struct and apply in applyProxyConfig

* Remove webclient dependency for fileconf

* Add missing doc comments

* Set individual properties of cfg.Proxy.UI

* Remove unneeded comment

* Add nolint rule

* Fix nolint

* Add test for UIConfig

* Cleanup tests

* Fix TestUIConfig context

* Allow dynamic config for web ui (#22097)

* Update protofiles

---------

Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>
2023-02-28 17:45:52 +00:00
Michael Wilson 14baf098ea Simplify the cache tests. (#22237)
* Simplify the cache tests.

Several of the cache tests had a very similar structure. Where possible, these
have been adjusted such that all tests with similar structures use a generic
testing function that executes the same logic on each resource type.

* Re-add t.Parallel() for namespaces.
2023-02-27 17:43:43 +00:00
Michael Wilsonandrosstimothy d530f33b5c Create a generic local backend service. (#21078)
* Create a generic local backend service.

Many of the local backend services have a very similar pattern in terms of how
objects are retrieved and stored. This PR introduces a generic backend which
implements backend retrieval and storage of objects and migrates the SAML
IdP service provider service to it. More services could easily be migrated
to this generic service implementation.

* Feedback, add in generic tests.

* Tim's feedback, added in a test for updating a resource that doesn't exist.

* Tim's feedback.

* Apply suggestions from code review

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

* Edoardo's feedback.

* Added in UpdateAndSwap.

* Edoardo's feedback, Tim's feedback.

* Use a default page size if the page limit is not specified.

* More of Edoardo's feedback.

* Propagate error instead of panic.

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2023-02-24 15:59:16 +00:00
Michael Wilson 9527b6518c User group API and cache. (#21956)
The user group has been added to the API and to the cache.
2023-02-22 18:45:11 +00:00
Michael Wilsonandrosstimothy 2249d1cc17 SAML IdP sessions added to the API and cache. (#21937)
* SAML IdP sessions added to the API and cache.

SAML IdP sessions have now been added to the API and to the cache.

* Update lib/auth/sessions.go

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

* Revert changes to types.proto.

* Fix missing session ID, misnamed variable, gRPC update.

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2023-02-21 17:26:10 +00:00
Michael WilsonandEdoardo Spadolini d29cc6e797 Extract entity ID when creating SAML service provider. (#21375)
* Extract entity ID when creating SAML service provider.

The entity ID will be parsed from the entity descriptor metadata when the
service provider's entity descriptor is set. The motivation of this PR is to
do the following:

* Extract the entity ID from the entity descriptor during the creation of the
  SAML IdP service provider.
* Prevent the creation of service providers in the backend that have an
  entity ID that does not match the entity ID represented in the entity
  descriptor.
* When reading or listing service providers, prevent the parsing of every
  entity descriptor during the listing.

The goal here is to make it performant to look up entity descriptors by their
entity ID without incurring the cost of parsing every single entity descriptor
to determine the entity ID.

* Feedback, eliminating the parsing from the object, pushing parsing verification into the local service.

* Fix up tests, e_imports.

* Fix comment in types.proto.

* Remove dead comment.

* Deduplicate entity ID in update as well.

* Small refactor to move parse out of lock.

* Remove XML parsing from type, fix grpcserver test, fix locking boundaries.

* Tim's and Edoardo's feedback.

* Fix cache test.

* Update lib/services/local/saml_idp_service_provider.go

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Expanding the comments on the EntityID field.

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-02-09 21:06:41 +00:00
Michael Wilsonandrosstimothy d619d303db Add SAML IdP service providers to the cache and CLI. (#21218)
* Add SAML IdP service providers to the cache and CLI.

SAML IdP service providers have been added to the cache and are now manageable
via the CLI. Some alterations to role permissions have occurred to ensure that
the system and users can manage these.

* Tiago's feedback.

* Update tool/tctl/common/collection.go

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

* Tim's feedback.

* Update lib/cache/collections.go

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

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2023-02-08 17:01:10 +00:00
Edoardo Spadolini 86df3aa981 Loop over the CA type list in collections (#21292)
* Loop over the CA type list in collections

Also adds a NewlyAdded method to CertAuthType to indicate the CA types
that have been added in the current major version, so that we can
ignore any related BadParameter error when handling those kinds of CAs
with potentially older versions of Teleport.

* Mention NewlyAdded in the CertAuthType description
2023-02-06 17:50:43 +00:00
42cb80c3e4 Adding in a new SAML IdP certificate authority. (#21159)
* Adding in a new SAML IdP certificate authority.

A new SAML IdP certificate authority has been added. It has been added to
initialization, the cache, and the certificate can be rotated.

* Update lib/services/authority.go

Co-authored-by: Sam Freiberg <sfreiberg@goteleport.com>

* Update api/types/trust.go

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Only validate private key if it's present.

---------

Co-authored-by: Sam Freiberg <sfreiberg@goteleport.com>
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-02-03 15:56:56 +00:00
Marco André Dinis 2576781f78 DatabaseService: move Upsert op to DBServicesService (#20930) 2023-01-31 07:40:25 +00:00
Marco André Dinis 7c3fdeb60b Update Cache for Proxies using pre-v13 versions (#20759) 2023-01-26 18:13:25 +00:00
Andrew LeFevre e71f024a9f Add OpenSSH CA (#20020)
* WIP adding OpenSSH CA

* fix creating OpenSSH CA for tests

* fix a test name and tctl usage flag

* fix 'tctl status' not displaying openssh CA sometimes

* add OpenSSH CA to TestInit_bootstrap, remove TLS key pair

* add OpenSSH CA to a few more places

* make help text of 'tctl auth rotate' more helpful and accurate

* fix web cert export test

* tbot doesn't need to know about OpenSSH CA

* address feedback

* fix comment formatting
2023-01-13 18:23:19 +00:00
Marco André Dinis bc44e79ae1 Update watched resources for RemoteOldProxy cache (#20039)
Update the version we should check against: v12 (the current in master)

Update the list of resources to watch for RemoteOldProxy.
The list should be equal to the RemoteProxy as seen in `branch/v11`

As soon as we cut v12, we should update this again in master because
we'll be preparing v13.
2023-01-13 15:01:12 +00:00
STeve (Xin) Huang 48fbd369ed Enable database fetchers for discovery service (#19739) 2023-01-13 14:03:06 +00:00
rosstimothy 3aa295c87c Convert usages of types.NewRoleV3 to types.NewRole (#19793)
Closes #14345
2023-01-11 16:58:22 +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