Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate parties in kube and ssh session trackers. #13753

Merged
merged 8 commits into from
Jun 29, 2022
5 changes: 0 additions & 5 deletions lib/kube/proxy/sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -1071,11 +1071,6 @@ func (s *session) trackSession(p *party, policySet []*types.SessionTrackerPolicy
State: types.SessionState_SessionStatePending,
Hostname: s.podName,
ClusterName: s.ctx.teleportCluster.name,
Participants: []types.Participant{{
ID: p.ID.String(),
User: p.Ctx.User.GetName(),
LastActive: time.Now().UTC(),
}},
KubernetesCluster: s.ctx.kubeCluster,
HostUser: p.Ctx.User.GetName(),
HostPolicies: policySet,
Expand Down
23 changes: 7 additions & 16 deletions lib/srv/sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,10 +1075,6 @@ func (s *session) startInteractive(ch ssh.Channel, ctx *ServerContext, tempUser
}()
}

if err := s.addParty(p, types.SessionPeerMode); err != nil {
return trace.Wrap(err)
}

ctx.Debug("Waiting for continue signal")

if tempUser != nil {
Expand Down Expand Up @@ -1761,18 +1757,13 @@ func (p *party) closeUnderSessionLock() {
// on an interval until the session tracker is closed.
func (s *session) trackSession(teleportUser string, policySet []*types.SessionTrackerPolicySet) error {
trackerSpec := types.SessionTrackerSpecV1{
SessionID: s.id.String(),
Kind: string(types.SSHSessionKind),
State: types.SessionState_SessionStatePending,
Hostname: s.registry.Srv.GetInfo().GetHostname(),
Address: s.scx.srv.ID(),
ClusterName: s.scx.ClusterName,
Login: s.login,
Participants: []types.Participant{{
ID: teleportUser,
User: teleportUser,
LastActive: s.registry.clock.Now(),
}},
SessionID: s.id.String(),
Kind: string(types.SSHSessionKind),
State: types.SessionState_SessionStatePending,
Hostname: s.registry.Srv.GetInfo().GetHostname(),
Address: s.scx.srv.ID(),
ClusterName: s.scx.ClusterName,
Login: s.login,
HostUser: teleportUser,
Reason: s.scx.env[teleport.EnvSSHSessionReason],
HostPolicies: policySet,
Expand Down