I took a different and more hacky approach.
I wrote a function that fetches the complete shadow line from the
shadow file then pushes that line to the clients.
So I get central password management (including aging rules), but each
puppet client can stand on it's own (in case nis, or ldap, or radius,
ect.. goes away). I enforce the password rules on my puppetmaster
(that only sysadmins can login to). When a password expires, you
change it on the puppetmaster, and it is pushed to all the clients.
If anyone is interested in my configs, let me know and I can clean
them up a bit and post them somewhere.
-Adam
> I took a different and more hacky approach.
> I wrote a function that fetches the complete shadow line from the
> shadow file then pushes that line to the clients.
>
> If anyone is interested in my configs, let me know and I can clean
> them up a bit and post them somewhere.
I have the same problem, and was thinking about implementing the same
style solution. I'd love to see your scripts.
seph
jcbollinger wrote:
> Puppet's resource model involves having a common front end for each
> resource type that defines the available parameters, properties, and
> features, plus one or more "providers" for that type that interact
> with specific host environments to evaluate and update resource
> instances on those environments. user_role_add.rb is one of the
> providers for the User type. It is the default for Solaris, so if
> you're running on Solaris then that's probably what you're using, and
> if not then not.
Okay - my memory of why sucks but Solaris uses the standard useradd
provider and some methods are overridden in the provider that adds roles
support - including the libshadow password management.
> I agree that the password management in that provider is rather
> strange. It is usual for the User providers to rely on the host OS's
> utilities to do work (e.g. user_role_add uses useradd, usermod, etc.),
> so it is odd that password management is an exception. Moreover, it
> is surpassingly strange that having rejected OS utilities for this
> job, the provider does not rely on the Ruby shadow password library.
> The code even contains comments complaining about manipulating the
> shadow file directly!
Possibly there may be a reason - see
http://projects.reductivelabs.com/issues/1680. Andrew may be able to
shed light on how/why libshadow didn't do whatever magic was needed.
Andrew?
Regards
James Turnbull
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJKnDiNAAoJECFa/lDkFHAy7egIALguEHqQwlJhAJKkUay2+iDy
jqjObwWD49lqStWPlKISqVgmDhpZ63U6lLPTiQ85DT2MZ+RIRlFI6ykrN++dplCx
EoEV0EV+58FqRWZlVVU1ZZrUnVzSBirFFBQUdbiJXOOmP1zwkXExex4lkuIISD2k
MtPtVuQ+dILsIKfLfMG9jnz9L0Yqehh3MrnICW3g0pQXtmN8u5RRf7h2SZHC/VcZ
H0Osue520T7a7KZ73Z6xg/RaFBbxpWfaApGaG0g5gxv267lsQmCFzb5Gs9ubE358
nCzEjbwIbNe6XLG3l6Lu7rKtZAgtfXTM36AhmyydUeQoNukiqwuXKAKgcbR6isg=
=9kL3
-----END PGP SIGNATURE-----
It doesn't manage this because the type doesn't have any support for
an "expire" attribute.
> This seems a bug in the User type, in that if the password changes
> from the previous password, it should also reset the last-changed
> field as well. Ideally, if the User type is supporting passwords, it
> would be nice if there were properties to also specify the other
> shadow parameters, such as min, max, warn, expire, etc.
Not a bug as such - the lack of a feature to do this. There is a
ticket for the feature at:
http://projects.reductivelabs.com/issues/2224
I had a play with it a while ago but got distracted and did other things.
> I looked into the puppet provider code for User, but I couldn't make
> sense of how to fix. Could someone point me to the right place so I
> can try and change this behavior (or maybe someone from Reductive Labs
> can fix it in an immediately upcoming update)?
You need to add support in the type (see
http://github.com/reductivelabs/puppet/blob/b728b931e5914cfeaf3d072fb77870e9a8ecf6cd/lib/puppet/type/user.rb)
for an "expire" attribute and possibly add a feature (see the user.rb
type code) for password expiration support that can enabled in user
providers that support this functionality.
You then need to enable appropriate support in each provider, if that
platform allows password expiration support.
Regards
James Turnbull
--
Author of:
* Pro Linux Systems Administration (http://tinyurl.com/linuxadmin)
* Pulling Strings with Puppet (http://tinyurl.com/pupbook)
* Pro Nagios 2.0 (http://tinyurl.com/pronagios)
* Hardening Linux (http://tinyurl.com/hardeninglinux)