Open ed-boykin opened 1 month ago
A big more info, I didnt have the debug info set quite right but now I do and here's more info about what happens when I try to login using authd from an Azure Bastion host
Nov 07 18:38:53 authd xrdp[5067]: [ERROR] xrdp_rdp_recv: xrdp_channel_process failed
Nov 07 18:38:57 authd xrdp[5067]: [INFO ] connecting to sesman on 127.0.0.1:3350
Nov 07 18:38:57 authd xrdp-sesman[1194]: [INFO ] Socket 13: AF_INET6 connection received from ::1 port 34608
Nov 07 18:38:57 authd xrdp[5067]: [INFO ] xrdp_wm_log_msg: sesman connect ok
Nov 07 18:38:57 authd xrdp[5067]: [INFO ] sesman connect ok
Nov 07 18:38:57 authd xrdp[5067]: [INFO ] sending login info to session manager. Please wait...
Nov 07 18:38:57 authd authd-pam[5165]: adapter.userSelected{username:"###REDACTED###"}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.userSelected{username:"###REDACTED###"}
Nov 07 18:38:57 authd authd-pam[5165]: adapter.supportedUILayoutsReceived{layouts:[]*authd.UILayout{(*authd.UILayout)(0xc0001a79d0), (*authd.UILayout)(0xc0001a7a40), (*a>
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.supportedUILayoutsReceived{layouts:[]*authd.UILayout{(*authd.UILayout)(0xc0001a79d0), (*authd.UILayou>
Nov 07 18:38:57 authd authd-pam[5165]: adapter.UsernameOrBrokerListReceived{}
Nov 07 18:38:57 authd authd-pam[5165]: adapter.GetAuthenticationModesRequested{}
Nov 07 18:38:57 authd authd-pam[5165]: adapter.brokersListReceived{brokers:[]*authd.ABResponse_BrokerInfo{(*authd.ABResponse_BrokerInfo)(0xc0000c0140), (*authd.ABRespons>
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.brokersListReceived{brokers:[]*authd.ABResponse_BrokerInfo{(*authd.ABResponse_BrokerInfo)(0xc0000c014>
Nov 07 18:38:57 authd authd-pam[5165]: adapter.UsernameOrBrokerListReceived{}
Nov 07 18:38:57 authd authd[1146]: 2024/11/07 18:38:57 WARN rpc error: code = NotFound desc =
Nov 07 18:38:57 authd authd[1146]: DEBUG User "###REDACTED###" is unknown
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.brokerSelectionRequired{}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: tea.sequenceMsg{(tea.Cmd)(0x56fd77ae2d80), (tea.Cmd)(0x56fd77aef160)}
Nov 07 18:38:57 authd authd-pam[5165]: adapter.ChangeStage{Stage:1}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.nativeAsyncOperationCompleted{}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: tea.sequenceMsg{(tea.Cmd)(0x56fd77aec7a0), (tea.Cmd)(nil), (tea.Cmd)(nil)}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.nativeStageChangeRequest{Stage:1}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.nativeChangeStage{Stage:1}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: tea.sequenceMsg{(tea.Cmd)(0x56fd77aef3e0), (tea.Cmd)(0x56fd77aef360)}
Nov 07 18:38:57 authd authd-pam[5165]: adapter.ChangeStage{Stage:1}
Nov 07 18:38:57 authd xrdp-sesman[1194]: [ERROR] Unhandled message in verify_pam_conv { style = PAM_PROMPT_ECHO_ON, msg = "== Broker selection ==
1 - local
2 - Microsoft Entra ID
Select broker: " }
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.nativeBrokerSelection{}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: tea.sequenceMsg{(tea.Cmd)(nil), (tea.Cmd)(nil)}
Nov 07 18:38:57 authd xrdp-sesman[1194]: pam_authd_exec(xrdp-sesman:auth): conversation failed
Nov 07 18:38:57 authd authd-pam[5165]: failed to call com.ubuntu.authd.pam.Prompt: Conversation error
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: tea.sequenceMsg{(tea.Cmd)(0x56fd77ae2d80), (tea.Cmd)(0x56fd77af07c0)}
Nov 07 18:38:57 authd authd-pam[5165]: Native model update: adapter.nativeAsyncOperationCompleted{}
Nov 07 18:38:57 authd authd-pam[5165]: adapter.pamError{status:4, msg:"broker selection error: <nil>: Conversation error"}
Nov 07 18:38:57 authd xrdp-sesman[1194]: [ERROR] PAM: broker selection error: <nil>: Conversation error
Nov 07 18:38:57 authd authd-pam[5165]: AUTH: exiting with error System error: broker selection error: <nil>: Conversation error
Nov 07 18:38:57 authd xrdp-sesman[1194]: [ERROR] pam_authenticate failed: System error
Nov 07 18:38:57 authd xrdp-sesman[1194]: [INFO ] AUTHFAIL: user=###REDACTED### ip=::ffff:10.47.1.132 time=1731004737
Nov 07 18:38:57 authd xrdp-sesman[1194]: [ERROR] sesman_data_in: scp_process_msg failed
Nov 07 18:38:57 authd xrdp[5067]: [INFO ] xrdp_wm_log_msg: login failed for user ###REDACTED###
Nov 07 18:38:57 authd xrdp-sesman[1194]: [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
Nov 07 18:38:57 authd xrdp[5067]: [INFO ] login failed for user ###REDACTED###
Nov 07 18:39:02 authd sudo[5176]: edboykin : TTY=pts/2 ; PWD=/home/######; USER=root ;
So, it looks like its failing because I cant respsond to the broker selection. Is there a way to force it default to EntraId?
Nov 07 18:38:57 authd xrdp-sesman[1194]: [ERROR] Unhandled message in verify_pam_conv { style = PAM_PROMPT_ECHO_ON, msg = "== Broker selection == 1 - local 2 - Microsoft Entra ID Select broker: " }
It seems your PAM client doesn't handle the PAM conversation properly... In particular xrdp-sesman
. So it seems that it needs some work.
Ok so such client does not support the PAM_PROMPT_ECHO_ON conversations, so those where the input is shown to the user.
As workaround, maybe, we may just always use PAM_PROMPT_ECHO_OFF
conversations in this client, although that is the one that really needs fix.
OK, the issue is with xrdp not handling the PAM_PROMPT_ECHO_ON at all. A possible workaround could be implemented from the authd side but the better solution is for srdp to handle the message and interaction. Thanks for looking into this! I'll submit a feature request to the xrdp project.
Ok, looks like xrdp isn't going update any time soon with this functionality :( . Any chance for the Authd workaround to be done?
Well it's still a bit problematic because I feel that even doing it, xrdp wouldn't support multiple requests...
Is there an existing issue for this?
Describe the issue
After setting up authd and the EntraID broker, new users cannot login for the first time via Azure Bastion via SSH or RDP
Steps to reproduce
1 Create Ubuntu 24.04 VM on Azure
System information and logs
authd version
authd-msentraid broker version
gnome-shell version
Distribution
Logs
authd broker configuration
/etc/authd/brokers.d/msentraid.conf
authd-msentraid configuration
Double check your logs