Commit Graph

85 Commits

Author SHA1 Message Date
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
03a08825d0 kadmin: fix leak 2020-04-24 16:02:35 -05:00
Nicolas Williams
c2b106def5 Fix wrong keepold default in kadmin and ktutil 2019-01-09 00:14:11 -06:00
Jeffrey Altman
b025f20eb4 kadmin: kadmind_dispatch incompatible pointer warning
warning: incompatible pointer types passing 'int *' to parameter
  of type 'size_t *' (aka 'unsigned long *') [-Wincompatible-pointer-types]

Change-Id: Id75b1b1c9b46b63ab61134f4f91b7c2909d87077
2019-01-04 01:47:11 -05:00
Nicolas Williams
d5536d4dd3 Fix wrong context bugs in kadmin randkey 2019-01-03 22:26:31 -06:00
Jeffrey Altman
e787bd1bc1 kadmin: kadmin_dispatch free krb5_principals at function exit
Change-Id: Ic50a17abf10c7055574de2236cdf1d1469375d8b
2019-01-02 20:19:23 -06:00
Jeffrey Altman
092cd5e838 kadmin: kadmin_dispatch out of memory handling
Coverity determined that a NULL pointer segmentation fault could occur
if krb5_storage_emem() fails.  Use krb5_enomem() to set an error message
on the context and do not perform further krb5_storage operations.

Change-Id: I9587208e46c184bb061443a44581a32dd722de33
2019-01-02 20:19:23 -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
Luke Howard
c6bf100b43 kadm5: move password quality checks out of daemons and into libkadm5
Note that this has a slight behavior change to c89d3f3b in order to continue
allow kadmin in local mode to bypass password quality checks. Password quality
checks are always bypassed if the *client* kadmin principal is kadmin/admin,
i.e. that of the kadmin service itself. This is the case when running kadmin in
local mode. As this is the equivalent of a superuser account, one would
anticipate that deployments would use specific administrator instances for
appropriate ACLs for day-to-day administration; operations by these will be
subject to password quality checks if enforce_on_admin_set is TRUE, or if the
user is changing their own password.
2018-12-26 11:04:05 -06:00
Luke Howard
c89d3f3b8c kadmin: allow enforcing password quality on admin password change
This patch adds the "enforce_on_admin_set" configuration knob in the
[password_quality] section. When this is enabled, administrative password
changes via the kadmin or kpasswd protocols will be subject to password quality
checks. (An administrative password change is one where the authenticating
principal is different to the principal whose password is being changed.)

Note that kadmin running in local mode (-l) is unaffected by this patch.
2018-12-26 15:38:48 +11:00
Nicolas Williams
e5126ab924 Fix warnings 2016-11-28 17:34:44 -06:00
Nicolas Williams
f38089257b Misc fixes (coverity) 2016-11-20 17:43:51 -06:00
Jeffrey Altman
bdfc24e9c0 kadmind: kadmin_dispatch leaks memory
Change-Id: I8bc332c4c9b7a8dc1d63494a82ec7af89c0ec7ca
2016-11-19 07:43:39 -05:00
Nicolas Williams
30299a4ee7 kadmind: don't leak ks_tuple 2016-02-29 19:13:13 -06:00
Nicolas Williams
e193671854 kadmind: fix pw leak from CVE-2016-2400 fix 2016-02-29 19:13:12 -06:00
Nicolas Williams
7442787f03 Fix leak in check_aliases() 2016-02-26 21:29:05 -06:00
Nicolas Williams
8343733562 kadmind: check ACLs for aliases CVE-2016-2400
CVE-2016-2400

kadmind(8) was not checking for 'add' permission to aliases added via
kadm5_modify_principal().  This is a security vulnerability.  The impact
of this vulnerability is mostly minor because most sites that use
kadmind(8) generally grant roughly the same level of permissions to all
administrators.  However, the impact will be higher for sites that grant
modify privileges to large numbers of less-privileged users.

From what we know of existing deployments of Heimdal, it seems very
likely that the impact of this vulnerability will be minor for most
sites.
2016-02-26 01:04:32 -06:00
Jeffrey Altman
34bf7ae162 kadmind: don't send bogus keys to ext_keytab et al
The Heimdal kadmind sends bogus keys when the client has 'get'
but not 'get-keys' permission.  For some kadmin commands this is
dangerous.  For example, ext_keytab could happily write bogus
keys to a keytab when real keys are expected, causing eventual
breakage.  Sending bogus keys is important for the kadmin get
command: so it can list the keysets that a principal has.

This patch implements a heuristic detection of kadmin get vs.
ext_keytab, add_enctype, del_enctype, and check commands.  If the
client principal lacks 'get-keys' permission, then the server
will fail requests that appear to be from those kadmin commands,
but will continue to serve bogus keys to kadmin get commands.

Thanks to Nico Williams for the idea behind this implementation.
2015-03-16 11:03:58 -05:00
Jeffrey Altman
6043cc8c88 kadmind: check for KADM5_PRIV_GET when op GET
When performing a permission check for a GET operation the
KADM5_PRIV_GET_KEYS privilege should not be assumed to be a pure
superset of KADM5_PRIV_GET.  If the "get" permission is denied the
user cannot get an entry with or without key data.
2015-03-16 10:47:16 -05:00
Love Hörnquist Åstrand
63672067ea add nob for [kadmin]allow_self_change_password 2011-07-30 12:34:40 -07:00
Nicolas Williams
11c54cd6c8 Protect against negative n_ks_tuple values and against randkey returning negative n_keys 2011-07-24 11:08:58 -05:00
Nicolas Williams
0d90e0c4d0 Complete --keepold support and fix crasher in kadmin cpw -r --keepold. 2011-07-22 16:07:06 -05:00
Nicolas Williams
2510d2d8fc Oops, reverse sense of get-keys check... 2011-07-22 16:07:06 -05:00
Nicolas Williams
f15745c60c Forgot to save edits to kadmin/server.c to use the new get-keys authorization. 2011-07-22 16:07:06 -05:00
Nicolas Williams
e8e314bbb1 Beginning of another new kadm5 function. Need to switch branches for a bit. 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 Hörnquist Åstrand
277bec06e7 simplify error printing, context contains error 2011-06-14 07:11:43 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Love Hornquist Astrand
433b1d5073 drop RCSID 2010-03-16 12:52:58 -07:00
Love Hornquist Astrand
be73fa4687 use krb5_socket_t 2009-12-23 14:12:38 +01:00
Asanka Herath
a1942c1bad Use SOCKET data type instead of ints for sockets in kadmin
Also use the new mini_inetd() API
2009-11-24 10:17:51 -08:00
Love Hornquist Astrand
57faf165a0 [HEIMDAL-646] malloc(0) checks for AIX 2009-10-11 18:03:22 -07:00
Love Hornquist Astrand
8490e8fd34 make compile 2009-07-30 13:04:30 +02:00
Love Hornquist Astrand
3af78ea3fb out of memory [CID-63] 2009-07-30 12:53:50 +02:00
Love Hornquist Astrand
330fd7645d Always ask for principal (KADM5_PRINCIPAL)
The protocol for "get principal" does not support not sending
principal, so when the caller doesn't add KADM5_PRINCIPAL to the mask,
lets add it for them.

Reported by Henry.B.Hotz@jpl.nasa.gov in [HEIMDAL-588]
2009-07-19 21:01:20 -07:00
Love Hörnquist Åstrand
e147d3fba4 use kadm5_s_init_with_password_ctx
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24548 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-30 16:48:46 +00:00
Love Hörnquist Åstrand
8d16bb0b68 add support for add,get,delete,chrand for the MIT kadmin protocol
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24240 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-11 21:42:02 +00: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
9056a3263a revert previous
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17611 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-06-02 22:10:21 +00:00
Love Hörnquist Åstrand
d782cd55c5 Less shadowing.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17609 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-06-01 21:04:42 +00:00
Love Hörnquist Åstrand
59fa02a897 (kadm_get_privs): one less "pointer targets in passing argument differ
in signedness" warning.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17511 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-08 13:40:58 +00:00
Love Hörnquist Åstrand
2a6831b56c (kadmind_dispatch): case kadm_rename, free princ2 on acl check failure.
Coverity, NetBSD CID#1911


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17014 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-07 22:00:57 +00:00
Love Hörnquist Åstrand
8acefbf5a0 Update (c).
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15905 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-11 17:12:13 +00:00
Love Hörnquist Åstrand
e478a72278 Avoid shadowing exp().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15893 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-11 13:53:24 +00:00
Johan Danielsson
2450e7b7f8 nuke kerberos 4 kadmin goo
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13845 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-05-13 17:46:20 +00:00
Love Hörnquist Åstrand
84a8e5c39a (kadmind_dispatch): kadm_chpass: require the password to pass the
password quality check in case the user changes the user's own password
kadm_chpass_with_key: disallow the user to change it own password to a
key, since that password might violate the password quality check.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11626 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-01-29 12:33:05 +00:00
Johan Danielsson
fed79b33b9 add option to disable kerberos 4 kadmin
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11489 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-10-21 13:21:24 +00:00
Johan Danielsson
120c4c61a0 constify match_appl_version()
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11437 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-09-10 19:23:28 +00:00