Commit graph

491 commits

Author SHA1 Message Date
Nic Klaassen c48ee9f062
Add support for HSM CA rotation (#7862) 2021-08-18 21:21:43 -07:00
Nic Klaassen c9fda499de
Add support for multiple CA pins (#7905) 2021-08-18 20:13:20 -07:00
Andrew Lytvynov e9351457ba Address review comments, batch 1 2021-08-18 18:44:41 +00:00
Andrew Lytvynov ab062428b1 Windows desktop service boilerplate
Boilerplate for a new service and API objects:
- windows_desktop_service config section
- service registration and heartbeats
- static host registration and heartbeats
- caching, permissions, etc
- "tctl get" support

For new connections the service aborts after authentication, since the
RDP client implementation is not ready yet (pending in
https://github.com/gravitational/teleport/pull/7824).

Tested that the service starts, registers (both over a tunnel and
directly) and creates the API objects.
2021-08-18 18:44:41 +00:00
Lisa Kim e7c82071a5
Fix incorrect zero value setting for web idle timeout (#7926)
* Revert "Send web idle timeout with new web session response (#7839)"
  which contains a bug where web idle timeout returns zero despite settings
* Retrieving web idle timeout in auth service and setting it with new web
  session fixes the bug
2021-08-18 09:29:08 -07:00
Alan Parra 2e4e628e79
Allow custom webassets path if debug mode is on (#7925)
Useful for debugging Teleport servers in modern IDEs.
2021-08-17 09:47:55 -07:00
Lisa Kim 680818fabc
Send web idle timeout with new web session response (#7839) 2021-08-12 20:46:55 -07:00
Andrej Tokarčík f97b7c09d3
Reject cert generation requests for locked-out users/hosts (#7746) 2021-08-12 19:52:13 +02:00
Brian Joerger 25c9c982db
API client tunnel address discovery fix (#7533) 2021-08-11 14:34:50 -07:00
Trent Clarke c67a053e48
Dead code removal (#7851)
Removes detritus from PR #7523 that made it through review
2021-08-11 20:31:12 +10:00
Trent Clarke 1d37ede936
Do not exit teleport when unable to enumerate k8s cluster (#7523)
Teleport will fail to start when when a k8s cluster is unavailable when
using the kubeconfig in a `kubernetes_service` configuration. This means
that a single missing cluster can disrupt _all_ of the configured
clusters, even if the others are online.

This change makes failing the cluster credential enumeration a
per-k8s-cluster warning, rather than a stop-the-world error.

It also expands the testing shims inside the k8s proxy to allow more
sophisticated mocked scenarios, in order to test the above.

See-Also: #7215
2021-08-10 11:04:26 +10: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
NajiObeid 76c020d64c
mtls metrics service (#7079)
* mtls metrics service

* pr review changes

* errors caused by upstream

* address pr comments
2021-07-28 19:37:28 -07:00
Brian Joerger c040aca4c1
Upgrade api version. (#7609) 2021-07-28 13:51:21 -07:00
Andrej Tokarčík 7d878fff24
Enforce locks in auth.Authorize (#7625) 2021-07-28 18:54:21 +02:00
Andrej Tokarčík c782838c3a
Fix ClusterConfig caching with pre-v7 remote clusters (#7698) 2021-07-27 15:15:05 +02:00
Andrej Tokarčík d5ca862280
Apply locks to connections tracked by srv.Monitor (#7506) 2021-07-23 14:11:50 +02:00
Russell Jones 2ccd36b2fe Fixed performance issues with the Web UI.
Fixed two issues that were causing a performance issue with the Web UI.

The first issue was that when an "Authorizer" was being created at
process startup by Auth Service, it was by-passing the cache and always
hitting the backend directly. All services have been updated to now use
an cached access point.

The second issue was that the Web UI was not using the local cache when
fetching the list of roles for a user. The Web UI has been updated to
now use the local cached access point.
2021-07-22 18:58:27 -07:00
Roman Tkachenko ebc882c80d
Use web listener for web server (#7619) 2021-07-21 09:53:33 -07:00
Eugene Yakubovich 67c0eb3b4c Add restricted session
Adds the ability to block network traffic on SSH sessions.
The deny/allow lists of IPs are specified in teleport.yaml file.
Supports both IPv4 and IPv6 communication.

This feature currently relies on enhanced recording for
cgroup management so that needs to be enabled as well.

-- Design rationale:
This patch uses Linux Security Module (LSM) hooks, specifically
security_socket_connect and security_socket_sendmsg, to control
egress traffic. The LSM provides two advantages over socket filtering
program types.
- It's executed early enough that the task information is available.
  This makes it easy to report PID, COMM, etc.
- It becomes a model for extending restrictions beyond networking.

The set of enforced cgroups is stored in a BPF hash map and the
deny/allow lists are stored in BPF trie maps. An IP address is
first checked against the allow list. If found, it's checked for
an override in the deny list. The policy is default deny. However,
the absence of the NetworkRestrictions API object is allow all.

IPv4 addresses are additionally registered in IPv6 trie (as mapped)
to account for dual stacks. However it is unclear if this is sufficient
as 4-to-6 transition methods utilize a multitude of translation and
tunneling methods.
2021-07-16 16:49:04 -07:00
Trent Clarke 9b7002cf9c
Fixes racey tests in tsh (#7416)
Multiple routines were fighting over the global logrus `Logger`
instance, causing the race detector to trip roughly once in every 10
test runs.

This patch addresses this race condition by supplying each of the
competing processes an entirely separate logger, and ensuring that
these log instances are plumbed through to the code that would otherwise
trip the race detector.
2021-06-25 17:44:42 -07:00
Trent Clarke ca1e47bef0
Adds custom timeout message to SSH sessions (#7120)
* Adds the idle_timeout_message to the auth_service config file block
* Plumbs the value through to the session monitor
* Writes the message to stderr when a session times out due to inactivity
* Adds some machinery to the test helpers to configure appropriate tests

See-Also: #6091
2021-06-25 14:12:50 +10:00
Roman Tkachenko 59d39dee5a
Automatically download Cloud SQL root certs (#7397) 2021-06-24 09:27:52 -07:00
Roman Tkachenko 6c34385e35
Fix ping endpoint when proxy has multiple public addrs (#7368) 2021-06-23 13:00:46 -07:00
Roman Tkachenko b42bec61c1
Parse AWS info from RDS/Redshift endpoint (#7385) 2021-06-23 12:41:54 -07:00
Roman Tkachenko 6b9726f961
Add MongoDB database access support (#7213) 2021-06-21 22:54:05 -07:00
Roman Tkachenko 58012cf376
Add Cloud SQL MySQL support (#7302) 2021-06-18 17:38:15 -05:00
Brian Joerger bd07d7be20
CheckAndSetDefaults sets all defaults. (#6846) 2021-06-18 12:57:29 -07:00
Andrej Tokarčík d63d144e8e
Move ClusterID field from ClusterConfig to ClusterName (#7050) 2021-06-18 18:42:09 +02:00
Trent Clarke 52fb813390
Adds per-node ability to disable ssh TCP forwarding (#6989)
Prior to this change, TCP forwarding over SSH could only be disallowed
by user-based rules, rather than by individual target nodes.

This change adds:
  * the`port_forwarding` key to the yaml SSH config block, with a boolean value
  * Plumbing to pipe the resulting config value through to the SSH server
  * A predicate check in the SSH server to [dis]allow port forwarding based on the setting.

This change also:
    * adds a common way for integration tests to await the establishment of an SSH session
    * refactors several integration tests to use this new method rather than manually waiting
    * adds some marshaling code to move errors from spawned goroutines back into the 
      main test routine in verifySessionJoin()

See-Also: Issue #6783
2021-06-16 20:17:26 -05:00
Andrej Tokarčík 3d22eaac0e
Turn AuditConfig into a standalone resource (#6997) 2021-06-14 15:49:22 -05:00
Brian Joerger 4d36870ff0
Remove remaining API aliases (#7137) 2021-06-08 12:08:55 -07:00
Andrej Tokarčík 2747cc75bf
Move ClusterConfig auth fields into ClusterAuthPreference (#6876) 2021-06-07 11:07:02 -07:00
Brian Joerger 7bff7c41bd
Remove API aliases (#6983) 2021-06-04 13:29:31 -07:00
inertial-frame 8922af0c61
docs: port of 6871 (#7091) 2021-06-04 14:16:05 -05:00
Marek Smoliński 24d5bbd949
Add delay in TestRootLeafIdleTimeout test (#7116) 2021-06-03 21:58:37 +02:00
Marek Smoliński eb7bb01d34
Support disconnect_expired_cert for database access (#6857) 2021-05-31 10:26:50 +02:00
Joel b2494bea8e
Improve RFD 24 Dynamo migration efficiency and performance (#7012) 2021-05-27 22:19:56 +02:00
Nic Klaassen f268ba173e
Stop registering a Kubernetes cluster named after the Teleport cluster (#6786) 2021-05-25 17:50:35 -07:00
Andrej Tokarčík 555695dfdd
Introduce SessionRecordingConfig extracting fields from ClusterConfig (#6708) 2021-05-19 12:01:37 -07:00
NajiObeid 86a6abcfcb
lazy init of prometheus collectors (#6561)
* lazy init of prometheus collectors

* incorporate metrics intorduced in #6271

* linting

* tests

* pr changes

* tests

* pr changes
2021-05-19 11:53:36 -04:00
Andrej Tokarčík ad00c6c789
Introduce ClusterNetworkingConfig extracting fields from ClusterConfig (#6638) 2021-05-07 13:54:08 +02:00
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 b62323e74f
Clarify node connection debug logs. (#6722) 2021-05-05 17:31:36 -07:00
Lisa Kim 9c06ddc8ad
Check cloud feature before setting billing access for web (#6537)
* Init web handler with auth server feature flags on proxy init
* Retrieve auth server features by calling Ping when connecting 
  to auth svc which contains the server feature flags in the response
2021-05-05 14:58:43 -07:00
Roman Tkachenko a3d39e3810
Add redshift auth support to database access (#6479) 2021-04-26 11:53:10 -07:00
Roman Tkachenko d67e11ff2d
Adding postgres_public_addr and mysql_public_addr (#6426) 2021-04-21 19:52:52 -07:00
Brian Joerger 228029df00
Improve process connection error handling and logging (#6471) 2021-04-20 16:59:01 -07:00