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

Commit 6b65fb1

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 6fd2b7b commit 6b65fb1

File tree

5 files changed

+31
-10
lines changed

5 files changed

+31
-10
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
@@ -13,3 +13,4 @@ dependency 'blentz/selinux_types', '>=0.1.0'
1313
dependency 'puppetlabs/haproxy', '>=0.4.1'
1414
dependency 'arioch/keepalived', '>=0.0.10'
1515
dependency 'duritong/sysctl', '>=0.0.6'
16+
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
=== mcollective_user
467470
=== mcollective_password
@@ -557,9 +560,13 @@ Default: demo/changeme
557560
=== conf_broker_auth_private_key
558561
Salt and private keys used when generating secure authentication
559562
tokens for Application to Broker communication. Requests like scale up/down
560-
and jenkins builds use these authentication tokens. This value must be the
563+
and jenkins builds use these authentication tokens. These values must be the
561564
same on all broker nodes.
562565

566+
By default conf_broker_auth_salt is generated randomly once and stored in your
567+
puppet master's vardir ie:
568+
/var/lib/puppet/secretbox/$::fqdn/conf_broker_auth_salt
569+
563570
Default: Self signed keys are generated. Will not work with multi-broker
564571
setup.
565572

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
# [*mcollective_user*]
311314
# [*mcollective_password*]
@@ -385,6 +388,11 @@
385388
# tokens for Application to Broker communication. Requests like scale up/down
386389
# and jenkins builds use these authentication tokens. This value must be the
387390
# same on all broker nodes.
391+
#
392+
# By default conf_broker_auth_salt is generated randomly once and stored in your
393+
# puppet master's vardir ie:
394+
# /var/lib/puppet/secretbox/$::fqdn/conf_broker_auth_salt
395+
#
388396
# Default: Self signed keys are generated. Will not work with multi-broker
389397
# setup.
390398
#
@@ -807,7 +815,7 @@
807815
$msgserver_cluster_members = undef,
808816
$mcollective_cluster_members = undef,
809817
$msgserver_password = 'changeme',
810-
$msgserver_admin_password = inline_template('<%= require "securerandom"; SecureRandom.base64 %>'),
818+
$msgserver_admin_password = secretbox('msgserver_admin_password',16,'base64'),
811819
$mcollective_user = 'mcollective',
812820
$mcollective_password = 'marionette',
813821
$mongodb_admin_user = 'admin',
@@ -825,7 +833,7 @@
825833
$mongodb_key = 'changeme',
826834
$openshift_user1 = 'demo',
827835
$openshift_password1 = 'changeme',
828-
$conf_broker_auth_salt = inline_template('<%= require "securerandom"; SecureRandom.base64 %>'),
836+
$conf_broker_auth_salt = secretbox('conf_broker_auth_salt',16,'base64'),
829837
$conf_broker_auth_private_key = undef,
830838
$conf_broker_session_secret = undef,
831839
$conf_broker_multi_haproxy_per_node = false,

metadata.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"operatingsystemrelease": [
1212
"6"
1313
]
14-
},
14+
}
1515
],
1616
"requirements": [
1717
{
@@ -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)