duritong / trocla

A password store for password creation and retrieval
Other
76 stars 17 forks source link

Configurable generators #33

Closed duritong closed 9 years ago

duritong commented 9 years ago

As mentioned in #14 by @XANi we could define some templates within a config:

profiles:
    shellsafe:
        keygen: random
        options:
            allowed_chars: "a-zA-Z0-9"
            length: 16
    db_pass:
        keygen: random
        options:
            length: 32
    shadow_pass:
        keygen: random
        options:
            length: 16
            hash: sha1-salt
    base64_pass:
        keygen: random
        options:
            hash: sha256
            encoder: base64
    tmpfile:
        keygen: random
        options:
            length: 10
            allowed_chars: [ ":letters" ,  ":numbers" ]
            prefix: /tmp
    selfsigned:
        keygen: x509
        options:
            selfsigned: true
            subject: "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=#{keyname}.#{fqdn}"
    internal-ca:
        keygen: x509
        options:
            root-ca: /some/where/root.ca
            root-ca-key: /some/where/root.key
            root-ca-passfile: /some/where/root.pass
asquelt commented 9 years ago

what is exact advantage over having it specified in site.pp or modules' params.pp, ie.

$trocla_shellsafe = { 
  keygen  => random, 
  options => { 
    allowed_chars => "a-zA-Z0-9", 
    length => 16 
  }
}

and then using it:

$mypasswd = trocla('foo', 'plain', $trocla_shellsafe)

?

by putting this in some yaml in $confdir we risk that it would slip from version control. while keeping it with puppet code will guarantee it's in vcs, with a little sacrifice in readability, but it depends how clean you write your modules.

asquelt commented 9 years ago

ok, i've missed use case, when you use trocla standalone. then it might be useful for a sake of readability (default params could be pass as shell variables but it would be hard to follow, i guess). through i think that a remark about CM capabilities is valid and should be included in docu.

duritong commented 9 years ago

Should be implemented with 3b03947