mirror of
https://github.com/gravitational/teleport
synced 2024-10-21 01:34:01 +00:00
Fix the client idle disconnect audit event for desktops
We were attempting to use the desktop name as the server ID, but in order to publish audit events we must use the HostUUID of the windows_desktop_service. Updates #8665
This commit is contained in:
parent
fa21858d80
commit
e281f2c50d
|
@ -582,13 +582,13 @@ func (s *WindowsService) handleConnection(con net.Conn) {
|
|||
return
|
||||
}
|
||||
|
||||
// Fetch the target desktop info. UUID of the desktop is passed via SNI.
|
||||
desktopUUID := strings.TrimSuffix(tlsConn.ConnectionState().ServerName, SNISuffix)
|
||||
log = log.WithField("desktop-uuid", desktopUUID)
|
||||
// Fetch the target desktop info. Name of the desktop is passed via SNI.
|
||||
desktopName := strings.TrimSuffix(tlsConn.ConnectionState().ServerName, SNISuffix)
|
||||
log = log.WithField("desktop-name", desktopName)
|
||||
|
||||
desktop, err := s.cfg.AccessPoint.GetWindowsDesktop(ctx, desktopUUID)
|
||||
desktop, err := s.cfg.AccessPoint.GetWindowsDesktop(ctx, desktopName)
|
||||
if err != nil {
|
||||
log.WithError(err).Warning("Failed to fetch desktop by UUID")
|
||||
log.WithError(err).Warning("Failed to fetch desktop by name")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -653,7 +653,7 @@ func (s *WindowsService) connectRDP(ctx context.Context, log logrus.FieldLogger,
|
|||
LockTargets: services.LockTargetsFromTLSIdentity(identity),
|
||||
Tracker: rdpc,
|
||||
TeleportUser: identity.Username,
|
||||
ServerID: desktop.GetName(),
|
||||
ServerID: s.cfg.Heartbeat.HostUUID,
|
||||
}
|
||||
shouldDisconnectExpiredCert := authCtx.Checker.AdjustDisconnectExpiredCert(authPref.GetDisconnectExpiredCert())
|
||||
if shouldDisconnectExpiredCert && !identity.Expires.IsZero() {
|
||||
|
|
Loading…
Reference in a new issue