Skip to content

Commit

Permalink
Filter Linux hosts out from desktop LDAP discovery results
Browse files Browse the repository at this point in the history
Domain joined Linux hosts (including those used for Teleport's
db_service with MS SQL) won't support RDP, so prevent them from
being discovered and registered with Teleport.

Closes #14116
  • Loading branch information
zmb3 authored and github-actions committed Oct 21, 2024
1 parent 0f12072 commit 3033d98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/srv/desktop/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ func (s *WindowsService) ldapEntryToWindowsDesktop(ctx context.Context, entry *l
labels[types.DiscoveryLabelWindowsDomain] = s.cfg.Domain
s.applyLabelsFromLDAP(entry, labels)

if os, ok := labels[types.DiscoveryLabelWindowsOS]; ok && strings.Contains(os, "linux") {
return nil, trace.BadParameter("LDAP entry looks like a Linux host")
}

addrs, err := s.lookupDesktop(ctx, hostname)
if err != nil || len(addrs) == 0 {
return nil, trace.WrapWithMessage(err, "couldn't resolve %q", hostname)
Expand Down

0 comments on commit 3033d98

Please sign in to comment.