Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Commit 3fb5fac

Browse files
committed
Use secretbox to store randomly generated passwords
Secretbox is a function that generates a random password on first call and then retrieves those values for subsequent calls. This works in both master and masterless environments. See: https://forge.puppetlabs.com/sdodson/secretbox
1 parent f1b1e48 commit 3fb5fac

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed

.fixtures.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ fixtures:
22
repositories:
33
lokkit: "git://github.com/rharrison10/puppet-lokkit.git"
44
ntp: "git://github.com/puppetlabs/puppetlabs-ntp.git"
5+
secretbox: "git://github.com/sdodson/puppet-secretbox.git"
56
selinux_types: "git://github.com/blentz/puppet-selinux_types.git"
67
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
78
sysctl: "git://github.com/duritong/puppet-sysctl.git"

Modulefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ dependency 'blentz/selinux_types', '>=0.1.0'
1414
dependency 'puppetlabs/haproxy', '>=0.4.1'
1515
dependency 'arioch/keepalived', '>=0.0.10'
1616
dependency 'duritong/sysctl', '>=0.0.6'
17+
dependency 'sdodson/secretbox', '>=0.1.3'

README.asciidoc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,13 @@ is true.
458458
Default "changeme"
459459

460460
=== msgserver_admin_password
461-
This is the admin password for the ActiveMQ admin console, which is
462-
not needed by OpenShift but might be useful in troubleshooting.
461+
This is the admin password for the ActiveMQ admin console, which is not needed
462+
by OpenShift but might be useful in troubleshooting. Because this value need
463+
not be uniform across hosts it is generated randomly by default and stored in
464+
your puppet master's vardir ie:
465+
/var/lib/puppet/secretbox/$::fqdn/msgserver_admin_password
463466

464-
Default: scrambled
467+
Default: 16 character random string
465468

466469
=== msgserver_tls_enabled
467470
This configures mcollective and activemq to use end-to-end encryption over TLS.
@@ -584,9 +587,13 @@ Default: demo/changeme
584587
=== conf_broker_auth_private_key
585588
Salt and private keys used when generating secure authentication
586589
tokens for Application to Broker communication. Requests like scale up/down
587-
and jenkins builds use these authentication tokens. This value must be the
590+
and jenkins builds use these authentication tokens. These values must be the
588591
same on all broker nodes.
589592

593+
By default conf_broker_auth_salt is generated randomly once and stored in your
594+
puppet master's vardir ie:
595+
/var/lib/puppet/secretbox/$::fqdn/conf_broker_auth_salt
596+
590597
Default: Self signed keys are generated. Will not work with multi-broker
591598
setup.
592599

manifests/init.pp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,12 @@
303303
# is true.
304304
#
305305
# [*msgserver_admin_password*]
306-
# Default: scrambled
307-
# This is the admin password for the ActiveMQ admin console, which is
308-
# not needed by OpenShift but might be useful in troubleshooting.
306+
# Default: 16 character random string
307+
# This is the admin password for the ActiveMQ admin console, which is not needed
308+
# by OpenShift but might be useful in troubleshooting. Because this value need
309+
# not be uniform across hosts it is generated randomly by default and stored in
310+
# your puppet master's vardir ie:
311+
# /var/lib/puppet/secretbox/$::fqdn/msgserver_admin_password
309312
#
310313
# [*msgserver_tls_enabled*]
311314
# Default: 'disabled'
@@ -406,6 +409,11 @@
406409
# tokens for Application to Broker communication. Requests like scale up/down
407410
# and jenkins builds use these authentication tokens. This value must be the
408411
# same on all broker nodes.
412+
#
413+
# By default conf_broker_auth_salt is generated randomly once and stored in your
414+
# puppet master's vardir ie:
415+
# /var/lib/puppet/secretbox/$::fqdn/conf_broker_auth_salt
416+
#
409417
# Default: Self signed keys are generated. Will not work with multi-broker
410418
# setup.
411419
#
@@ -837,7 +845,7 @@
837845
$msgserver_cluster_members = undef,
838846
$mcollective_cluster_members = undef,
839847
$msgserver_password = 'changeme',
840-
$msgserver_admin_password = inline_template('<%= require "securerandom"; SecureRandom.base64 %>'),
848+
$msgserver_admin_password = secretbox('msgserver_admin_password',16,'base64'),
841849
$msgserver_tls_enabled = 'disabled',
842850
$msgserver_tls_keystore_password = 'password',
843851
$msgserver_tls_ca = '/var/lib/puppet/ssl/certs/ca.pem',
@@ -860,7 +868,7 @@
860868
$mongodb_key = 'changeme',
861869
$openshift_user1 = 'demo',
862870
$openshift_password1 = 'changeme',
863-
$conf_broker_auth_salt = inline_template('<%= require "securerandom"; SecureRandom.base64 %>'),
871+
$conf_broker_auth_salt = secretbox('conf_broker_auth_salt',16,'base64'),
864872
$conf_broker_auth_private_key = undef,
865873
$conf_broker_session_secret = undef,
866874
$conf_broker_multi_haproxy_per_node = false,

metadata.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
{
6060
"name": "duritong/sysctl",
6161
"version_requirement": ">=0.0.6"
62+
},
63+
{
64+
"name": "sdodson/secretbox",
65+
"version_requirement": ">=0.1.3"
6266
}
6367
]
6468
}

0 commit comments

Comments
 (0)