Commit Graph

55 Commits

Author SHA1 Message Date
Luke Howard
49f3f5bd99 kdc: support for GSS-API pre-authentication
Add support for GSS-API pre-authentication to the KDC, using a simplified
variation of draft-perez-krb-wg-gss-preauth-02 that encodes GSS-API context
tokens directly in PADATA, and uses FX-COOKIE for state management.

More information on the protocol and implementation may be found in
lib/gssapi/preauth/README.md.
2021-08-12 17:37:01 +10:00
Nicolas Williams
00358252d3 kdc: Add synthetic PKINIT principals option 2021-06-29 14:52:07 -05:00
Nicolas Williams
0e09fa7fde iprop: Support hierarchical iprop 2020-09-18 14:31:43 -05:00
Viktor Dukhovni
b1e699103f Fix transit path validation CVE-2017-6594
Commit f469fc6 (2010-10-02) inadvertently caused the previous hop realm
to not be added to the transit path of issued tickets.  This may, in
some cases, enable bypass of capath policy in Heimdal versions 1.5
through 7.2.

Note, this may break sites that rely on the bug.  With the bug some
incomplete [capaths] worked, that should not have.  These may now break
authentication in some cross-realm configurations.
2017-04-13 18:06:39 -05:00
Nicolas Williams
22790e4508 Test RODC interop fix 2016-11-14 21:29:47 -06:00
Viktor Dukhovni
4b4036c9a6 Implement hierarchical referrals 2016-08-08 16:29:29 -05:00
Viktor Dukhovni
1501740952 Fix transit path validation
Also implement KDC hierarchical transit policy checks.  The "hier_capaths"
parameter defaults to "yes" in [libdefaults] or can be set explicitly in
[realms] per-realm.
2016-08-08 16:29:18 -05:00
Nicolas Williams
20df2c8706 Two-phase HDB commit via iprop log, + GC for log
We used to update the iprop log and HDB in different orders depending on
the kadm5 operation, which then led to various race conditions.

The iprop log now functions as a two-phase commit (with roll forward)
log for HDB changes.  The log is auto-truncated, keeping the latest
entries that fit in a configurable maximum number of bytes (defaults to
50MB).  See the log-max-size parameter description in krb5.conf(5).

The iprop log format and the protocol remain backwards-compatible with
earlier versions of Heimdal.  This is NOT a flag-day; there is NO need
to update all the slaves at once with the master, though it is advisable
in general.  Rolling upgrades and downgrades should work.

The sequence of updates is now (with HDB and log open and locked):

a) check that the HDB operation will succeed if attempted,
b) append to iprop log and fsync() it,
c) write to HDB (which should fsync()),
d) mark last log record committed (no fsync in this case).

Every kadm5 write operation recover transactions not yet confirmed as
committed, thus there can be at most one unconfirmed commit on a master
KDC.

Reads via kadm5_get_principal() also attempt to lock the log, and if
successful, recover unconfirmed transactions; readers must have write
access and must win any race to lock the iprop log.

The ipropd-master daemon also attempts to recover unconfirmed
transactions when idle.

The log now starts with a nop record whose payload records the offset of
the logical end of the log: the end of the last confirmed committed
transaction.  This is kown as the "uber record".  Its purpose is
two-fold: act as the confirmation of committed transactions, and provide
an O(1) method of finding the end of the log (i.e., without having to
traverse the entire log front to back).

Two-phase commit makes all kadm5 writes single-operation atomic
transactions (though some kadm5 operations, such as renames of
principals, and changes to principals' aliases, use multiple low-level
HDB write operations, but still all in one transaction).  One can still
hold a lock on the HDB across many operations (e.g., by using the lock
command in a kadmin -l or calling kadm5_lock()) in order to push
multiple transactions in sequence, but this sequence will not be atomic
if the process or host crashes in the middle.

As before, HDB writes which do not go through the kadm5 API are excluded
from all of this, but there should be no such writes.

Lastly, the iprop-log(1) command is enhanced as follows:

 - The dump, last-version, truncate, and replay sub-commands now have an
   option to not lock the log.  This is useful for inspecting a running
   system's log file, especially on slave KDCs.

 - The dump, last-version, truncate, and replay sub-commands now take an
   optional iprop log file positional argument, so that they may be used
   to inspect log files other than the running system's
   configured/default log file.

Extensive code review and some re-writing for clarity by Viktor Dukhovni.
2016-02-26 00:55:33 -06:00
Nicolas Williams
a94dc50114 Add --with-db-type-preference config param 2016-02-26 00:55:32 -06:00
Viktor Dukhovni
c3ddece8d4 Name canon kdc config breaks iprop 2015-03-04 17:04:20 -05:00
Love Hörnquist Åstrand
a220ed39eb try using as-is name_canon_rules 2014-09-09 18:36:57 +02:00
Love Hornquist Astrand
10f3c8b56e add possible to set rules on what enctypes to use based on glob matching on principal 2013-10-18 10:01:55 +02:00
Love Hornquist Astrand
edae63418e client logging too 2013-02-10 23:20:56 -08:00
Love Hornquist Astrand
da42d01d54 x 2013-02-10 21:12:34 -08:00
Love Hornquist Astrand
1adb5de80d fix logging to be sync 2013-02-10 21:11:53 -08:00
Love Hornquist Astrand
0c2e3d94bf default to open/write/close logging 2012-12-27 13:07:13 +01:00
Love Hornquist Astrand
ee068eaf21 note about = 2012-12-27 12:03:17 +01:00
Love Hornquist Astrand
703ae0e22d add db-dir 2012-10-01 09:50:32 -07:00
Nicolas Williams
839ab87c10 Regression test iprop of key rollover and del_enctype 2012-03-15 18:57:35 -05:00
Love Hörnquist Åstrand
a8c51aa594 add basic sqlite tests (from Nico) 2012-02-29 08:32:57 -08:00
Nicolas Williams
47f60928bc Some more [capaths] testing 2012-02-07 14:02:24 -06:00
Love Hornquist Astrand
791c70eaa2 reopen logfile every request 2011-11-22 11:41:40 -08:00
Love Hornquist Astrand
8b351e5eb2 keep file open when we care about performance (which we do now) 2011-11-22 11:10:41 -08:00
Love Hornquist Astrand
93d3d14827 test HTTP transport 2010-06-02 08:30:29 -07:00
Love Hornquist Astrand
72908828b1 remove $Id$ 2009-09-21 10:36:37 -07:00
Love Hörnquist Åstrand
452483e61c Have two realms in the configuration file so that kpasswdd works with both of them.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25327 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-07-15 22:17:47 +00:00
Love Hörnquist Åstrand
5106f5f173 test weak enctypes too
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24610 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-04 22:09:31 +00:00
Love Hörnquist Åstrand
e741dd4499 allow anonymous
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24596 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-04 22:07:12 +00:00
Love Hörnquist Åstrand
dacdd32ed3 reconnect values for testing
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23939 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-18 23:56:46 +00:00
Love Hörnquist Åstrand
699295cc36 add some more tests
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23847 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-20 11:16:38 +00:00
Love Hörnquist Åstrand
6c8e5cc751 [capaths]
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23844 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-20 11:16:21 +00:00
Love Hörnquist Åstrand
f4d11aa642 flag to allow switching weak crytpo
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23602 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-17 14:11:56 +00:00
Love Hörnquist Åstrand
ac6a35b3c1 use full hostname to avoid realm resolving errors
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23244 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-01 22:28:32 +00:00
Love Hörnquist Åstrand
df12083a20 use rkpty to test kpasswd/kpasswdd
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23082 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-27 08:54:21 +00:00
Love Hörnquist Åstrand
03092c3e9a Fix [domain_realm] section.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22720 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-24 12:06:12 +00:00
Love Hörnquist Åstrand
06adda012e Add stuff for iprop.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21754 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-31 21:13:56 +00:00
Love Hörnquist Åstrand
448945ec09 Add bits needed for kadmind server test.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21469 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-10 16:06:38 +00:00
Love Hörnquist Åstrand
9df9f6a9da revert 21003
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21004 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-08 01:53:10 +00:00
Love Hörnquist Åstrand
12df8538af use "roken.h" consitantly
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21003 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-08 01:42:05 +00:00
Love Hörnquist Åstrand
ea808c9c0e use diffrent port, 49188, and hope that it isnt used, help on solaris where the help services runs on port 8888
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20202 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-02-08 00:59:47 +00:00
Love Hörnquist Åstrand
827d8577d0 allow ms-chap-v2
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20146 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-02-02 22:49:53 +00:00
Love Hörnquist Åstrand
92f7fdca52 Add digests acls (all)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19501 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-26 12:51:26 +00:00
Love Hörnquist Åstrand
dcb8f42f41 pkinit_allow_proxy_certificate=true
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19102 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-24 05:12:03 +00:00
Love Hörnquist Åstrand
8466eac79d revert the enable-pkinit change, and make it consistant with all other
other enable- options


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19075 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-19 04:16:49 +00:00
Love Hörnquist Åstrand
87ade2d6ad revert previous
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19073 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-19 04:14:03 +00:00
Love Hörnquist Åstrand
30e35fb625 rename enable-digest to digest_enable
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19072 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-19 04:12:43 +00:00
Love Hörnquist Åstrand
e57d3c0cae fix spelling
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19071 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-17 22:33:21 +00:00
Love Hörnquist Åstrand
5b7701514e Make all pkinit options prefixed with pkinit_
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19069 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-17 22:27:01 +00:00
Love Hörnquist Åstrand
17fd0d123f use TEST2.H5L.SE
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19017 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-13 05:41:55 +00:00
Love Hörnquist Åstrand
6a065ff0a7 use TEST.H5L.SE
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19016 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-13 05:41:54 +00:00