sessionrecording
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package sessionrecording contains functionality for recording Kubernetes APIserver proxy 'kubectl exec/attach' sessions.
Index¶
Constants¶
const (SPDYProtocolProtocol = "SPDY"WSProtocolProtocol = "WebSocket"ExecSessionTypeSessionType = "exec"AttachSessionTypeSessionType = "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¶
typeHijacker¶
type Hijacker struct {http.ResponseWriter// contains filtered or unexported fields}Hijacker implementsnet/http.Hijacker interface.It must be configured with an http request for a 'kubectl exec/attach' session thatneeds to be recorded. It knows how to hijack the connection and configure forthe session contents to be sent to a tsrecorder instance.
funcNewHijacker¶added inv1.86.0
func NewHijacker(optsHijackerOpts) *Hijacker
typeHijackerOpts¶
type HijackerOpts struct {TS *tsnet.ServerReq *http.RequestWhttp.ResponseWriterWho *apitype.WhoIsResponseAddrs []netip.AddrPortLog *zap.SugaredLoggerPodstringNamespacestringFailOpenboolProtoProtocolSessionTypeSessionType}typeProtocol¶
type Protocolstring
Protocol is the streaming protocol of the hijacked session. Supportedprotocols are SPDY and WebSocket.
typeRecorderDialFn¶
type RecorderDialFn func(context.Context, []netip.AddrPort,netx.DialFunc) (io.WriteCloser, []*tailcfg.SSHRecordingAttempt, <-chanerror,error)
RecorderDialFn dials the specified netip.AddrPorts that should be tsrecorderaddresses. It tries to connect to recorder endpoints one by one, till oneconnection succeeds. In case of success, returns a list with a singlesuccessful recording attempt and an error channel. If the connection errorsafter having been established, an error is sent down the channel.
typeSessionType¶added inv1.86.0
type SessionTypestring
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. |