summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md170
1 files changed, 58 insertions, 112 deletions
diff --git a/README.md b/README.md
index c601f2d..8c277c1 100644
--- a/README.md
+++ b/README.md
@@ -1,152 +1,98 @@
# trocla
-[![Build Status](https://travis-ci.org/duritong/trocla.png)](https://travis-ci.org/duritong/trocla)
-Trocla provides you a simple way to create and store (random) passwords on a
-central server, which can be retrieved by other applications. An example for
-such an application is puppet and trocla can help you to not store any
-plaintext or hashed passwords in your manifests by keeping these passwords only
-on your puppetmaster.
+[![Build Status](https://travis-ci.org/duritong/puppet-trocla.png)](https://travis-ci.org/duritong/puppet-trocla)
-Furthermore it provides you a simple cli that helps you to modify the password
-storage from the cli.
+This is the puppet module to manage a trocla installation on the puppet
+master. It also, provides the necessary function to query trocla from puppet.
-Trocla does not only create and/or store a plain password, it is also able to
-generate (and store) any kind hashed passwords based on the plain password.
-As long as the plain password is preset, trocla is able to generate any kind
-of hashed passwords through an easy extendible plugin system.
+To get a quick start you might be interested in using the `trocla::yaml` class
+on your master. This will install trocla and setup it using the default YAML
+storage backend for your master. There is no need to configure anything on the
+clients if you do not want to use trocla on the clients itself.
-It is not necessary to store the plain password on the server, you can also
-just feed trocla with the hashed password and use that in your other tools.
-A common example for that is that you let puppet retrieve (and hence create)
-a salted md5 password for a user. This will then store the salted md5 of
-a random password AND the plain text password in trocla. Later you can
-retrieve (by deleting) the plain password and send it to the user. Puppet
-will still simply retrieve the hashed password that is stored in trocla,
-while the plain password is not anymore stored on the server.
+If you want to do your own very custom setup, you should look into the other
+classes.
-You can use any kind of key/value based storage supported by moneta for
-trocla. By default it uses a simple yaml file.
+## Compatibility
-## Usage
+* Version 0.2.2 of this module is for version 0.2.2 of trocla.
-### create
+## Functions
-Assuming that we have an empty trocla storage.
+### trocla
- trocla create user1 plain
-This will create (if not already stored in trocla) a random password and
-store its plain text under key user1. The password will also be returned
-by trocla.
+Usage:
- trocla create user2 mysql
+ trocla(KEY, FORMAT, [optional options])
-This will create a random password and store its plain and mysql-style hashed
-sha1 password in trocla. The hashed password is returned.
+This is the main function you will use. This is similar to a
- trocla create user1 mysql
+ trocla create foo FORMAT
-This will take the already stored plain text password of key user1 and generate
-and store the mysql-style hashed sha1 password.
+on the cli. This means, that *if* a password for this key and format
+exists, it will return this one, otherwise will create one automatically
+and return the generated password. So you might want to do something like:
-It is possible that certain hash formats require additional options. For example
-the pgsql hash requires also the user to create the md5 hash for the password.
-You can pass these additional requirements as yaml-based strings to the format:
+ user{'foobar':
+ password => trocla('user_foobar','plain')
+ }
- trocla create user1 pgsql 'username: user1'
+If you want to pass down encrypted passwords, you might use:
-This will create a pgsql password hash using the username user1.
-### get
+ user{'foobar':
+ password => trocla('user_foobar','sha512crypt')
+ }
-Get simply returns a stored password. It will not create a new password.
+As descriped further in trocla's docs.
-Assuming that we are still working with the same storage
+The optional options, can be used to pass options to the format, like
+overriding the default length for passwords that are being created:
- trocla get user2 plain
+ user{'foobar':
+ password => trocla('user_foobar','sha512crypt','length: 32')
+ }
-will return the plain text password of the key user2.
+### trocla_get
- trocla get user3 plain
+Usage:
-This will return nothing, as no password with this format have been stored so
-far.
+ trocla_get(KEY, FORMAT)
-### set
+This will return the value of the passed key and format. If nothing is
+found an error will be raised. This is interesting if you want do not
+want to autogenerate a password and rather be sure that it's already
+existing in trocla's database.
- trocla set user3 plain
+### trocla_set
-This will ask you for a password and set it under the appropriate key/format.
+Usage:
- trocla set --password mysupersecretpassword user4 plain
+ trocla_set(KEY, FORMAT,PASSWORD)
-This will take the password from the cli without asking you.
+This will set the passed password for the key/format pair and return it
+as well. This is mainly interesting if you want to migrate existing manifests
+with plenty of passwords in it to trocla.
- trocla set user5 mysql -p *ABC....
+## Other classes
-This will store a mysql sha1 hash for the key user5, without storing any kind
-of plain text password.
+### trocla::config
-You can also pipe in a password:
+This is a class that manages a trocla configuration. You might use this
+one if you do not use the default yaml setup.
- echo -n foo | trocla set user6 plain -p
+### trocla::master
-or a file
+This class manages the installation of trocla itself. It will not configure
+trocla, it will just install the necessary packages.
- cat some_file | trocla set user6 plain -p
- trocla set user6 plain -p < some_file
+## Hiera backend
-### reset
+Trocla can also be integrated into [Hiera](https://docs.puppetlabs.com/hiera/) by using ZeroPointEnergy's [hiera-backend](https://github.com/ZeroPointEnergy/hiera-backend-trocla).
- trocla reset user1 md5crypt
+Simply `include trocla::master::hiera` to make that backend available.
-This will recreate the salted md5 shadow-style hash. However, it will not create
-a new plain text passwords. Hence, this is mainly usefull to create new hashed
-passwords based on new salts.
-
-If the plain password of a key is resetted, every already hashed password is
-deleted as well, as the hashes wouldn't match anymore the plain text password.
-
-### delete
-
- trocla delete user1 plain
-
-This will delete the plain password of the key user1 and return it.
-
-## Attention
-
-If you don't feed trocla initially with a hash and/or delete the generated
-plain text passwords trocla will likely create a lot of plain text passwords
-and store them on your machine/server. This is by intend and is all about which
-problems (mainly passwords in configuration management manifests) trocla tries
-to address.
-
-## Installation
-
-Simply build and install the gem.
-
-## Update & Changes
-
-### to 0.0.8
-
-1. be sure to update as well the moneta gem, trocla now uses the official moneta releases and supports current avaiable versions.
-1. Options for moneta's backends have changed. For example, if you are using the yaml-backend you will likely need to change the adapter option `:path:` to `:file:` to match moneta's new API.
-1. **IMPORTANT:** If you are using the yaml backend you need to migrate the current data *before* using the new trocla version! You can migrate the datastore by using the following two sed commands: `sed -i 's/^\s\{3\}/ /' /PATH/TO/trocla_data.yaml` && `sed -i '/^\s\{2\}value\:/d' /PATH/TO/trocla_data.yaml`.
-1. **SECURITY:** Previous versions of trocla used quite a simple random generator. Especially in combination with the puppet `fqdn_rand` function, you likely have very predictable random passwords and I recommend you to regenerate all randomly generated passwords! Now!
-1. We now support reading passwords from files, which means that you can now also easily add multi-line passwords. Have a look at the documentation above.
-
-## Contributing to trocla
-
-* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
-* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
-* Fork the project
-* Start a feature/bugfix branch
-* Commit and push until you are happy with your contribution
-* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
-* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
-
-## Copyright
-
-Copyright (c) 2011 mh. See LICENSE.txt for
-further details.
+## Moar
+RTFC and for more information about trocla visit: https://github.com/duritong/trocla