Skip to content

Commit caa356a

Browse files
Add show_diff parameter to prevent credentials leaks.
1 parent 437a532 commit caa356a

10 files changed

Lines changed: 30 additions & 17 deletions

File tree

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
Boolean $automatic_dlo_cleanup = $puppetdb::params::automatic_dlo_cleanup,
7777
String[1] $cleanup_timer_interval = $puppetdb::params::cleanup_timer_interval,
7878
Integer[1] $dlo_max_age = $puppetdb::params::dlo_max_age,
79+
Boolean $show_password = $puppetdb::params::show_password,
7980
) inherits puppetdb::params {
8081

8182
class { '::puppetdb::server':
@@ -150,6 +151,7 @@
150151
automatic_dlo_cleanup => $automatic_dlo_cleanup,
151152
cleanup_timer_interval => $cleanup_timer_interval,
152153
dlo_max_age => $dlo_max_age,
154+
show_password => $show_password,
153155
}
154156

155157
if ($database == 'postgres') {

manifests/master/storeconfigs.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
}
1313

1414
Ini_setting {
15+
ensure => present,
1516
section => $puppet_conf_section,
1617
path => $puppet_conf,
17-
ensure => present,
1818
}
1919

2020
ini_setting { "puppet.conf/${puppet_conf_section}/storeconfigs":

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
$cipher_suites = undef
1414
$open_ssl_listen_port = undef
1515
$postgres_listen_addresses = 'localhost'
16+
$show_password = false
1617

1718
$puppetdb_version = $puppetdb::globals::version
1819
$database = $puppetdb::globals::database

manifests/server.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
Boolean $automatic_dlo_cleanup = $puppetdb::params::automatic_dlo_cleanup,
7272
String[1] $cleanup_timer_interval = $puppetdb::params::cleanup_timer_interval,
7373
Integer[1] $dlo_max_age = $puppetdb::params::dlo_max_age,
74+
Boolean $show_password = $puppetdb::params::show_password,
7475
) inherits puppetdb::params {
7576

7677
# Apply necessary suffix if zero is specified.
@@ -176,6 +177,7 @@
176177
confdir => $confdir,
177178
puppetdb_user => $puppetdb_user,
178179
puppetdb_group => $puppetdb_group,
180+
show_password => $show_password,
179181
notify => Service[$puppetdb_service],
180182
}
181183

@@ -197,6 +199,7 @@
197199
puppetdb_group => $puppetdb_group,
198200
notify => Service[$puppetdb_service],
199201
database_max_pool_size => $read_database_max_pool_size,
202+
show_password => $show_password,
200203
}
201204

202205
if $ssl_deploy_certs {
@@ -248,6 +251,7 @@
248251
notify => Service[$puppetdb_service],
249252
puppetdb_user => $puppetdb_user,
250253
puppetdb_group => $puppetdb_group,
254+
show_password => $show_password,
251255
}
252256

253257
class { 'puppetdb::server::puppetdb':

manifests/server/command_processing.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
# Set the defaults
1313
Ini_setting {
14-
path => $config_ini,
1514
ensure => 'present',
15+
path => $config_ini,
1616
section => 'command-processing',
1717
require => File[$config_ini],
1818
}

manifests/server/database.pp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
$puppetdb_user = $puppetdb::params::puppetdb_user,
2222
$puppetdb_group = $puppetdb::params::puppetdb_group,
2323
$database_max_pool_size = $puppetdb::params::database_max_pool_size,
24+
$show_password = $puppetdb::params::show_password,
2425
) inherits puppetdb::params {
2526

2627
if str2bool($database_validate) {
@@ -58,8 +59,8 @@
5859
}
5960
# Set the defaults
6061
Ini_setting {
61-
path => $database_ini,
6262
ensure => present,
63+
path => $database_ini,
6364
section => 'database',
6465
require => $ini_setting_require
6566
}
@@ -91,8 +92,9 @@
9192

9293
if $database_password != undef {
9394
ini_setting {'puppetdb_psdatabase_password':
94-
setting => 'password',
95-
value => $database_password,
95+
setting => 'password',
96+
value => $database_password,
97+
show_password => $show_password,
9698
}
9799
}
98100
}

manifests/server/global.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
# Set the defaults
1919
Ini_setting {
20-
path => $config_ini,
21-
ensure => 'present',
22-
section => 'global',
23-
require => File[$config_ini],
20+
ensure => 'present',
21+
path => $config_ini,
22+
section => 'global',
23+
require => File[$config_ini],
2424
}
2525

2626
if $vardir {

manifests/server/jetty.pp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
$max_threads = $puppetdb::params::max_threads,
1717
$puppetdb_user = $puppetdb::params::puppetdb_user,
1818
$puppetdb_group = $puppetdb::params::puppetdb_group,
19+
$show_password = $puppetdb::params::show_password,
1920
) inherits puppetdb::params {
2021

2122
$jetty_ini = "${confdir}/jetty.ini"
@@ -29,8 +30,8 @@
2930

3031
# Set the defaults
3132
Ini_setting {
32-
path => $jetty_ini,
3333
ensure => present,
34+
path => $jetty_ini,
3435
section => 'jetty',
3536
require => File[$jetty_ini],
3637
}
@@ -90,9 +91,10 @@
9091
if $ssl_set_cert_paths {
9192
# assume paths have been validated in calling class
9293
ini_setting { 'puppetdb_ssl_key':
93-
ensure => present,
94-
setting => 'ssl-key',
95-
value => $ssl_key_path,
94+
ensure => present,
95+
setting => 'ssl-key',
96+
value => $ssl_key_path,
97+
show_password => $show_password,
9698
}
9799
ini_setting { 'puppetdb_ssl_cert':
98100
ensure => present,

manifests/server/puppetdb.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
# Set the defaults
2121
Ini_setting {
22-
path => $puppetdb_ini,
2322
ensure => present,
23+
path => $puppetdb_ini,
2424
section => 'puppetdb',
2525
require => File[$puppetdb_ini],
2626
}

manifests/server/read_database.pp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
$puppetdb_user = $puppetdb::params::puppetdb_user,
1717
$puppetdb_group = $puppetdb::params::puppetdb_group,
1818
$database_max_pool_size = $puppetdb::params::read_database_max_pool_size,
19+
$show_password = $puppetdb::params::show_password,
1920
) inherits puppetdb::params {
2021

2122
# Only add the read database configuration if database host is defined.
@@ -55,8 +56,8 @@
5556
}
5657
# Set the defaults
5758
Ini_setting {
58-
path => $read_database_ini,
5959
ensure => present,
60+
path => $read_database_ini,
6061
section => 'read-database',
6162
require => $ini_setting_require,
6263
}
@@ -81,8 +82,9 @@
8182

8283
if $database_password != undef {
8384
ini_setting { 'puppetdb_read_database_password':
84-
setting => 'password',
85-
value => $database_password,
85+
setting => 'password',
86+
value => $database_password,
87+
show_password => $show_password,
8688
}
8789
}
8890
}

0 commit comments

Comments
 (0)