Commit Graph
793 Commits
Author SHA1 Message Date
Andrew Lytvynov ac9ba539ce Use cmp.Equal instead of manual Equals methods (#5828)
* Use cmp.Equal instead of manual Equals methods

Equals methods can get out-of-sync with the fields added in structs they
compare. Using `cmp.Equal` handles that, removes a ton of code and makes
it more explicit when specific fields are excluded from comparison.

* Use gogoproto equal plugin for comparing proto values

This will be faster than reflect-based go-cmp.
2021-05-06 11:47:31 -07:00
Roman Tkachenko db6fb57dae Add app access headers rewrite (#6601) 2021-05-06 11:24:49 -07:00
Brian Joerger f533872a25 Upgrade api's trace dependency to 1.1.15 (#6341) 2021-05-03 16:27:51 -07:00
Andrew Lytvynov 889acd83b4 Delete unused RoleWeb
RoleWeb is not used by any service. Clean it up.
2021-05-03 21:24:08 +00:00
Brian Joerger 9def18cb9f gRPC conversions - Nodes (#6535) 2021-04-28 18:27:12 -07:00
Andrew Lytvynov 4b11dc4a8e mfa: better OTP registration flow on CLI (#6567)
Several improvements:
- show a QR code in the system image viewer
- print an OTP URL in addition to individual fields (some apps accept
  that as input)
- use cluster name as `Issuer` instead of "Teleport"
2021-04-27 10:42:16 -07:00
Andrej Tokarčík 72c93ae86b Handle tctl get's input ref more strictly (#5818)
For some resource kinds, `tctl get` used to always return the list of
all resources of that kind, irrespective of whether a specific resource
name was given in the argument to `tctl get`.

For instance, `tctl get node/node-id` would have always listed all the
nodes (just like mere `tctl get node`).

Here, all `tctl get` handlers are adjusted to filter by name when a name
is provided as part of the input ref.
2021-04-27 15:59:46 +02:00
Justinas StankevičiusandAlexander Klizhentas 10d1788859 Fix doc comment for Rule.HasVerb (#6598)
Co-authored-by: Alexander Klizhentas <klizhentas@gmail.com>
2021-04-26 15:56:49 -07:00
Roman Tkachenko a3d39e3810 Add redshift auth support to database access (#6479) 2021-04-26 11:53:10 -07:00
Andrej Tokarčík 1d17aea01d Add tctl create cap for dynamically configuring cluster auth preference (#5635)
See rfd/0016-dynamic-configuration.md § Implementation.
2021-04-26 20:27:34 +02:00
Roman Tkachenko d67e11ff2d Adding postgres_public_addr and mysql_public_addr (#6426) 2021-04-21 19:52:52 -07:00
Brian Joerger d830ed6db7 Refactor api package and docs to use pkg.go.dev effectively. (#6388) 2021-04-20 16:44:17 -07:00
Andrej Tokarčík 8b3e50dd61 Convert types.AuthPreference into a proto definition (#6510) 2021-04-20 11:27:03 -07:00
Lisa Kim 7931977d72 [web] Add ability to switchback to default roles/expiry (#6373)
- Preserve login time with WebSession when user first creates a web session to derive
"default" expiry when user wants to switch back
- Change the signature of ExtendWebSession to accept a 
NewWebSessionRequest struct that contains session information
- Create renewSessionRequest object to read from web request for endpoint renewSession
- Endpoint now also returns SessionExpires time that is used as countdown in UI
2021-04-19 18:53:09 -07:00
Roman Tkachenko 8230d6e436 Capture postgres extended protocol messages in audit log (#6303) 2021-04-14 13:39:59 -07:00
Brian Joerger 11594a0418 Update docs on oidc prompt logic for 6.1+. (#6427) 2021-04-13 11:18:29 -07:00
Brian Joerger 5e3f2359a4 Add DialOpts and CallOpts to API client. (#6301)
* Add DialOpts to client.Config.

* Add callOpts to client and client.WithCallOptions.

* Refactor use of atomic closedFlag.
2021-04-07 14:23:34 -07:00
Andrew Lytvynov 1e7a369b26 web: fix AccessRequest loading on user cert reissue (#6264)
Load access requests from SSH cert instead of the profile. The profile
only exists on CLI clients, but not in the proxy.

Note: theoretically, SSH cert may be missing in some cases for CLI
clients. We should eventually encode access requests in TLS certs too,
which are always present.
2021-04-06 16:20:04 -07:00
Andrew Lytvynov 6d200faecb tsh: handle missing cluster name in profile (#6257)
Cluster name can be missing in profiles created by older tsh versions.
Trying to load the client.Key without a cluster name now causes a
failure when using WithAllCerts (because ssh/db/kube certs are
per-cluster).

Also added some output to `tsh status` when no profiles can be loaded.
2021-04-02 11:00:15 -07:00
Brian Joerger 826ed676fa Refactor ssh.ClientConfig used by tctl and API clients to use the first valid principal as User. 2021-03-30 17:53:29 -07:00
Gus Luxton 854da48990 Add lint-api target and fix lint errors (#6169) 2021-03-30 17:02:04 -07:00
Brian Joerger ee57e539b5 tsh Profile SSH certs fix (#6214) 2021-03-30 12:10:52 -07:00
Andrej Tokarčík 52dfeec63e Cache per-cluster SSH certificates under ~/.tsh (#5938)
```diff
 ~/.tsh/
 └── keys
    ├── one.example.com            --> Proxy hostname
    │   ├── certs.pem              --> TLS CA certs for the Teleport CA
    │   ├── foo                    --> RSA Private Key for user "foo"
    │   ├── foo.pub                --> Public Key
-   │   ├── foo-cert.pub           --> SSH certificate for proxies and nodes
    │   ├── foo-x509.pem           --> TLS client certificate for Auth Server
+   │   ├── foo-ssh                --> SSH certs for user "foo"
+   │   │   ├── root-cert.pub      --> SSH cert for Teleport cluster "root"
+   │   │   └── leaf-cert.pub      --> SSH cert for Teleport cluster "leaf"
```

When `-J` is provided, this also loads/reissues the SSH cert for the cluster associated with the jumphost's certificate. Fixes #5637.
2021-03-29 14:14:31 -07:00
Forrest Marshall 7d4c1ea6cf add special resource type for access plugin data 2021-03-29 13:30:48 -07:00
Brian Joerger f15ceee373 Convert Token CRUD endpoints to gRPC. (#6105) 2021-03-26 19:23:20 -07:00
Brian Joerger c7d84c45d7 Convert Trusted Cluster CRUD endpoints to gRPC. (#6103) 2021-03-26 18:29:39 -07:00
Brian Joerger b1bb78a9e0 gRPC conversions - GithubConnector (#6101) 2021-03-26 17:16:49 -07:00
Brian Joerger 0076893155 gRPC conversions - SAMLConnector (#6100) 2021-03-26 16:39:27 -07:00
Brian Joerger 06d252ffca gRPC conversions - OIDCConnector (#6067) 2021-03-26 15:52:16 -07:00
Forrest Marshall bc2203673d ignore dangling tunnel conns 2021-03-26 14:11:02 -07:00
Brian Joerger 3d6ecb05cd Remove duplicate sshutils package from merge failure. (#6165) 2021-03-25 19:33:24 -07:00
Brian Joerger 0540755624 Profile credentials dialer fix (#6122) 2021-03-25 17:55:49 -07:00
Brian Joerger c891bae327 Combine common crud proto messages into generic messages in types.proto. (#6058) 2021-03-25 14:25:37 -07:00
Brian Joerger 31ee2a4c04 Move usage of predicate package out of api. (#6136) 2021-03-24 18:48:07 -07:00
Forrest Marshall 59d2379b94 custom approval conditions 2021-03-24 14:33:40 -07:00
Lisa Kim 84a4f00114 Define cloud billing event types and codes (#6037)
* Exported auth.clientImpersonator and auth.clientUsername for use in e
2021-03-23 17:23:01 -07:00
Brian Joerger 32c4ae255f Add Credential loader support for tsh profiles. (#5993) 2021-03-23 16:35:42 -07:00
Andrew Lytvynov 8492f62d43 u2f: add optional attestation cert validation (#6057)
By specifying `device_attestation_cas` in `teleport.yaml`, admins can
restrict U2F device manufacturers. For example, specifying the yubico
attestation CA
(https://developers.yubico.com/U2F/yubico-u2f-ca-certs.txt), you can
restrict users to only yubikeys.

Example error when using the yubico CA and trying to register a Google
Titan key:

```
$ tsh mfa add --type u2f --name test && tsh mfa rm test
Tap any *registered* security key
Tap your *new* security key
ERROR: rpc error: code = InvalidArgument desc = U2F device attestation certificate is signed by "CN=Security Key,O=Google", but this cluster only accepts certificates from ["CN=Yubico U2F Root CA Serial 457200631"]; make sure you're using a U2F device from a trusted manufacturer
```
2021-03-23 15:14:31 -07:00
Brian Joerger 2beb991598 API client connection overhaul (#5625)
* Added support for connecting API client through tunnel proxy and web proxy addresses (with identity file).

* Added concurrent dialing logic to dial several possible dialing combinations and seamlessly return the first client to connect.
2021-03-23 14:39:20 -07:00
Roman Tkachenko 8739417729 Add Postgres Cloud SQL support (#5941) 2021-03-22 09:38:05 -07:00
Roman Tkachenko a3837f6720 App access cli flow (#5918) 2021-03-22 09:18:53 -07:00
Alexander Klizhentas f17625c1a8 Adds controls for impersonation requests. (#6009) (#6073)
Fixes #5352

```yaml
allow:
  impersonate:
    users: ['alice', 'bob']
    roles: ['*']
    where: 'contains(user.spec.traits["groups"], impersonate_role.traits)'
```

Adds "impersonator" to all X.509 and SSH client certs
issued using impersonation and does best effort to track
requests by impersonators in audit events.

Limits certs TTL to the impersonator's max session TTL.

Prevents impersonating users to recursively impersonate
other users.

Allows impersonating users to renew their own certificate,
for example to set route to cluster.

Adds missing token permission for editor role.
2021-03-19 16:04:43 -07:00
dmitri d6fe06c906 Augment checking stream/streamer and AuditWriter with cluster name detail to automatically populate the field upon event emission.
Updates https://github.com/gravitational/teleport/issues/5856.
2021-03-17 18:21:57 -07:00
Andrew Lytvynov 5135f00ae2 mfa: add cluster-level require_session_mfa option (#5939)
* mfa: add cluster-level require_session_mfa option

Users may choose to require MFA for all sessions in some clusters, or
only on select roles in others.
This PR adds the cluster-level option in the `auth_service` config.

To expose this field to non-auth services, opened up `GetAuthPreference`
access over the auth API, including all the cache plumbing.

* Address review feedback
2021-03-17 13:42:24 -07:00
Steven Martin 94084f8c28 Add google_service_account inline field option for Google Workspace/GSuite OIDC (#5563)
* Add google_service_account field to OIDC for specifying google service account json
2021-03-11 19:18:19 -08:00
dmitri 83c2808851 Address review comments 2021-03-11 17:05:38 -08:00
dmitri 3ed2afae08 Remove proto-based ServerV2 implementation of DeepCopy in favor of the
manual implementation to avoid issues with proto-based type merge
panics.

Fixes https://github.com/gravitational/teleport/issues/5691.
2021-03-11 17:05:38 -08:00
xacrimon 0d1a53b858 add support for encrypted saml assertions with a seperate x509 pair 2021-03-12 00:29:57 +01:00
Brian Joerger 5e9ea1c7e1 Add Features and PublicAddrs to PingResponse (#5742) 2021-03-10 18:15:40 -08:00
Brian Joerger 494782fe12 Convert Role endpoints to gRPC. (#5458) 2021-03-10 17:54:08 -08:00