Commit Graph
35 Commits
Author SHA1 Message Date
Rafał Cieślak 0cdfa0b0ef Connect: Use SSH server UUID instead of hostname for file transfer (#21913)
* Add ResourceURI.GetServerUUID

* Use server UUID when calling TeleportClient.TransferFiles

* Mark removed FileTransferRequest fields as reserved
2023-02-17 10:24:12 +00:00
Rafał Cieślak 3ac5a0aedb Refactor prehog & teleterm protos to match project conventions (#20810)
* Adjust go_package of lib/prehog Go protobufs

This makes them follow the pattern set out by api/proto and proto.

* Adjust go_package of lib/teleterm Go protobufs

* Use single buf.gen.yaml to generate JS protos

This also entailed changing the location of lib/teleterm protos and changing
the value of their package specifier to match the conventions in other parts
of the codebase. This is a breaking change but that is fine for Connect
as the protos are used locally only and each build ships with matching
protobufs.

* Make web/packages/teleterm use protobufs from gen-proto-js

We used to copy protobufs over to web/packages/teleterm/src/services/tshd
since webapps used to be in a separate repo.

This is no longer the case, so we can just make teleterm use protobufs
from gen-proto-js.

* Move prehog & teleterm protos into proto/teleport/lib

* Generate JS protos to gen/proto/js

* Move lib/teleterm Go protobufs to gen/proto/go

* Move lib/prehog Go protobufs to gen/proto/go

* Rename lib/teleterm proto package

* Re-enable linter rules for teleterm & prehog

* Update prehogv1 path in usagereporter_test.go

* Use except instead of ignore_only to allow Google API-style responses

* Add UNARY_RPC to api/proto & proto

* Ignore gen/ when running addlicense

* buf-js.gen.yaml: Remove comment about lack of go_package for JS

* Move prehog protos to proto/prehog/v1alpha

* Adjust prehog's go_package to match proto package
2023-02-03 14:47:06 +00:00
Rafał Cieślak 6791b48da9 Remove grpc-teleterm Make target and Dockerfile-teleterm (#20032)
* Remove CLANG_FORMAT from Makefiles

It was used to format protos but we use Buf for that since v10.

* Move installing grpc_node_plugin into Dockerfile

This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.

* Replace Dockerfile-teleterm with Dockerfile

After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.

* Remove grpc-teleterm Make target in favor of grpc

* Add updated protobufs

It looks like they're a result of someone changing protos in lib/prehog
without running `make grpc-teleterm` separately. Which is why we're getting
rid of grpc-teleterm as a separate Make target in the first place. ;)
2023-01-26 09:41:07 +01:00
Tiago Silva 10da451dd6 Add support for subResourceName to teleterm (#20541)
Initial support for `subResourceName` when listing resource access requests for `type=pod`.
2023-01-23 15:06:01 +00:00
Grzegorz Zdunek 584e96efe0 Report Connect usage events (#19564) 2023-01-10 18:17:21 +01:00
Grzegorz Zdunek 25507e6ccd [Connect] Add authClusterId to cluster struct (#19829) 2023-01-04 14:05:02 +00:00
Michael 3877461d25 [Connect] Add SuggestedReviewers and RequestableRoles to LoggedInUser (#19466) 2023-01-03 16:01:56 -06:00
Alan Parra f28319a6b8 Add user-visible device trust settings (#19531)
Add device trust settings to teleport.yaml and cluster_auth_preference resource.

Example configuration (teleport.yaml):

```yaml
auth_service:
  authentication:
    device_trust:
      mode: "required"  # requires Teleport Enterprise
```

gravitational/teleport.e#514
2022-12-21 15:24:12 +00:00
Michael 1b5bd9824d [Connect] Add server hostnames in access request responses (#19258) 2022-12-20 14:33:47 -06:00
Rafał Cieślak cb3e4d99b7 Connect: Detect & reissue expired db certs (#17950)
* Add TTL field to integration/helpers.UserCredsRequest

This will let us create expired user certs by providing a negative TTL.

* Reissue gateway cert if middleware detects it expired

* Add integration test for gateway cert renewal
2022-12-06 12:32:04 +01:00
Michael b578dbca0f [Connect] Update create access request logic to differentiate between role/resource requests in tshd (#18867) 2022-11-29 19:34:17 +00:00
Rafał Cieślak 59a96be624 Connect: Check db cert before using it for local proxy (#18740) 2022-11-29 10:11:57 +00:00
Rafał Cieślak 769719f2ec Connect: Set up tshd-initiated communication (#17660)
* Move cred generation one layer up

* Create tshd events client

* daemon.Service: Add closeContext for gRPC calls
2022-11-08 10:04:00 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Michael c8c02c4ff4 [Connect] Add Server Features to GetCluster (#17497)
To enable feature detection in the Connect application, we need to
ping the auth server to understand which features are enabled.
Previously, we could get away with any cluster information stored in the
cluster profile but a proxy dial is necessary now to get an auth ping response.
2022-10-20 20:21:58 +00:00
Alan Parra b289295f93 Move away from deprecated protoc-gen-go plugin (#17267)
Moves from github.com/golang/protobuf protoc-gen-go plugin to google.golang.org/
plugins.

This change was a long-time coming, but is now possible to do since our
dependencies are up-to-date.

* Move away from deprecated protoc-gen-go plugin
* Embed unimplemented server in handler.Handler
* Embed unimplemented server in multiplexer_test.go
* Update generated protos
2022-10-13 14:01:44 +00:00
Michael 87325be703 [connect] access requests for Teleport Connect (#16694)
* access requests for teleterm

* removed unused imports and named returns

* remove comment

* using timestamppb instead of string for access requests

* updated proto with some more comments

* updated protos with comments

* using clusterClient, comments, and moving validation to daemon for access request delete

* separated GetAccessRequests into separate RPCs

* protobuf updates

* moved requestid check before resolving cluster

* fullstops in comments

* used standard access_request_id through rpc messages

* updated protofiles

* updated daemon service types to match grpc

* added kube advanced search support

* updated protos for kubes in access requests

* testing tag build

* fix detached head

* new tag build

* protobuf update

* lint fixes

* allow drone windows Connect build to include webapps.e

* protobuf files

* remove drone changes and updated comment

* proto changes with comment fixes and changed field order

* protobuf updates
2022-10-11 18:52:16 -05:00
Alan Parra f9f0ca339e Bump grpc-related dependencies (#17265)
Bumps:

* protoc to v3.20.3
* protoc-gen-go to v1.5.2 (github.com/google/protobuf version, Teleterm only)
* google.golang.org/grpc to v1.50.0
* google.golang.org/grpc/examples
2022-10-11 14:29:01 +00:00
Grzegorz Zdunek 2c6a898983 Add file transfer support to Connect (#16880) 2022-10-10 11:09:08 +00:00
Alan Parra fbc135e672 Add comment and import cycle proto linters (#16082)
Require top-level proto types to have comments and introduce import cycle linter.
2022-09-02 13:31:45 +00:00
Rafał Cieślak 9397d4a309 Connect: Add tests for ParseClusterURI (#15863) 2022-08-30 09:59:04 +00:00
Alan Parra 49e3c0d6d0 Use Buf linters and formatter on lib/teleterm protos (#15877)
Similarly to #15856, moves lib/teleterm fully to Buf.

#15187

* Fix buf lint warnings on lib/teleterm
* Enable buf build and lint for lib/teleterm
* Use buildbox Buf in Connect, enable build/lint/format
* Reformat protos
* Update generated protos
2022-08-29 19:45:03 +00:00
Grzegorz Zdunek bcd480ca08 Reorganize approach to cluster names in Connect (#15200) 2022-08-17 17:38:37 +02:00
Lisa Kim 13cc52f70d Add passwordless login capability to Connect (#14759) 2022-08-05 17:11:28 +00:00
Rafał Cieślak 21b21bf069 Connect: Implement SetGatewayLocalPort RPC (#14690)
* Encapsulate rather than embed Config within Gateway

* Implement SetGatewayLocalPort RPC
2022-07-25 11:15:53 +00:00
Jakub NyckowskiandRafał Cieślak c3dde989cc Update protoc to v3.20.1 (#14097)
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2022-07-07 23:21:32 +00:00
Rafał Cieślak a7760a4f71 Teleport Connect: Add SetGatewayTargetSubresourceName RPC (#13476)
* clusters.CreateGateway: Trim spaces when building a CLI command

If cliCommand.Env is empty, the returned command has an empty space at
the front.

* Do not pass TargetSubresourceName when fetching certs for gateway

Since we want to be able to freely specify the db name after the gateway
creation, let's not pass the db name when creating the gateway to show
the intent more clearly.

* Make CLICommand a method on Gateway rather than a field

* Extract getting cluster by resource URI to Storage
2022-06-27 13:43:48 +00:00
Rafał Cieślak 84468a00a7 Add endpoint for restarting gateways in Teleport Connect (#13191)
* Add RestartGateway RPC

* Add daemon.Service.RestartGateway

It's a fusion of both Service.RemoveGateway and Service.CreateGateway.

Both of those methods used to hold the mutex from Service, so I created
private versions of them which assume that a public method holds
the mutex instead.

This way I was able to reuse both methods in RestartGateway.
2022-06-08 12:55:12 +00:00
Rafał Cieślak 2cb7d99523 make buildbox-grpc-teleterm: Format proto files (#12762) 2022-06-06 13:06:57 +00:00
Grzegorz Zdunek d9deaff3d4 Add proxy_host and temporary actual_name fields to the cluster response object (#12234) 2022-04-28 09:24:21 +00:00
Rafał Cieślak b3db804fc7 Teleport Connect: Accept database name when setting up proxy (#12173)
* Add target_subresource_name to proto files

* Pass database name when creating certs and CLI command
2022-04-26 09:38:56 +00:00
Rafał Cieślak 856f0920c3 Expose RoleSet.EnumerateDatabaseUsers to Teleport Terminal (#12070) 2022-04-21 09:13:46 +00:00
Rafał Cieślak 60f59725a9 Generate DB CLI commands for Teleterm from tsh daemon (#11835)
* Extract dbcmd.go into a new package under lib/client/db/dbcmd

* Use dbcmd to generate CliCommand for gateways

* Return relative db command from tsh daemon

* Add WithTolarateMissingCLIClient func to dbcmd
2022-04-14 08:29:26 +00:00
Rafał Cieślak 113ac5344e Use oneof for LoginRequest params
The login is either local or SSO but not both.
2022-04-01 13:02:56 +02:00
Alexey Kontsevoy 4d0c0b2c84 teleterm (alpha) 2022-04-01 13:02:56 +02:00