32 Commits

Author SHA1 Message Date
Nicolas Williams
9cbafd7320 kadmin: Add missing options to kadmin(1) page (fix ) 2023-05-26 23:52:24 -05:00
Nicolas Williams
1dbfd4e835 kadmin: Use kadm5_iter_principals() to list princs
Now that we have a properly working API for listing principals in an
online way, and a server-side implementation of it, use it.

This should work with old and new servers, but it will only be online
and fast when talking to new servers.

(Old servers have a bug though that prevents LIST from working.)
2022-03-20 18:32:14 -05:00
Nicolas Williams
ba98690a0a kadmin: Add add_alias, del_alias 2021-10-11 13:58:15 -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
dd762e53d1 kadmin: Improve ext_keytab usage 2019-12-06 18:32:15 -06:00
Nicolas Williams
d8394c65b7 Add new kadmin/ktutil --keep* and --enctypes opts
- Add --keepold/keepallold/pruneall options to various kadmin/ktutil
   commands.  Default behavior to "prune old keys".

 - When setting keys for a service, we need to specify enctypes for it:

    - Always use kadm5_randkey_principal_3() instead of the older
      kadm5_randkey_principal().

    - Add krb5_string_to_keysalts2(), like MIT's krb5_string_to_keysalts(),
      but with a context, and simpler.

    - Add --enctypes options to various kadmin/ktutil commands.

    - Add [libdefaults] supported_enctypes param with enctype[:salttype]
      list.

    - Add [realms] realm supported_enctypes param with enctype[:salttype]
      list.

      Default to aes128-cts-hmac-sha1-96:normal.
2019-01-02 17:29:08 -06:00
Radoslav Bodo
f3f06fcba9 kadmin selective prune of historic key for principal 2018-12-31 14:17:10 -06:00
CUI Hao (Lab)
0f7fc0fba6 Correct "princial" typos. 2018-10-08 08:46:37 -04:00
Jeffrey Altman
15e69fbb58 kadmin: add ext_keytab --random-key switch
Add a --random-key switch to kadmin's ext_keytab to force the generation
of a new keyset consisting of random keys and a new key version number.
2015-03-16 11:36:41 -05:00
Nicolas Williams
57f1545a46 Add support for writing to KDB and dumping HDB to MIT KDB dump format
Before this change Heimdal could read KDBs.  Now it can write to
    them too.

    Heimdal can now also dump HDBs (including KDBs) in MIT format, which
    can then be imported with kdb5_util load.

    This is intended to help in migrations from MIT to Heimdal by
    allowing migrations from Heimdal to MIT so that it is possible
    to rollback from Heimdal to MIT should there be any issues.  The
    idea is to allow a) running Heimdal kdc/kadmind with a KDB, or
    b) running Heimdal with an HDB converted from a KDB and then
    rollback by dumping the HDB and loading a KDB.

    Note that not all TL data types are supported, only two: last
    password change and modify-by.  This is the minimum necessary.
    PKINIT users may need to add support for KRB5_TL_USER_CERTIFICATE,
    and for databases with K/M history we may need to add KRB5_TL_MKVNO
    support.

    Support for additional TL data types can be added in
    lib/hdb/hdb-mitdb.c:_hdb_mdb_value2entry() and
    lib/hdb/print.c:entry2mit_string_int().
2012-05-03 14:24:18 -05:00
Nicolas Williams
dfc7ec92fa Make kadm5_lock() and unlock work, and add kadmin commands for them.
The libkadm5 functions hdb_open() and close around all HDB ops.  This
meant the previous implementation of kadm5_lock() and unlock would
always result in a core dump.  Now we hdb_open() for write in
kadm5_lock() and hdb_close() in kadm5_unlock(), with all kadm5_s_*()
functions now not opening nor closing the HDB when the server context
keep_open flag is set.

Also, there's now kadmin(8) lock and unlock commands.  These are there
primarily as a way to test the kadm5_lock()/unlock() operations, but
MIT's kadmin.local also has lock/unlock commands, and these can be
useful for scripting (though they require much care).
2011-07-22 21:07:48 -05:00
Nicolas Williams
e16360e2db Add --keepold option to cpw. 2011-07-22 16:07:05 -05:00
Nicolas Williams
fac34871be More kadmin support for kvno diff policy. 2011-07-22 16:06:01 -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
1f349a6aba kadmin support for policies. 2011-07-22 16:05:21 -05:00
Love Hornquist Astrand
368536bc08 add password/bare options 2009-11-21 23:53:26 -08: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
1dd5277f45 Allow setting multiple allowed-to-delegate-to.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21969 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-10-18 18:51:11 +00:00
Love Hörnquist Åstrand
8455251ee1 modify --pkinit-acl
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20648 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-05-10 19:04:28 +00:00
Love Hörnquist Åstrand
17562715a4 Add new command, add_enctype.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20288 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-02-22 03:14:18 +00:00
Love Hörnquist Åstrand
ea6db777a0 add setting and displaying aliases
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20239 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-02-17 00:00:41 +00:00
Love Hörnquist Åstrand
347c8ddc11 (do_mod_entry): Add setting 1 delegation entry
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17635 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-06-07 06:04:40 +00:00
Love Hörnquist Åstrand
ff57ab98ef Add check command
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17569 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-13 18:44:02 +00:00
Love Hörnquist Åstrand
591052ef87 Add ank as an alias to add, it lost in transition to slc, from Måns Nilsson.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16323 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-12-01 09:26:02 +00:00
Love Hörnquist Åstrand
be4a48e5aa Rename password-quality to verify-password-quality.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15908 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-11 20:41:30 +00:00
Love Hörnquist Åstrand
e2e455d771 revert previous, wrong file
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15551 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-05 20:07:18 +00:00
Love Hörnquist Åstrand
ba7ef53fd1 document kadmin command password-quality instead of the not installed
test_pw_quality


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15550 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-05 20:00:41 +00:00
Johan Danielsson
27959f1c5b add min_args and max_args
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14024 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-07-05 11:30:30 +00:00
Johan Danielsson
769bbfede1 note which functions only work in local mode
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14009 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-06-27 17:34:10 +00:00
Johan Danielsson
fd5ddd5f3c make get -l the default again, and add column selection flag; sync
list with get


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14001 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-06-27 15:09:11 +00:00
Johan Danielsson
0bf52ddf2c mod needs default kvno of -1
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13986 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-06-24 11:43:56 +00:00
Johan Danielsson
d7f9fac88e convert to use slc; also add stash subcommand
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13970 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-06-21 19:19:45 +00:00