XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    MFA for console access

    Scheduled Pinned Locked Moved Unsolved XCP-ng
    11 Posts 4 Posters 439 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • poddingueP
      poddingue Vates 🪐 @dkmuir
      last edited by

      I haven't tried Duo on a host myself, so this comes from reading an 8.3 dom0 rather than from experience. 🤷

      The first thing I'd watch is that XAPI checks the root password through PAM as well. /etc/pam.d/xapi just includes system-auth, so my guess is that a Duo module placed in system-auth would make every password login to XAPI (XO's connection to the pool, xe -pw, XO Lite) ask for a factor it can't give.

      The physical console is less simple than it looks too: tty1 runs xsconsole, and on my 8.3 host it checks root against the password-auth PAM service by handing over just the password, so I'd expect a module that asks a second question to make that login fail rather than prompt.

      Also worth knowing before an audit: software from outside the XCP-ng repos isn't supported in dom0 (https://docs.xcp-ng.org/installation/requirements), and as far as I can tell from rpm, /etc/pam.d/xapi isn't marked as a config file, so an update would put it back.

      Anyone who has been through this for real will know more than me.

      1 Reply Last reply
      Reply Quote 0
      • D
        dkmuir
        last edited by

        Thanks for the input @poddingue. I was kind of afraid that it would make keeping the system up to date impractical. We're looking at securing physical access with MFA instead.

        1 Reply Last reply
        Reply Quote 0
        • G
          Greg_E
          last edited by

          In a similar case, I was looking to see if I can add a FIDO2 key for authentication to XO. I looked in the authentication plugins but it wasn't clear to me and I haven't had time to look into this deeper.

          If it matters, I would be using an Onlykey device which is FIDO2 compliant (Yubikey), I have the 6 button key, but probably buy the 2 button for work stuff and keep the 6 button for things at home.

          J 1 Reply Last reply
          Reply Quote 0
          • J
            john.c @Greg_E
            last edited by john.c

            @Greg_E said:

            In a similar case, I was looking to see if I can add a FIDO2 key for authentication to XO. I looked in the authentication plugins but it wasn't clear to me and I haven't had time to look into this deeper.

            If it matters, I would be using an Onlykey device which is FIDO2 compliant (Yubikey), I have the 6 button key, but probably buy the 2 button for work stuff and keep the 6 button for things at home.

            @greg_e To add to this: XO doesn't support FIDO2 hardware keys natively on its own, which is why you didn't see a direct option in the plugin list. Instead, XO delegates MFA and hardware key handling to an external Identity Provider (IdP).
            Setting up a Keycloak instance (or a lighter-weight alternative like Authentik or Authelia) is the right move here. Here is the general flow to get your OnlyKey working with XO:

            1. Enable the XO Plugin: In XO, go to Settings > Plugins and enable auth-oidc (OpenID Connect) or auth-saml. (Note: If you run XO from source rather than XOA, make sure the xo-server-auth-oidc package is installed).
            2. Configure your IdP: Create an OIDC/SAML client in Keycloak for XO, and enable WebAuthn / FIDO2 in Keycloak's authentication flows so it prompts for your OnlyKey.
            3. Link them: Point XO's OIDC plugin to your Keycloak realm's auto-discovery URL (.well-known/openid-configuration) along with the Client ID and Secret.

            Once linked, logging into XO will redirect you to Keycloak, where you can tap your OnlyKey for FIDO2/2FA before being sent back to XO

            1 Reply Last reply
            Reply Quote 1
            • J
              john.c
              last edited by john.c

              Since you mentioned getting a 2-button OnlyKey for work, setting up Keycloak now is a great foundation if you ever want to expand SSO across other network services.

              For XO specifically, you'll want to look at the auth-oidc or auth-saml plugins—XO doesn't do FIDO2 natively, so it hands off the hardware key prompt to Keycloak. Once that's working, you can use the exact same Keycloak instance to handle WebAuthn/MFA for other internal tools, pre-provision individualized keys/accounts for multiple users, and separate permissions by group. Just make sure to keep a local break-glass admin account on XO in case the Keycloak VM ever goes offline!

              @dkmuir Currently can’t do MFA on a per host level (XCP-ng) worth adding as feedback to https://feedback.vates.tech. Though if you are trying to do this for Xen Orchestra see the above for Greg_E.

              1 Reply Last reply
              Reply Quote 1
              • J
                john.c
                last edited by john.c

                Quick clarification on the above: Keycloak doesn't have to run as a VM—in fact, running it on bare metal (or separate out-of-band hardware) is best practice here. That way, you avoid a chicken-and-egg lockout if the IdP VM is migrating or offline during a Rolling Pool Update (RPU) or host reboot.

                Even better, running a pair or trio of bare-metal Keycloak instances in a cluster behind a load balancer eliminates any single point of failure—which is ideal if you ever scale SSO out across a broader network (like an academic or multi-service environment).

                1 Reply Last reply
                Reply Quote 1
                • J
                  john.c
                  last edited by john.c

                  @poddingue If the above looks good and works as a best practice, it might be worth adding to the Xen Orchestra documentation. Alternatively, if this is already covered in the official Keycloak, Authentik, or Authelia docs, linking to or referencing those sections could be helpful.

                  poddingueP 1 Reply Last reply
                  Reply Quote 1
                  • poddingueP
                    poddingue Vates 🪐 @john.c
                    last edited by poddingue

                    Let me see what I can do, @john.c.
                    Thanks! 👍

                    J 1 Reply Last reply
                    Reply Quote 1
                    • J
                      john.c @poddingue
                      last edited by john.c

                      @poddingue said:

                      Let me see what I can do, @john.c.
                      Thanks! 👍

                      Thanks @poddingue! Having it in the docs will be huge not just for VMware migrations, but for fresh setups too—making it easier for newcomers to get it right from day one, and giving everyone a clean link to point to whenever the question comes up in the future.

                      poddingueP 1 Reply Last reply
                      Reply Quote 0
                      • poddingueP
                        poddingue Vates 🪐 @john.c
                        last edited by

                        Most of it turns out to be in the XO docs already. 😊
                        The passkeys section covers Keycloak, the WebAuthn flow and a Yubikey as second factor: https://docs.xen-orchestra.com/security/user-management/authentication-providers#enabling-passkeys-in-xoa-with-keycloak.
                        What I couldn't find on that page are your two operational points, keeping a local admin account for when the IdP is down and not hosting the IdP only on the pool XO manages.
                        I tried it on an XO built from sources with the OIDC plugin turned on: the login page still offers "Sign in with password" next to the OpenID Connect button, and a local admin could still log in, so a break-glass account should keep working, though I only had a dummy client, not a real Keycloak. 🤷

                        I'll see about getting a short note with those two points added to that page. @Greg_E, if a second factor without an IdP is enough for you, XO also does TOTP for local accounts (same page), though that's not a hardware key.

                        1 Reply Last reply
                        Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post