Commit Graph

41 Commits

Author SHA1 Message Date
Nicolas Williams
ae8908bf81 kadmin: Add disallow-client attribute
This is useful for services that need not be clients.  For example, an
untrusted service that need only accept authentication from clients,
but not initiate authentication to other services.
2021-06-22 13:01:24 -05:00
Nicolas Williams
ea83f068e9 kadm5/kadmin: Add read-only mode
Now we can have read-only kadmind instances.
2020-09-08 00:25:40 -05:00
Nicolas Williams
5447b81fb1 hdb: Move virtual principals into HDB layer
This is a large commit that adds several features:

 - Revamps and moves virtual host-based service principal functionality
   from kdc/ to lib/hdb/ so that it may be automatically visible to
   lib/kadm5/, as well as kadmin(1)/kadmind(8) and ktutil(1).

   The changes are backwards-incompatible.

 - Completes support for documenting a service principal's supported
   enctypes in its HDB entry independently of its long-term keys.  This
   will reduce HDB bloat by not requiring that service principals have
   more long-term keys than they need just to document the service's
   supported enctypes.

 - Adds support for storing krb5.conf content in principals' HDB
   entries.  This may eventually be used for causing Heimdal KDC
   services to reconfigure primary/secondary roles automatically by
   discovering the configured primary in an HDB entry for the realm.

   For now this will be used to help reduce the amount of configuration
   needed by clients of an upcoming HTTP binding of the kadmin service.
2020-09-08 00:25:36 -05:00
Nicolas Williams
454e729e84 Make KADM5_* flags unsigned, fix warning 2019-01-02 13:56:04 -05:00
Nicolas Williams
1976e012b8 Automatically upgrade iprop logs to add uber rec
We need the uber record all the time now, actually, except when merely
inspecting a log file.  This is important as we depend on replaying
entries written to the log in order to complete the HDB writes, and if
we don't have an uber record we can't do this step.

Also, log_init() should cleanup on error.
2016-02-26 19:10:14 -06: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
b80b21c8a8 Make kadmin ext work when lacking get-keys priv
When we added the get-keys privilege we lost the ability to setup
keytabs with the kadmin ext command.  The fix is to note that we got
bogus key data and randkey (as we used to).
2014-03-25 21:45:10 -05:00
Nicolas Williams
c2ec368c36 Add HDB extension for storing policy regarding what historic keys may be used for 2011-07-22 16:06:00 -05:00
Nicolas Williams
c338446ede More kadm5 policy stub stuff. 2011-07-22 16:04:53 -05:00
Nicolas Williams
45294a93a7 Added a disting get-keys authorization for kadmind. 2011-07-22 16:04:52 -05:00
Nicolas Williams
3d0019d3ce Added kadm5_setkey_principal*() and kadm5_decrypt_key(). 2011-07-22 16:04:52 -05:00
Nicolas Williams
6e04b05e9d Initial support for kadm5_randkey_principal_3(), needed by krb5_admin.
NOT TESTED YET.
2011-07-22 16:04:52 -05:00
Love Hornquist Astrand
4d0d3b9535 remove other _krb5_key_data 2011-03-12 13:53:24 -08:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
aa1680d459 add support to get aliases
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20237 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-02-16 23:54:34 +00:00
Love Hörnquist Åstrand
0e5d5e7f5e Add KRB5_KDB_ALLOW_DIGEST
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17926 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-08-24 10:49:46 +00:00
Love Hörnquist Åstrand
ec2ed900cb Add KRB5_KDB_ALLOW_KERBEROS4
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17649 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-06-14 18:31:18 +00:00
Love Hörnquist Åstrand
58cd867836 Add KRB5_KDB_TRUSTED_FOR_DELEGATION
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17630 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-06-06 21:29:26 +00:00
Love Hörnquist Åstrand
5118c90498 Rename u_intXX_t to uintXX_t
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17450 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-05 11:11:43 +00:00
Love Hörnquist Åstrand
6d0ecf1803 Add KRB5_TL_PKINIT_ACL.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16043 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-09-08 11:28:45 +00:00
Love Hörnquist Åstrand
a2dc9e2463 Add more TL types (password and extension).
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15881 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-11 13:20:28 +00:00
Love Hörnquist Åstrand
58460893e1 add KRB5_KDB_OK_AS_DELEGATE, sync KRB5_TL_ flags
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15309 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-30 20:32:58 +00:00
Johan Danielsson
9634df0bc1 change void** to void*
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8900 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-08-04 11:26:21 +00:00
Johan Danielsson
06a31979a5 remove prototypes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8653 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-07-11 15:58:30 +00:00
Assar Westerlund
44c00d67c1 (kadm5_chpass_principal_with_key): add
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8058 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-03-23 22:58:26 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Assar Westerlund
8e4c49e843 (kadm5_s_modify_principal_with_key): remove
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7437 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-11-25 22:33:21 +00:00
Johan Danielsson
644c2e2c24 (kadm5_config_params): remove fields we're not using
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7339 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-11-09 18:08:43 +00:00
Assar Westerlund
df26baa39c (kadm5_setup_passwd_quality_check,kadm5_check_password_quality): add
prototypes


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6911 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-09-10 10:18:54 +00:00
Johan Danielsson
3258e4eaa9 add prototypes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6078 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-05-03 16:41:00 +00:00
Johan Danielsson
d352efc8af update prototypes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4903 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-05-23 02:53:39 +00:00
Johan Danielsson
39694cee02 protos
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4694 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-04-03 01:55:14 +00:00
Assar Westerlund
9334469789 add new prototypes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4285 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-01-06 03:26:31 +00:00
Assar Westerlund
870f9aeca1 update
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3904 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-11 01:35:30 +00:00
Johan Danielsson
9757ef6725 prototypes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3855 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-09 04:01:46 +00:00
Johan Danielsson
8616f5f70c x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3841 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-09 02:40:56 +00:00
Johan Danielsson
3e5cb18d86 Rename KADM5_ACL_* -> KADM5_PRIV_* to conform with specification.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3839 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-09 01:31:14 +00:00
Johan Danielsson
a89e7a64dd add KADM5_ACL_ALL
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3830 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-09 01:14:55 +00:00
Johan Danielsson
5928e0390f Add acl values.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3782 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-05 23:26:20 +00:00
Johan Danielsson
68d77a285f Beginning of a kadm5-library
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3662 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-10-25 06:19:27 +00:00