Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/srv/desktop/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const (
// attrName is the name of an LDAP object.
attrName = "name"

// description is a description of an LDAP object.
attrDescription = "description"
attrDescriptionMaxLength = 1024 // https://learn.microsoft.com/en-us/windows/win32/adschema/a-description

// attrCommonName is the common name of an LDAP object, or "CN".
attrCommonName = "cn"

Expand Down Expand Up @@ -356,6 +360,10 @@ func (s *WindowsService) ldapEntryToWindowsDesktop(
// purge them if they stop being detected, and discovery of large Windows fleets can
// take a long time.
desktop.SetExpiry(s.cfg.Clock.Now().UTC().Add(apidefaults.ServerAnnounceTTL * 3))

description := entry.GetAttributeValue(attrDescription)
desktop.Metadata.Description = description[:min(len(description), attrDescriptionMaxLength)]

return desktop, nil
}

Expand Down
1 change: 1 addition & 0 deletions lib/srv/desktop/windows_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const (
// see: https://docs.microsoft.com/en-us/windows/win32/adschema/c-computer#windows-server-2012-attributes
var computerAttributes = []string{
attrName,
attrDescription,
attrCommonName,
attrDistinguishedName,
attrDNSHostName,
Expand Down
Loading