Commit Graph
254 Commits
Author SHA1 Message Date
Isaiah Becker-Mayer bc11f2dfe6 Adds Desktops to license (#9576)
* Adds Desktops to license

* adds newline
2022-01-06 18:43:47 +00:00
Roman Tkachenko 95be5fda37 Update Postgres audit events (#9435) 2022-01-06 17:44:20 +00:00
Jakub Nyckowski f5d5323f1f Specify level of TLS verification for database connections (#9197)
Now 'verify-full', 'verify-ca' and 'insecure' modes can be used when connecting to a database. 'verify-full` is the default on and it's the most strict. 'verify-ca' skips the server-name check. 'insecure' accepts any certificate provided by a database.
2022-01-05 16:41:49 +00:00
Edoardo Spadolini 3a50ffab26 Add access requests to TLS certificates (#9501)
* Add access requests to tlsca.Identity, and store them in TLS certs

This mirrors what we already do for SSH certs.

* Keep track of access requests in web sessions

* Keep track of access requests in app sessions

* Include the current access requests when issuing new user certs

This is necessary because we extend the list of current roles
instead of starting from the statically assigned ones, so we should
also keep track of all the potential ways that those roles were
granted to the user.

* fix: pass access requests through PreAuthenticatedSignIn

* Tests for access requests in TLS certs
2022-01-03 14:22:16 +00:00
Marek Smoliński 5afd0e6204 Update API client: dial auth service with TLS Routing (#9498) 2022-01-03 11:32:45 +01:00
Zac Bergquist 7c96ba9177 Allow locking a desktop
Prior to this change, desktop access only respected locks
on users or roles. This introduces a desktop as a lock target,
preventing new connections and terminating existing connections
to a locked desktop.

Note: when a lock is created, connection attempts will fail
with the generic "websocket connection failed" error.
This will be addressed with #8584.

Updates #8742
2021-12-28 09:08:40 -07:00
Gabriel Corado 5f403562ab feat: ListResources gRPC rpc (#9096) 2021-12-15 18:09:21 +00:00
Joel 2702856908 Allow a configurable event TTL in DynamoDB (#8840) 2021-12-14 18:04:44 +01:00
Marek Smoliński f906831e58 Add ability to run Mongo proxy on separate listener (#9194) 2021-12-14 14:26:14 +01:00
Marek Smoliński d24ae5b1ce Add ability to run Postgres proxy on separate listener (#8323) 2021-12-10 11:05:19 +01:00
Zac Bergquist 1a9416c19f Fix CheckAndSetDefaults for UserTokenSecretsV3 (#9290)
Since CheckAndSetDefaults mutates the receiver, we need a pointer
receiver.
2021-12-08 12:00:03 -08:00
Zac Bergquist ce03d2cdea Enhance LDAP desktop discovery (#9152)
* Refactor component heartbeat callbacks

Consolidate the OK/degraded broadcasts so the same logic isn't
duplicated for each component.

* Periodically update discovered desktops

Fixes #8644

* Allow customizing the desktop search

With this change, we support a discovery base DN other than '*',
and add support for further filtering the results with additional
LDAP filters.

Additionally, we filter out group managed service accounts, which
show up in LDAP searches for (objectClass=computer), despite not
being comptuers. (This is mostly harmless, as the service accounts
aren't present in DNS, so Teleport just ignores them. It does, however,
log a DNS error message that could be confusing, so we explicitly
filter these out just to be safe. This was discovered when testing
on AWS managed AD, which creates a gMSA for DNS.
2021-12-01 16:17:30 -08:00
Roman Tkachenko 4d5493eb69 Add Azure access token auth support for Postgres/MySQL (#8951) 2021-12-01 14:30:25 -08:00
Zac Bergquist 53562aadb0 Use t.Setenv in tests (#9154)
This new feature in Go 1.17 automatically restores the environment
variable to its previous value when a test ends, making it simpler
to set up the environment for tests and less likely that we accidentally
leave behind global state.

Also convert some of the remaining uses of check to standard Go tests.
2021-12-01 10:43:12 -07:00
Gabriel Corado df588df526 Add app metatada to app audit events (#8930) 2021-11-18 11:40:04 -03:00
Brian Joerger 6512bca599 Move unimplemented client methods out of the api client. (#8972) 2021-11-17 15:42:44 -08:00
Brian JoergerandZac Bergquist 664560cee8 teleport.cluster.local cleanup (#7922)
Co-authored-by: Zac Bergquist <zmb3@users.noreply.github.com>
2021-11-15 17:32:45 -08:00
Marek Smoliński 33f8a021b1 Fix tunnel address for TLS routing if public tunnel address is present (#8961) 2021-11-15 12:58:22 -08:00
Trent Clarke 3956ed27a6 Fix race condition in integration tests. (#8888)
Some integration tests modify global "constants" to speed up test
execution (e.g. shortening polling intervals). This is occasionally
tripping the Go data race detector, so I have added explicit
serialisation to reading and writing these global settings.

These values are only ever changed in a test environment, and there
should be zero contention for them in a non-test environment.
2021-11-10 11:34:34 +11:00
Lisa Kim c5b2da13b7 Return created date with new recovery codes (#8777) 2021-10-29 20:14:56 -07:00
Alan Parra 41b6ae7b63 Set user verification to "discouraged" for WebAuthn (#8759)
The default user verification setting, "preferred", leaves it open for
client-side implementations whether to to perform verification checks.
In theory it sounds reasonable, but in practice it takes a variety of
forms: Chrome will perform PIN checks if a PIN is configured, a
redundant check in face of our existing password checks. Windows goes a
step further and directs user to set a PIN, a further deviation from the
usual security key workflow.

The traditional workflow is achieved by setting user verification to
discouraged, implemented here.

Reference:
- https://chromium.googlesource.com/chromium/src/+/refs/heads/main/content/browser/webauth/uv_preferred.md

* Set user verification to "discouraged" for WebAuthn
* Add user verification to CredentialAssertion proto
* Add authenticator selection to CredentialCreation proto
2021-10-29 14:06:11 -07:00
Nic Klaassen f884cdd7e3 Make RegisterUsingTokenRequest a Protobuf type (#8690) 2021-10-27 10:59:44 -07:00
Tim Ross d3789279ae use RoutingStrategy enum instead of boolean flag 2021-10-22 17:12:43 -07:00
Tim Ross ab61848a04 Route to the most recently heartbeated node when there are duplicates
Allow users to opt in to changing routing behavior when duplicate
nodes are present. Legacy behavior is to return an error when multiple
nodes are matched by the routing logic in proxyToHost. A new RouteToMostRecent
flag in ClusterNetworkingConfig can be set to allow users to opt in to returning
the most recent node instead of an error. By default, the legacy behavior
is preserved.
2021-10-22 17:12:43 -07:00
Forrest Marshall 7f39084def fix nits 2021-10-22 16:42:33 -07:00
Forrest Marshall babd6b07dd remove OnlyRecent behavior 2021-10-22 16:42:33 -07:00
Forrest Marshall 78b0d8c726 ttl-based fallback caching 2021-10-22 16:42:33 -07:00
Forrest Marshall 19c5768873 server-side filtering 2021-10-22 16:42:33 -07:00
Marek Smoliński 17a5cadabb Add Proxy listener mode and proxy v2 configuration (#8511) 2021-10-21 14:45:47 +02:00
rosstimothy c730778960 Replace golint with revive (#8613) 2021-10-19 14:00:24 -04:00
Marek Smoliński 7606d330e9 AWS CLI access (#8151) 2021-10-19 10:43:53 +02:00
Roman Tkachenko ce547953db Automatically import RDS databases (#8481) 2021-10-15 11:03:10 -07:00
Zac Bergquist 3d5266cc23 desktop access: add session start/end audit events
Updates #7761
2021-10-13 16:37:10 -04:00
Zac Bergquist 01ced111f4 Add RBAC for Windows desktop access (#8520)
* Add RBAC for Windows desktop access

This commit adds RBAC checks for Windows Desktops as described in
RFD 33 and RFD 34:

- add Windows desktop logins & labels to role definition
- introduce new file config for host labels based on a regexp match
- auth server API performs access checking for Windows desktop resources
- add RDP client callback to authorize the user
- support user/role locks
- respect the client idle timeout setting

Note: in cases where an connection is terminated to to RBAC, the web UI
currently displays "websocket connection failed" because the connection
is closed from the server. We'll need to follow up with a nice error
message for the client side to improve the UX here.

Other changes:

* Remove OSS RBAC migration marked for deletion
* Stop creating a default admin role
* add wildcard desktop access to the preset access role

Updates #7761
2021-10-12 14:52:59 -06:00
Alan Parra d892cbdde0 Allow second_factor 'on' and 'optional' without U2F (#8498)
Before this change, second_factor types 'on' and 'optional' required U2F.
Starting at the next Teleport version, those settings require Webauthn by
default and treat U2F as optional.

Group second factor tests by second factor type, which is a more natural way to
think about configuration and cuts some repetition in testing.

* Simplify and extend second factor config tests
* Allow second_factor 'on' and 'optional' without U2F
* Make teleport.yaml parsing correctly reflect absent U2F
* Simplify uses of GetSecondFactor when applicable

We can take advantage of the IsSecondFactor*Allowed functions to do some
heavy lifting for us.

* Additional error handling
2021-10-08 16:00:35 -07:00
Nic Klaassen 2d10515f19 Implement Simplified Node Joining (#8250) 2021-10-08 10:41:28 -07:00
Andrej Tokarčík b86fa7bfa8 Implement where conditions for session recordings list/read (#8289) 2021-10-08 10:18:22 -07:00
Roman Tkachenko 288c5519ce Accept multiple SANs in tctl auth sign for databases (#8449) 2021-10-05 16:00:28 -07:00
Russell Jones dafcf377a0 Release 8.0.0-alpha.1. 2021-10-05 15:28:42 -07:00
Roman Tkachenko 0897a31ee2 Auto-configure IAM for Redshift databases (#8348) 2021-10-04 10:42:55 -07:00
Andrew Lytvynov 813dff20c1 PIV authentication for RDP (#8408)
* PIV authentication for RDP

This uncomfortably large change fully implements smartcard PIV
authentication for RDP clients using the Teleport CA:
- PIV applet implementation in emulated RDP smartcard
- generating Windows-compatible certificates using Teleport CA with a
  dedicated RPC
- generating dummy CRLs for Teleport CA and publishing it via LDAP

The CRLs are required by Windows for any smartcard login certificate, we
can't avoid that. But we can avoid making it public: the CRL can live in
ActiveDirectory instead of a public endpoint of a Teleport service.
Here, we use LDAP to publish the CRL on startup, valid for a year.

There are a few unhandled cases in the current implementation:
- LDAP server certificate is not validated when upgrading to TLS
- multiple active CAs (with HSMs) are not supported, only one CRL is
  published
- CA rotation is not supported, CRL is not re-published on rotation

All of the above issues will be handled in future PRs as this one is
already too large.

* Address review feedback

* Fix linter errors
2021-10-01 15:01:17 -07:00
Alan Parra 93a7a8926b Return preferred MFA method on ping endpoints (#8439)
Give Teleport clients a consistent hint of which MFA method they should
favor when facing multiple options.

To be used by tsh and Web UI to decide whether they should refer to
"U2F" or "WebAuthn" during the transitional period.

* Return preferred MFA method on ping endpoints
2021-10-01 13:35:22 -07:00
Roman Tkachenko 9959ea381f Auto-configure IAM for RDS databases (#8339) 2021-10-01 11:06:17 -07:00
Zac Bergquist e66a359bfd Unify RBAC checking functions (#8407)
Prior to this change, we have several variants of CheckAccessTo*
methods for each resource type that uses RBAC.

This change reduces duplication and the potential for RBAC to behave
differently for different resources by implementing a common
CheckAccess method that can check access to a variety of resources.

This implementation is also sometimes faster than the original
implementation, because it is careful to avoid checking unnecessary
matchers after a role has already denied access.

This includes a new resource for KubernetesClusterV3 and a conversion func.
Note: plumbing the KubernetesClusterV3 resource through existing protos
and deprecating the original resource is out of scope for this change.
2021-09-30 08:41:28 -06:00
Lisa Kim d0c09338ac Rename VerifyAccountRecovery and token ID proto fields (#8395)
- Rename ApproveAccountRecovery to VerifyAccountRecovery 
   to match the language we use for the UI
- Use generic TokenID field naming for requests where more 
   than one type of token is accepted or a single token use 
   may be unlikely (MFA related rpcs)
2021-09-28 10:29:11 -07:00
Nic Klaassen 99cc8eb5ef Require enterprise license for HSM support (#8370) 2021-09-27 10:40:47 -07:00
Lisa Kim 8c4bf751b2 Implement AddMFADeviceSync and GetAccountRecoveryCodes (#8287)
Following allows for UI dashboard mfa and recovery code management:

- Adds new rpc AddMFADeviceSync (nonstream) so users can add device
- Adds new rpc GetAccountRecoveryCodes to retrieve nonsensitive data 
  about a users recovery codes e.g. created date to display in the users 
  dashboard
- Added privilege access to DeleteMFADeviceSync and 
  CreateAccountRecoveryCodes
2021-09-24 12:26:45 -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
Alan Parra 6187d00c74 Add Webauthn support to ChangePassword and Ping (#8337)
Add Webauthn support to a few outstanding endpoints and RPCs.

* Refactor and add Webauthn support to ChangePassword
* Add explicit JSON tag to AuthenticateUserRequest.Webauthn
* Add Webauthn support to /webapi/users/password/token
* Add Webauthn to /webapi/ping
* Add default Webauthn device name to ChangeUserAuthentication
* Tidy Ping tests
2021-09-23 13:34:30 -07:00