TheJumpCloud / support

Public scripts and examples for managing JumpCloud managed systems and service endpoints
264 stars 149 forks source link

Wrong certificate delivered to users with similar names #550

Open alister-cf opened 7 months ago

alister-cf commented 7 months ago

Describe the bug If we have two users with similar usernames there is a chance they will get the other person's certificate. e.g. john john.smith

john will get both his and john.smith's certs but will likely have john.smith's cert installed so will end up with certificate issues

To Reproduce create two similar users that will get and use certificates, e.g. john and john.smith

Expected behavior Each user should only get their certificate and have the correct one installed

Links n/a

Screenshots n/a

System Device (please complete the following information):

Additional context n/a

Possible Working Solution change the following line in Distribute-UserCerts.ps1 $userCertFiles = Get-ChildItem -Path "$JCScriptRoot/UserCerts" -Filter "$($user.userName)*" to $userCertFiles = Get-ChildItem -Path "$JCScriptRoot/UserCerts" -Filter "$($user.userName)-*"

This is adding a - to the -Filter after $($user.userName) so correct files are matched

jworkmanjc commented 6 months ago

Noted, we will validate and fix here shortly!