Commit Graph
38 Commits
Author SHA1 Message Date
STeve (Xin) Huang 704a514742 AWS IAM role matching for database users (#20610)
* Add database user matching logic for databases require AWS IAM role

* Fix UT

* fix lint/typo

* fix typo in error message

* reduce bool return
2023-02-03 18:33:56 +00:00
Alan Parra 11d58e25c7 Refactor AccessMFAParams and MFAParams to allow additional data (#20300)
Refactor `services.AccessMFAParams` and the accompanying `MFAParams` methods so
they may be extended to carry additional data (eg, information required to
perform device trust checks).

This PR refactors existing code without adding any new functionality, so it may
be backported to older branches to alleviate eventual conflicts. Follow up
changes will take advantage of it to add support for device trust.

Related to gravitational/teleport.e#514.
2023-01-17 20:02:38 +00:00
Gavin Frazar ef43b4cef9 azure mysql and postgresql flex server discovery (#19759)
* Move GCP cloud clients into a separate interface
* Add azure mysql/postgresql flex server support
* Add teleport db configure create support for azure postgres/mysql flex servers
* discover both single and flexi server with 'mysql' and 'postgres' db types.
* go doc gcp interface
* Add is_flexi_server to database Azure config
2023-01-09 18:48:08 +00:00
STeve (Xin) Huang 6c858c09ee Register database engines directly from db lib (#19279) 2022-12-18 05:59:47 +00:00
STeve (Xin) Huang f2cf36a450 AWS Redshift Serverless engine support (#18651) 2022-12-01 15:36:48 +00:00
STeve (Xin) Huang 1b0a083b9d Database access AWS RDS Proxy support (#17005) 2022-10-31 15:21:31 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Brian Joerger 2654add770 RequireMFAType (#16034)
Replace role/authPref RequireSessionMFA (bool) with RequireMFAType
(string).

  - Add new RequireMFAType constant values with custom boolean marshalling.

  - Add RequireMFAType to role and auth preference and deprecate
RequireSessionMFA.

  - Add session-mfa override login when hardware_key_touch is enforced.

  - Add protobuf enum for RequireMFAType.

  - Add support for proto enums in protoc-gen-crd and update Kubernetes
Operator manifests.
2022-09-22 20:30:32 +00:00
STeve (Xin) Huang 0d12750b78 Common database connect errors (#11111) 2022-03-15 16:28:23 +00:00
Roman Tkachenko 21b6b17a74 Refactor database engines registration (#10074) 2022-02-01 21:02:43 +00:00
Jim Bishopp 4511f7a687 Client Certificate Authentication for GCP Cloud SQL (#9991)
Allow users to secure GCP Cloud SQL instances by setting "Allow only SSL
connections", which enforces client certificate authentication.

This implementation does not require any configuration changes for Teleport
users. Teleport will detect whether client certificate authentication is
required and handle either case automatically.

Client certificates are ephemeral. They are created for every connection by
calling the GCP Cloud SQL API's GenerateEphemeralCert function. Certificates
are only created when the destination Cloud SQL instance is configured to
require client certificate authentication. The configuration is detected by
requesting instance settings from the GCP Cloud SQL API on every connection
attempt.

A special case was implemented for MySQL. MySQL servers in GCP Cloud SQL do not
trust the ephemeral certificate's CA but GCP Cloud Proxy does. To work around
this issue, the implementation will connect to the MySQL Cloud Proxy port using
a TLS dialer instead of the default MySQL port when client certificate
authentication is required.

The common.CloudClients interface and implementation now return an interface
(GCPSQLAdminClient) from the GetGCPSQLAdminClient function instead of the GCP
client's sqladmin.Service. Returning an interface simplified calling code and
allowed for the client to be mocked for testing.

Existing GCP Cloud SQL tests are configured to not require client certificate
authentication by default. A new test named TestGCPRequireSSL was created to
simulate client certificate authentication for both Postgres and MySQL. This
required some minor changes to the test server code.

A new ConnectWithDialer function was added to the
github.com/gravitational/go-mysql fork. This function is available upstream in
v1.4.0 but other changes upstream resulted in a number of errors and a panic
processing network packets. So instead of upgrading, the dialer function was
copied to the Teleport fork and a custom version was created instead:
v1.1.1-teleport.1.
2022-01-31 20:52:03 +01:00
Jakub Nyckowski c7c94111cd Add "limiter" support to database service (#9087)
Add rate and connection limiter to database service.
2022-01-07 22:23:22 +00:00
Roman Tkachenko 95be5fda37 Update Postgres audit events (#9435) 2022-01-06 17:44:20 +00:00
Roman Tkachenko 4d5493eb69 Add Azure access token auth support for Postgres/MySQL (#8951) 2021-12-01 14:30:25 -08:00
Roman Tkachenko ce547953db Automatically import RDS databases (#8481) 2021-10-15 11:03:10 -07:00
Roman Tkachenko 36998cf566 Add CockroachDB support (#8505) 2021-10-12 14:30:59 -07:00
Marek Smoliński 700f9f71e5 Add support for MFA for DB access (#8270) 2021-10-06 13:59:35 -07:00
Roman Tkachenko 0897a31ee2 Auto-configure IAM for Redshift databases (#8348) 2021-10-04 10:42:55 -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
Roman Tkachenko e1c3f80aa0 Fixes for cert checker and Postgres config builder (#8251) 2021-09-17 13:28:40 -07:00
Roman Tkachenko 629042ed30 Decouple database server from database (#7771) 2021-08-05 01:50:21 -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
Roman Tkachenko 0392dd86f7 Include O in MongoDB certs and improve some errors (#7575) 2021-07-19 11:17:33 -07:00
Roman Tkachenko efc3973f78 Better handling of database access IAM errors (#7525) 2021-07-14 09:13:39 -07:00
Roman Tkachenko 6b9726f961 Add MongoDB database access support (#7213) 2021-06-21 22:54:05 -07:00
Brian Joerger 917df5ad02 gRPC conversions - Auth Preference (#7220) 2021-06-18 12:30:56 -05:00
Roman Tkachenko a3d39e3810 Add redshift auth support to database access (#6479) 2021-04-26 11:53:10 -07:00
Roman Tkachenko 8230d6e436 Capture postgres extended protocol messages in audit log (#6303) 2021-04-14 13:39:59 -07:00
Roman Tkachenko 8739417729 Add Postgres Cloud SQL support (#5941) 2021-03-22 09:38:05 -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
Andrew Lytvynov 6d8f778157 mfa: add WithMFA to session-related audit events (#5833)
* mfa: put device UUID in MFAVerified cert extensions

Instead of just a bool, add the device UUID. This will be used in audit
events when a session is started using MFA-issued certs.

* Add WithMFA to session-related audit events

Also extract a common function for parsing SSH certs.
2021-03-04 14:18:30 -08:00
Andrew Lytvynov eed77ade1b auth: add RequireSessionMFA to roles and enforce it (#5539)
* auth: add RequireSessionMFA to roles and enforce it

Enforcement kicks in when at least one role that grants access requires
it. Right now, clients don't request MFA-verified certs yet, so if a
role sets the field, it won't be usable. Next PR will add client logic
to request the special certs.

* Address review feedback
2021-02-17 15:22:24 -08:00
Roman Tkachenko 81e1102250 Add MySQL support for database access (#5453) 2021-02-10 11:08:13 -08:00
Roman Tkachenko f0a180be7a Refactor db access audit logger for better reuse (#5421) 2021-01-27 13:43:09 -08:00
Roman Tkachenko 127693c315 Refactor db proxy/engine for easier reuse (#5325) 2021-01-21 15:34:12 -08:00
Roman Tkachenko 8e1865464b Database access (#5005) 2021-01-14 18:21:38 -08:00