Mailing List Archive

Authentication using federated identity
I know that there are some methods to use federated identities (e.g.
OAuth2) with SSH authentication but, from what I've seen, they largely
seem clunky and require users to interact with web browsers to get one
time tokens. Which is sort of acceptable for occasional logins but
doesn't work with automated/scripted actions.

I'm just wondering if anyone has done any work on this or has thoughts
on it. I know it would be useful in some contexts (in my case, cross
realm access of independent yet federated services that are pretty
common in R&E HPC communities (e.g. ACCESS)).

Chris
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Authentication using federated identity [ In reply to ]
On 2/8/2024 10:10 AM, Chris Rapier wrote:
> I know that there are some methods to use federated identities (e.g.
> OAuth2) with SSH authentication but, from what I've seen, they largely
> seem clunky and require users to interact with web browsers to get one
> time tokens. Which is sort of acceptable for occasional logins but
> doesn't work with automated/scripted actions.
>
> I'm just wondering if anyone has done any work on this or has thoughts
> on it. I know it would be useful in some contexts (in my case, cross
> realm access of independent yet federated services that are pretty
> common in R&E HPC communities (e.g. ACCESS)).

SSH Certificates are a useful token exchange currency for AuthN (and
basic AuthZ). We can use OIDC to Hashicorp Vault in either
non-interactive mode or MFA mode (via some custom scripting) to turn
Kerberos/MFA into OIDC into Vault into an SSH certificate. Said SSH
certificate can be used directly with SSH, or via a forked pam-ussh
module (with the AuthorizedPrincipalsCommand PR) for other services.

It's kind of a winding path, but leverages our existing tooling to solve
some problems.

Fundamentally, both parties in the federation need to decide on which
AuthN transitions they're comfortable trusting. SSH certificates allow
annotation via naming conventions to denote source AuthN method, which
can then be used in AuthorizedPrincipals to determine access. e.g. Allow
someuser@TOTP but deny someuser@password.

--

Carson


_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Authentication using federated identity [ In reply to ]
On Thu, Feb 8, 2024 at 1:18?PM Chris Rapier <rapier@psc.edu> wrote:
>
> I know that there are some methods to use federated identities (e.g.
> OAuth2) with SSH authentication but, from what I've seen, they largely
> seem clunky and require users to interact with web browsers to get one
> time tokens. Which is sort of acceptable for occasional logins but
> doesn't work with automated/scripted actions.

Is there some reason you wouldn't simply use Kerberos, baked into
Samba and Active Directory, with the long established token handling
provided by Kerberos? Convincing Kerbers and the AD admin who may not
realize they have it to permit that underlying authentication
technology, but it's been stable for decades Part of the difficulty
seems to be every bureaucracy's desire to have their own special rules
and not talk to each other without a lot of Gant charts and big
picture diagrams, but I've been taking advantage of the underlying
Kerberos behind the backs of AD admin for decades.

Unfortunately, everyone seems to want to have their own "invented
here" form of authentication token handling, rather than sticking with
basics. My old classmates at MIT worked *very hard* to make that work,
and to resist abuse, and it still works quite well.


> I'm just wondering if anyone has done any work on this or has thoughts
> on it. I know it would be useful in some contexts (in my case, cross
> realm access of independent yet federated services that are pretty
> common in R&E HPC communities (e.g. ACCESS)).
>
> Chris
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev@mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Authentication using federated identity [ In reply to ]
Practically speaking, most popular IAM and SSO solutions offer OIDC SAML
tokens but do not offer Kerberos tickets.  OpenID Connect is a standard
which itself is based on RFC6749 (OAuth2). This provides a compelling
reason to support it in addition to Kerberos.  I'll also note that OIDC
tokens are easy to validate without a bidirectional trust relationship
between the IdP and RP.

SSH authentication via OAuth2, in particular, would save complexity at
most organizations I've worked with.  All of them so far have preferred
things like automated SSH certificate signers or APIs that cause
orchestration to add SSH keys to authorized_keys on hosts, before they
implement Kerberos just for this.

On top of that, Active Directory is a legacy solution now.  Its
successor uses OAuth2.

On 2024-02-08 23:49, Nico Kadel-Garcia wrote:
> On Thu, Feb 8, 2024 at 1:18?PM Chris Rapier <rapier@psc.edu> wrote:
>> I know that there are some methods to use federated identities (e.g.
>> OAuth2) with SSH authentication but, from what I've seen, they largely
>> seem clunky and require users to interact with web browsers to get one
>> time tokens. Which is sort of acceptable for occasional logins but
>> doesn't work with automated/scripted actions.
> Is there some reason you wouldn't simply use Kerberos, baked into
> Samba and Active Directory, with the long established token handling
> provided by Kerberos? Convincing Kerbers and the AD admin who may not
> realize they have it to permit that underlying authentication
> technology, but it's been stable for decades Part of the difficulty
> seems to be every bureaucracy's desire to have their own special rules
> and not talk to each other without a lot of Gant charts and big
> picture diagrams, but I've been taking advantage of the underlying
> Kerberos behind the backs of AD admin for decades.
>
> Unfortunately, everyone seems to want to have their own "invented
> here" form of authentication token handling, rather than sticking with
> basics. My old classmates at MIT worked *very hard* to make that work,
> and to resist abuse, and it still works quite well.
>
>
>> I'm just wondering if anyone has done any work on this or has thoughts
>> on it. I know it would be useful in some contexts (in my case, cross
>> realm access of independent yet federated services that are pretty
>> common in R&E HPC communities (e.g. ACCESS)).
>>
>> Chris
>> _______________________________________________
>> openssh-unix-dev mailing list
>> openssh-unix-dev@mindrot.org
>> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev@mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Authentication using federated identity [ In reply to ]
On ???, 09 ??? 2024, Falcon Darkstar Momot wrote:
> Practically speaking, most popular IAM and SSO solutions offer OIDC SAML
> tokens but do not offer Kerberos tickets.  OpenID Connect is a standard
> which itself is based on RFC6749 (OAuth2). This provides a compelling reason
> to support it in addition to Kerberos.  I'll also note that OIDC tokens are
> easy to validate without a bidirectional trust relationship between the IdP
> and RP.

In FreeIPA we support issuing Kerberos tickets with user authentication
being handled by an OAuth2 IdP and access authorized via device
authorization grant flow. You'd get a Kerberos TGT ticket that will have
'idp' authentication indicator and this ticket can be used against
GSSAPI-enabled service, including SSH servers. If your service
understands authentication indicators, then you can limit access on the
service side as well.

>
> SSH authentication via OAuth2, in particular, would save complexity at most
> organizations I've worked with.  All of them so far have preferred things
> like automated SSH certificate signers or APIs that cause orchestration to
> add SSH keys to authorized_keys on hosts, before they implement Kerberos
> just for this.
>
> On top of that, Active Directory is a legacy solution now.  Its successor
> uses OAuth2.
>
> On 2024-02-08 23:49, Nico Kadel-Garcia wrote:
> > On Thu, Feb 8, 2024 at 1:18?PM Chris Rapier <rapier@psc.edu> wrote:
> > > I know that there are some methods to use federated identities (e.g.
> > > OAuth2) with SSH authentication but, from what I've seen, they largely
> > > seem clunky and require users to interact with web browsers to get one
> > > time tokens. Which is sort of acceptable for occasional logins but
> > > doesn't work with automated/scripted actions.
> > Is there some reason you wouldn't simply use Kerberos, baked into
> > Samba and Active Directory, with the long established token handling
> > provided by Kerberos? Convincing Kerbers and the AD admin who may not
> > realize they have it to permit that underlying authentication
> > technology, but it's been stable for decades Part of the difficulty
> > seems to be every bureaucracy's desire to have their own special rules
> > and not talk to each other without a lot of Gant charts and big
> > picture diagrams, but I've been taking advantage of the underlying
> > Kerberos behind the backs of AD admin for decades.
> >
> > Unfortunately, everyone seems to want to have their own "invented
> > here" form of authentication token handling, rather than sticking with
> > basics. My old classmates at MIT worked *very hard* to make that work,
> > and to resist abuse, and it still works quite well.
> >
> >
> > > I'm just wondering if anyone has done any work on this or has thoughts
> > > on it. I know it would be useful in some contexts (in my case, cross
> > > realm access of independent yet federated services that are pretty
> > > common in R&E HPC communities (e.g. ACCESS)).
> > >
> > > Chris
> > > _______________________________________________
> > > openssh-unix-dev mailing list
> > > openssh-unix-dev@mindrot.org
> > > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
> > _______________________________________________
> > openssh-unix-dev mailing list
> > openssh-unix-dev@mindrot.org
> > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev@mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

--
/ Alexander Bokovoy
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Authentication using federated identity [ In reply to ]
On 2/9/24 2:49 AM, Nico Kadel-Garcia wrote:
> On Thu, Feb 8, 2024 at 1:18?PM Chris Rapier <rapier@psc.edu> wrote:
>>
>> I know that there are some methods to use federated identities (e.g.
>> OAuth2) with SSH authentication but, from what I've seen, they largely
>> seem clunky and require users to interact with web browsers to get one
>> time tokens. Which is sort of acceptable for occasional logins but
>> doesn't work with automated/scripted actions.
>
> Is there some reason you wouldn't simply use Kerberos, baked into
> Samba and Active Directory, with the long established token handling
> provided by Kerberos? Convincing Kerbers and the AD admin who may not

Largely because I'm trying to work within an existing system that has
established methodologies. The really fun part is that I'd be trying to
do this in a way that supports European R&E communities and US R&E
communities which use different methodologies and have different
organizational structures.

Prior experience with kerberos in these communities has not proven to be
fruitful. It may be worth trying to revisit that, but I don't have any
pull in transnational EU R&E HPN consortiums. They're pretty taken with
OAuth which is great if you are doing everything in a browser. The US
consortium I have more connections with but again, they're pretty taken
with web based SSOs on their science gateways.

Chris
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Authentication using federated identity [ In reply to ]
On 2024-02-12 22:15, Chris Rapier wrote:
>
>
> On 2/9/24 2:49 AM, Nico Kadel-Garcia wrote:
>> On Thu, Feb 8, 2024 at 1:18?PM Chris Rapier <rapier@psc.edu> wrote:
>>>
>>> I know that there are some methods to use federated identities (e.g.
>>> OAuth2) with SSH authentication but, from what I've seen, they largely
>>> seem clunky and require users to interact with web browsers to get one
>>> time tokens. Which is sort of acceptable for occasional logins but
>>> doesn't work with automated/scripted actions.
>>
>> Is there some reason you wouldn't simply use Kerberos, baked into
>> Samba and Active Directory, with the long established token handling
>> provided by Kerberos? Convincing Kerbers and the AD admin who may not
>
> Largely because I'm trying to work within an existing system that has established methodologies. The really fun part is that I'd be trying to do this in a way that supports European R&E communities and US R&E communities which use different methodologies and have different organizational structures.
>
> Prior experience with kerberos in these communities has not proven to be fruitful. It may be worth trying to revisit that, but I don't have any pull in transnational EU R&E HPN consortiums. They're pretty taken with OAuth which is great if you are doing everything in a browser. The US consortium I have more connections with but again, they're pretty taken with web based SSOs on their science gateways.
>
> Chris
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev@mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

Hi Chris and others,

being on the European side of the coin in quite a similar situation was
actually the reason to subscribe to this list in the first place.

I can only support your analysis that if you want to hook into
existing federations your probably have to use some sort of web-technology.
In our case this is also done so that users, who typically have to authenticate
to their "home" institutions, can validate the authenticity of the login
page, for instance by checking the browsers SSL data.

Another important requirement for us is that the users, i.e. the client side,
do no have to install any "non-standard" software, but can essentially run with
"OS-provided" ssh-clients and web-browsers. This since our users typically connect
to many HPC centers and have gotten pretty tired of doing something special for
each one of them.

In the end the not so elegant solution that we came up with is to use a
web-based service for users to upload their SSH public keys to us after
identifying themselves using the federated login. While the users also have
to maintain a list of by them approved origins for login, for us IP-address
or DNS name patterns, they don't have to punch in one-time codes for every
login, at the expense of some security.

Technically for us the biggest challenge was that web-browsers, for good reason,
try to isolate a web-site from direct interaction with for instance
the file-system of the client-computer. Consequently, we have not yet
found a good way to for example get a token, e.g. a SSH key or certificate,
in or out of the web-browser into the non-web part, for instance a SSH agent
or nice place of the file-system. In the end our service basically asks
the user to locate the SSH pubic key file in the web-browsers file-chooser
dialog since one could not even make a suggestion of a file-name to
the web-browser that the user simply could approve.

It would be interesting to hear what your thoughts and progress is on that
matter since I am kind of looking to get to a more widely-used solution
than our current deployment. On a side-node the Puhuri project
(https://puhuri.neic.no/) also provides some infrastructure
to handle SSH public keys for the LUMI supercomputer in Finnland.

Best Regards
Gilbert Netzer
PDC/KTH
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Authentication using federated identity [ In reply to ]
On 13/02/2024 09:35, Gilbert Netzer wrote:
> we have not yet
> found a good way to for example get a token, e.g. a SSH key or certificate,
> in or out of the web-browser into the non-web part, for instance a SSH agent

Here's something I knocked together for my own use:

https://github.com/candlerb/vault-ssh-agent-login

You run this from the command line, and it talks to your local
ssh-agent. If you don't have a suitable certificate already then it
generates a new key pair, gets Vault to sign it, and then inserts the
new key and cert into ssh-agent (set to expire when the cert expires).

If you're using Vault with OIDC auth then it opens a browser window for
that part, similar to how kubelogin works.

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev