Documentation
¶
Overview ¶
Package sessionrecording contains functionality for recording Kubernetes API server proxy 'kubectl exec/attach' sessions.
Index ¶
Constants ¶
const ( SPDYProtocol Protocol = "SPDY" WSProtocol Protocol = "WebSocket" ExecSessionType SessionType = "exec" AttachSessionType SessionType = "attach" )
Variables ¶
var ( // CounterSessionRecordingsAttempted counts the number of session recording attempts. CounterSessionRecordingsAttempted = clientmetric.NewCounter("k8s_auth_proxy_session_recordings_attempted") )
Functions ¶
This section is empty.
Types ¶
type Hijacker ¶
type Hijacker struct { http.ResponseWriter // contains filtered or unexported fields }
Hijacker implements net/http.Hijacker interface. It must be configured with an http request for a 'kubectl exec/attach' session that needs to be recorded. It knows how to hijack the connection and configure for the session contents to be sent to a tsrecorder instance.
func NewHijacker ¶ added in v1.86.0
func NewHijacker(opts HijackerOpts) *Hijacker
type HijackerOpts ¶
type HijackerOpts struct { TS *tsnet.Server Req *http.Request W http.ResponseWriter Who *apitype.WhoIsResponse Addrs []netip.AddrPort Log *zap.SugaredLogger Pod string Namespace string FailOpen bool Proto Protocol SessionType SessionType }
type Protocol ¶
type Protocol string
Protocol is the streaming protocol of the hijacked session. Supported protocols are SPDY and WebSocket.
type RecorderDialFn ¶
type RecorderDialFn func(context.Context, []netip.AddrPort, netx.DialFunc) (io.WriteCloser, []*tailcfg.SSHRecordingAttempt, <-chan error, error)
RecorderDialFn dials the specified netip.AddrPorts that should be tsrecorder addresses. It tries to connect to recorder endpoints one by one, till one connection succeeds. In case of success, returns a list with a single successful recording attempt and an error channel. If the connection errors after having been established, an error is sent down the channel.
type SessionType ¶ added in v1.86.0
type SessionType string
SessionType is the type of session initiated with `kubectl` (`exec` or `attach`)
Directories
¶
Path | Synopsis |
---|---|
Package fakes contains mocks used for testing 'kubectl exec' session recording functionality.
|
Package fakes contains mocks used for testing 'kubectl exec' session recording functionality. |
Package spdy contains functionality for parsing SPDY streaming sessions.
|
Package spdy contains functionality for parsing SPDY streaming sessions. |
Package tsrecorder contains functionality for connecting to a tsrecorder instance.
|
Package tsrecorder contains functionality for connecting to a tsrecorder instance. |
package ws has functionality to parse 'kubectl exec/attach' sessions streamed using WebSocket protocol.
|
package ws has functionality to parse 'kubectl exec/attach' sessions streamed using WebSocket protocol. |