Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Machines have less problems. I'd like to be a machine. -- Andy Warhol


devel / comp.protocols.kerberos / Re: 2FA with krb5

SubjectAuthor
o Re: 2FA with krb5Ken Hornstein

1
Re: 2FA with krb5

<mailman.1.1633570039.10600.kerberos@mit.edu>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=159&group=comp.protocols.kerberos#159

  copy link   Newsgroups: comp.protocols.kerberos
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!.POSTED.pch.mit.edu!not-for-mail
From: ken...@cmf.nrl.navy.mil (Ken Hornstein)
Newsgroups: comp.protocols.kerberos
Subject: Re: 2FA with krb5
Date: Wed, 06 Oct 2021 21:27:04 -0400
Organization: TNet Consulting
Lines: 161
Message-ID: <mailman.1.1633570039.10600.kerberos@mit.edu>
References: <5ee92454-ec38-d5de-5b36-4b2d87fd7f@prime.gushi.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Injection-Info: tncsrv06.tnetconsulting.net; posting-host="pch.mit.edu:18.7.21.50";
logging-data="17447"; mail-complaints-to="newsmaster@tnetconsulting.net"
Cc: kerberos@mit.edu
To: "Dan Mahoney (Gushi)" <danm@prime.gushi.org>
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=WVZ5RnDqa2e6xVtiagbbuTKEwhHDqeEeTBCwekRh9nZPovCFN/6wDoa7grk+KFtVpmZDxDbGzF17Ir0lXdAnQE7+PkDj89IszTd9GyFuw9jrsQGaHPvCZlnKs2F4hzQ2wsW/Yg1mlWX3G+G1xQ+LVEofLtXsv5MtPglfSVrnNdQ0Il8Z242+T77EevAKqUCG04OsB96sK868rt1I7/WxaKOuVxg1jOyoYuRCYi2sbZTnVSs5HCSNYl350s9zlK+oRTEYfF+Z5IIkc39pXACKZYiw3r7nnVxiqoP3gmVCE05d6xAWd3uOzuhjbb3cJXrD1x18tu7DAWv/aUfXNgs3wg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=PmSOijT+kcpl8A3972xFcpAvE3Q7LzJSBh47mZViwqo=;
b=K1+uypVKtqfpbe0t9V9O/KQN3/kZ9enDz5m/69bEXlE8tzLKd5gk/rxnNuVFFB8xyUcESbGAVHe3GHNitHB06ycAm1bo7G0VA0YTI8d5THEgPrdfKFmpiESs9K/bpyDXrmVBURQALxey7crmxruoieZqqoBKTm4EesTLCpI/m1zfwIoSqog/G6pXKnhe24de/LUVcIgyosP/dseMJVojTIjHdrHDPs6/uAfpgED3c5Wiuy5w2qKTBBRfK4YNknWwBdqTN1Poev51H1OgLGmfRUFhIqPycN4ZWupNXf06urV031JOo6aVRXSm1bGz/K4LXQ6jDQPIY1Qb+gXI2PFSdQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=mitprod.onmicrosoft.com; s=selector2-mitprod-onmicrosoft-com;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=PmSOijT+kcpl8A3972xFcpAvE3Q7LzJSBh47mZViwqo=;
b=cRyalDPh4ZMmnb9QmpbaMZx5JIpKsHBKcnjiHbqO4NJ68r0ScMp62c1sJHN4YtBP/OfrPecY7EJRB7SLtgMyhcU4/FHv/aXhahanbkkthUp24cz1BQjzna6pkt5J279zULyFORjBzyC1uGMP79PqExCfr/RS9opSnBHV5jTLwpI=
Authentication-Results: spf=pass (sender IP is 140.32.61.234)
smtp.mailfrom=cmf.nrl.navy.mil; mit.edu;
dkim=pass (signature was verified)
header.d=nrl.navy.mil;mit.edu; dmarc=pass action=none
header.from=cmf.nrl.navy.mil;
Received-SPF: Pass (protection.outlook.com: domain of cmf.nrl.navy.mil
designates 140.32.61.234 as permitted sender)
receiver=protection.outlook.com; client-ip=140.32.61.234;
helo=mfw.dren.mil;
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nrl.navy.mil;
h=message-id : from :
to : cc : subject : in-reply-to : references : mime-version :
content-type
: date; s=s2.dkim; bh=PmSOijT+kcpl8A3972xFcpAvE3Q7LzJSBh47mZViwqo=;
b=jjUwbKv/SlSoO14DXu0agDePFbaiiOH7p0+5tl/aY+V/0XwC6+nsjpaPttp29iPMexrj
7QuJqGXKeJbUvaGLzcO3YzxSXfjx5aVYOxDZGXKXgxjdgaCEY5ioKFfwMe0frsZ1Pk7t
nCDn+Udm1hStD6RKek/ecVNYkJBYR10FuziWIzQSj5lWiyhBXaAoudKpqPc6uHf30aqV
RnGzlx6SQ3/eWQ/YZxTxtwnFGfEnMunw0xpUOuWNsyjDpDGgYBJhMahhtLgm4QbfX7XL
QmjtQ33I2xL7jY6s/ECywWALOgxPUmnqIqYS6KpWmkLbtLV3wVAK6XwdR+5GWn07rJK4
9w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nrl.navy.mil;
h=message-id : from :
to : cc : subject : in-reply-to : references : mime-version :
content-type
: date; s=s1.dkim; bh=PmSOijT+kcpl8A3972xFcpAvE3Q7LzJSBh47mZViwqo=;
b=OUJ/TA28/YydnT1rSYvr4/XrriM92QZQb7oXETyEdrfg8BCIm9S+kZCvICf2PHAk2rzc
IljwxFUhj9H0edbSThW/Xo6KuazQjQvTmcZMnu0zhR+1oVQ5by88DRwcsaVtF7tKe6th
h8HQo1rlNTsJ9jRqMoYYrODu5Id0AZna0+E=
In-Reply-To: <5ee92454-ec38-d5de-5b36-4b2d87fd7f@prime.gushi.org>
X-Face: "Evs"_GpJ]],xS)b$T2#V&{KfP_i2`TlPrY$Iv9+TQ!6+`~+l)#7I)0xr1>4hfd{#0B4
WIn3jU;bql;{2Uq%zw5bF4?%F&&j8@KaT?#vBGk}u07<+6/`.F-3_GA@6Bq5gN9\+s;_d
gD\SW #]iN_U0 KUmOR.P<|um5yP<ea#^"SJK; C*}fMI;
Mv(aiO2z~9n.w?@\>kEpSD@*e`
X-NRLCMF-Spam-Score: () hits=0 User Authenticated
X-NRLCMF-Virus-Scanned: No virus found
X-EOPAttributedMessage: 0
X-EOPTenantAttributedMessage: 64afd9ba-0ecf-4acf-bc36-935f6235ba8b:0
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 07ff73cf-66ca-4c55-fafd-08d9893196ed
X-MS-TrafficTypeDiagnostic: BYAPR01MB4472:
X-LD-Processed: 64afd9ba-0ecf-4acf-bc36-935f6235ba8b,ExtAddr
X-MS-Exchange-AtpMessageProperties: SA
X-Microsoft-Antispam-PRVS: <BYAPR01MB447294986793A166EBEE6642ACB19@BYAPR01MB4472.prod.exchangelabs.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:569;
X-MS-Exchange-SenderADCheck: 0
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: YPNdHE0k7nLDwzfMbG1KDX0R76b/HORnI4GB2jMnGrgmn4/OA4ki5/vP7M3/3FlrZBkt9vnv/M82cSo3dfTGjksgWITqfSUC875xJRvVlplP9fDkUzNhofiSmeNT8m6syRQsVhua9WcpOjX7YvkEWpBxnO4AeY7rC1g1XojAU97e13JqgC4ZVSRZGGqDX6D1ZoRs1SNd/5uDgawRMz1DavFxIjjRZYmrHDe36jqAWqZC4O6qjbtwA/lFN598GEPt53GI1Jm8XLdLl1zzIP7dffYUDdOyqgAhSP55iHfjtSOgDJC2SgzORBRuri1bwsJdW0KSAlr6YGUDWT94hKmtDJZvQdQ9WvwTpelBqRsFKlQG+fOOBd4bHb9Z7ZSEp5UWjeP1Cuv/gZzAAWYHKVoGHHqG4SraHcmYdryHFiqsCFxE1G2kaidsG3ItNXanP2pGvM9CQ97jZtuadFqMYIgaf4QbmqKjRkQeeRdxxNPhxRdD83wb3hTDiksFa2Z8ZHl2NCT3Me6xlfbGAvfg15btL+cBkC1B5stIfCicntlIS44/Ve31iaTZ8cI/f1un60U84sm062imPZ7U4rq2AtGSex0YJMISh7NFE9Ci7rS2Hc8hMxoC9/y/uRjTghTCkOO2HlOUjRGgq7wZ7nmANp6hw5Or9yxBOo/ZTKYTCKZ9ROb68j74E5OmMmw10StgPoYaVv6nke6Ka7q0cpKhJx6XjA==
X-Forefront-Antispam-Report: CIP:140.32.61.234; CTRY:US; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:mfw.dren.mil; PTR:mfw.dren.mil; CAT:NONE;
SFS:(4636009)(68406010)(26005)(70586007)(86362001)(356005)(1076003)(83380400001)(4326008)(426003)(6862004)(2906002)(966005)(956004)(5660300002)(8676002)(33656002)(336012)(316002)(786003)(7596003)(7636003)(508600001);
DIR:OUT; SFP:1102;
X-Auto-Response-Suppress: DR, OOF, AutoReply
X-MS-Exchange-Transport-Forked: True
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2021 01:27:12.6778 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 07ff73cf-66ca-4c55-fafd-08d9893196ed
X-MS-Exchange-CrossTenant-Id: 64afd9ba-0ecf-4acf-bc36-935f6235ba8b
X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT014.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: Internet
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR01MB4472
X-OriginatorOrg: mitprod.onmicrosoft.com
X-BeenThere: kerberos@mit.edu
X-Mailman-Version: 2.1.6
Precedence: list
List-Id: The Kerberos Authentication System Mailing List <kerberos.mit.edu>
List-Unsubscribe: <https://mailman.mit.edu/mailman/listinfo/kerberos>,
<mailto:kerberos-request@mit.edu?subject=unsubscribe>
List-Archive: <http://mailman.mit.edu/pipermail/kerberos>
List-Post: <mailto:kerberos@mit.edu>
List-Help: <mailto:kerberos-request@mit.edu?subject=help>
List-Subscribe: <https://mailman.mit.edu/mailman/listinfo/kerberos>,
<mailto:kerberos-request@mit.edu?subject=subscribe>
 by: Ken Hornstein - Thu, 7 Oct 2021 01:27 UTC

>We'd like to be able to leverage 2fa for some services (admins) and some
>services (ssh logins) but not have to pump a 2fa code into, say, our mail
>applications. Is there a way to make the acquisition of a TGT (for GSSAPI
>authentication) vs Password Authentication require 2fa?

Yes (I'll explain more below).

>That's complication number one.
>
>Complication number 2 is something like "SecurID is *expensive* for a
>fairly small (<10) admin team."

Yeah, tell me about it.

>Is there any reasonable support for off-the-shelf TOTP or HOTP
>authenticators, i.e. google authenticator or whatnot? If so, is there
>support to have a user have *multiple* available authenticators, such that
>one can be expired and others not?

There is not such a thing yet, AFAIK. It's something on my list to
implement TOTP support (but, it's kinda far down). It's complicated
(again, see below).

>Googling this all gets me a bunch of (some older, some newer articles
>about the varying states of SPAKE and the like), and...a whole bunch of
>ads now being shown for startups that want to do it differently but I'm
>SURE no way to integrate with this.
>
>The final problem, of course, is that if I make all my KDC's 2fa-aware on
>their own, there's no communication of double-use of a token, unless I
>centralize things, which breaks the purpose of having geo-diverse KDC's.
>I don't suppose the kerberos db replication mechanism has anything that
>can also share this state?
>
>This is all pie-in-the-sky stuff, but practical answers "just an FAQ" are
>hard to find.

So, I think I speak with some authority on this subject; I've been involved
with some kind of 2FA with Kerberos for a ... couple of decades? Yikes,
I feel old. Anyway, the super short summary is:

- You can do it, but depending on exactly WHAT you want to do may
involve writing some code. You've heard the expression, "With a big
enough engine, you can make a barn door fly"? That applies here.
- There are some architectural issues that makes this all complicated
to deploy. I'll try to touch on those.

The first question you need to answer is: what are your clients? This
is important because which specific 2FA protocol you use depends on
what clients you have. The 3 main protocols I am aware of are

- SAM2 - this is the old protocol that we originally used waay back
when we started (and we still use today for some factors). You can
pretty much use any factor with it; we used SecurID, CryptoCARD,
and today use YubiKey. The major disadvantage is it is only supported
by MIT-based Kerberos clients. I did a small amount of the protocol
work on SAM2 but for various complicated reasons it never resulted
in a published RFC.

- FAST. This is a newer protocol that provides a generic encrypted
tunnel to send preauthentication messages over (these are called "FAST
factors"). It's a more complicated protocol, but superior to SAM2;
if it was around when we started we would have used it. It is supported
by MIT and Heimdal; it may be supported by Windows, I am not sure.
There is already a FAST factor defined for One-Time Passwords, called
"OTP". I am not sure of the client coverage of the OTP FAST
factor, though. I will admit that I do not know as much about FAST as
the other mechanisms, so if people chime in and correct me you should
believe them over me.

- PKINIT. This uses an existing PKI to completely replace a password. I
mention this as 2FA since in our deployment we use client certificates
on smartcards which require PINs to unlock, hence the two factors.
This is supported by all 3 major Kerberos implementations (well, maybe
not the smartcard piece, but MIT Kerberos does, except on Windows).
If you can leverage an existing PKI then it's not a bad choice, but
it is a complicated mess to get going; there are SO MANY ways for
it to go wrong.

So, which protocol should you use? Well, even though I hold a soft spot
for SAM2, I can't really recommend using it for new implementations;
ours is really just due to legacy code. So that's either FAST OTP or
PKINIT. However ... FAST does require a special "FAST armour key"
(which is typically a host key) or support for anonymous PKINIT.
Either of those requires a bit of magic at kinit time, which I haven't
completely sussed out all yet. I'm not actually sure if FAST OTP has
been deployed anywhere; it may be! If so, no one talks about it.
One advantage of SAM2 is that it "just works" when you enable it
(assuming everything else is set up correctly).

There is an existing FAST OTP implementation for MIT Kerberos; the
documentation is here:

https://web.mit.edu/kerberos/www/krb5-latest/doc/admin/otp.html

The implementation requires you to verify the token using a RADIUS
server. If you do not like that, you'd have to write your own
implementation (and, sadly, that requires Kerberos internals; sigh, I
wish that interface was better defined).

In terms of using it for access to certain hosts, you have a couple
of options. The preauth mechanism can set what are known as "authentication
indicators" in the ticket; you can either configure a host principal
to only allow the acquisition of a service ticket if it has a particular
indicator, or you can modify the server software so it checks for
a particular indicator. We used a variation of the second approach;
there is a Kerberos ticket flag called HW_AUTH, and our application server
code checks for that on the subset of hosts that require it (this was
before authentication indicators were developed as a protocol extension).

Now, in terms of "challenges" ... here's my understanding of the
practical issues you will face:

- As you note, talking to an external server kills the KDC redundancy.
And a lot of OTP mechanisms require this. In the larger deployment
I have worked on, we supported three OTP hardware tokens: SecurID,
CRYPTOCard, and YubiKey. With CRYPTOCard, I wrote that mechanism and
put the "secret" directly in the KDC. That worked, but it had an
unfortunate wart that if you talked to a replica KDC there was no way
of propagating the "used" token back to the primary (since 99% of the
requests went to the primary KDC, it never ended up being a problem in
practice, but I knew it was an issue and never figured out a reasonable
solution). With SecurID and YubiKey, the KDC ends up talking to external
verification servers. For various dumb reasons the SecurID server
implementation never worked well, but the YubiKey one seems to work
pretty well. It does have the obvious problem that if the YubiKey
server goes down then you can't kinit if you're using YubiKey (and
that has happened to us).

- There's not a way to OPTIONALLY say, "I'd like to use OTP now". You can
set it on a per-user basis, but kinit (and the underlying API) doesn't
have the ability to say, "Please let me use OTP for this request".
We have some local hacks to enable this functionality. In discussions
on krbdev I believe MIT was open to this functionality, but the
actual WORK hasn't been done. I was the obvious one to do this work,
but I just submitted a pullup request for a very simple change that I
said I'd do back in May, so ... I'm behind. Discussion on this is
here:

http://mailman.mit.edu/pipermail/krbdev/2021-April/013448.html

Now, strangely enough, even though PKINIT is a giant pain in the ass
it solves a lot of these issues (admittedly, by foisting them off onto
a PKI, but hey ...). So if you want to use PKINIT, that might be a
way to go. In terms of second factors, have you looked at the YubiKey
tokens? The latest ones can act as a PIV token, and you should be able
to get PKINIT working with them (I will admit I've played around with
a YubiKey token and I see it shows up as a PIV token, but I didn't get
a chance to go farther). In theory you could implement the YubiKey
verification directly in the KDC, but that has all of the issues with
the CRYPTOCard support I mentioned.

I hope it doesn't sound like I'm crapping on people here; a lot of
very smart people did a lot of very good work in terms of the protocol
and the code framework for implementing multi-factor authentication in
Kerberos. It is not an easy problem! But the documentation on it all
is a bit ... diffused.

Anyway, I hope that helps.

--Ken


devel / comp.protocols.kerberos / Re: 2FA with krb5

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor