Commit Graph
10 Commits
Author SHA1 Message Date
Tiago Silva 7aab11b073 Terminate sessions when peers disconnect (#18552)
When any peer disconnects from a session without closing it, Teleport marks it as active and does not publish the session recordings. 

This PR closes the session once every peer disconnects to avoid leaving zombie sessions when a user intentionally blocks traffic or when a VPN disconnects.

It also waits until all events are pushed before closing the recorder.

Fixes #17848
Fixes #18194
2022-11-22 16:12:48 +00:00
rosstimothy f012be4c47 Refactor (*TermManager) Read (#17967)
* Refactor (*TermManager) Read

Removes spawning a goroutine per `Read` and eliminates using a `sync.Cond`
to indicate whether data flow is on/off. Doing so results in a
goroutine **per character** written that lasts for the entire duration
of the session. A large number of sessions, or very long lived sessions
cause the Proxy to consume large amounts of memory.

The mechanism was meant to prevent reading if data flow was not enabled
for a session due to certain constraints of moderated sessions. By replacing
the `sync.Cond` with a `chan` the same effect can be achieved
without needing a goroutine.

Fixes #17666
2022-11-07 15:21:28 +00:00
Joel fd8c20de28 Deflake TestNoReadWhenOff (#13336)
* Deflake TestNoReadWhenOff

* Fix goroutine leak in EOF cases on read

* remove unused typedef
2022-06-13 17:07:16 +00:00
2717c1d2e0 Security fixes (#13298)
* Add CSRF mitigations

This commit includes two fixes:

1. Enforce an application/json Content-Type server-side.
2. When checking the bearer token, verify that the user
   associated with the token matches the user associated
   with the cookie.

* Fix TEL-Q122-13: Access Requests Denial Of Service Via Request Reason (#125) (#127)

* Ignore input when data flow is off in TermManager

When data flow is disabled in TermManager (at the beginning or when TermManager.Off was called) we should ignore all input we receive (currently we buffer it)

* Agent forwarding socket security fix.

Co-authored-by: Lisa Kim <lisa@goteleport.com>
Co-authored-by: Joel <jwejdenstal@icloud.com>
Co-authored-by: Przemko Robakowski <przemko@przemko-robakowski.pl>
2022-06-08 18:12:45 +00:00
Brian Joerger 2292be1f08 SSH Session fixes (#11717) 2022-04-28 00:25:51 +00:00
Joel 316b981b49 Use a buffered channel for the terminate notifier (#11687) 2022-04-04 14:06:35 +00:00
Joel 90a0ff54b9 Limit stdout/stderr buffering in paused sessions (#11347) 2022-03-24 21:19:56 +00:00
Joel 35942e92ce Fix quit on ctrlc, race panic, atomic load align in session IO (#11112) 2022-03-15 12:57:46 +00:00
Joel 92543d9b3e Moderated Sessions improvements (#10991) 2022-03-10 23:04:12 +00:00
Joel ea810d30d9 Implement Moderated Sessions (#8563)
* Implement Moderated Sessions
2022-02-15 17:02:10 +01:00