Research and Engineering Studio (RES) is an AWS supported open source product that enables IT administrators to provide an easy-to-use web portal for scientists and engineers to run technical computing workloads on AWS.
Describe the bug
If a new Active Directory user is created with a Firstname and Surname they can not be added to RES
Steps to reproduce
Steps to reproduce the behavior:
Create a new Active Directory user with a First name and Last name, User logon name and email
Wait for the RES AD hourly sync to run
Check the cluster-manager logs, they contain
[ERROR] [ad-sync] Error while adding user Firstname Surname to RES. Error: [INVALID_PARAMS] Invalid params: user.username must match regex: ^(?=.{3,20}$)(?![_.])(?!.*[_.]{2})[a-z0-9._]+(?<![_.])$
Expected behavior
User should be added to RES with a username taken from User logon name
Actual behavior
User is not added to RES due to the above error
Screenshots/Video
Environment (please complete the following information):
Describe the bug If a new Active Directory user is created with a Firstname and Surname they can not be added to RES
Steps to reproduce Steps to reproduce the behavior:
First name
andLast name
,User logon name
andemail
[ERROR] [ad-sync] Error while adding user Firstname Surname to RES. Error: [INVALID_PARAMS] Invalid params: user.username must match regex: ^(?=.{3,20}$)(?![_.])(?!.*[_.]{2})[a-z0-9._]+(?<![_.])$
Expected behavior User should be added to RES with a username taken from
User logon name
Actual behavior User is not added to RES due to the above error
Screenshots/Video
Environment (please complete the following information):
Additional context
It looks like RES uses the
cn
attribute as the username: https://github.com/aws/res/blob/2024.01.01/source/idea/idea-cluster-manager/src/ideaclustermanager/app/adsync/adsync_service.py#L214but in Active Directory this is
Firstname Surname
(if those fields are set), which is an invalid RES username, and also isn't guaranteed to be unique.sAMAccountName
should be more suitable: https://serverfault.com/questions/567776/which-field-to-use-when-authenticating-against-active-directory