Skip to content

Commit af10eed

Browse files
committed
Add ability to specify SSL protocols.
This is in response to CVE-2014-3566 - POODLE
1 parent ed5e57c commit af10eed

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
$open_listen_port = false
88
$ssl_listen_address = $::fqdn
99
$ssl_listen_port = '8081'
10+
$ssl_protocols = undef
1011
$disable_ssl = false
1112
$open_ssl_listen_port = undef
1213
$postgres_listen_addresses = 'localhost'

manifests/server/jetty_ini.pp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
$ssl_cert_path = $puppetdb::params::ssl_cert_path,
1010
$ssl_key_path = $puppetdb::params::ssl_key_path,
1111
$ssl_ca_cert_path = $puppetdb::params::ssl_ca_cert_path,
12+
$ssl_protocols = $puppetdb::params::ssl_protocols,
1213
$confdir = $puppetdb::params::confdir,
1314
$max_threads = $puppetdb::params::max_threads,
1415
) inherits puppetdb::params {
@@ -47,6 +48,17 @@
4748
value => $ssl_listen_port,
4849
}
4950

51+
if $ssl_protocols != undef {
52+
53+
validate_string($ssl_protocols)
54+
55+
ini_setting { 'puppetdb_sslprotocols':
56+
ensure => $ssl_setting_ensure,
57+
setting => 'ssl-protocols',
58+
value => $ssl_protocols,
59+
}
60+
}
61+
5062
if str2bool($ssl_set_cert_paths) == true {
5163
# assume paths have been validated in calling class
5264
ini_setting { 'puppetdb_ssl_key':

spec/unit/classes/server/jetty_ini_spec.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
'setting' => 'ssl-port',
4545
'value' => 8081
4646
)}
47+
it { should_not contain_ini_setting('puppetdb_sslprotocols') }
4748
end
4849

4950
describe 'when disabling ssl' do
@@ -99,5 +100,31 @@
99100
'value' => '150'
100101
)}
101102
end
103+
104+
describe 'when setting ssl_protocols' do
105+
context 'to a valid string' do
106+
let(:params) { { 'ssl_protocols' => 'TLSv1, TLSv1.1, TLSv1.2' } }
107+
108+
it {
109+
should contain_ini_setting('puppetdb_sslprotocols').with(
110+
'ensure' => 'present',
111+
'path' => '/etc/puppetdb/conf.d/jetty.ini',
112+
'section' => 'jetty',
113+
'setting' => 'ssl-protocols',
114+
'value' => 'TLSv1, TLSv1.1, TLSv1.2'
115+
)
116+
}
117+
end
118+
119+
context 'to an invalid type (non-string)' do
120+
let(:params) { { 'ssl_protocols' => ['invalid','type'] } }
121+
122+
it 'should fail' do
123+
expect {
124+
should contain_class('puppetdb::server::jetty_ini')
125+
}.to raise_error(Puppet::Error)
126+
end
127+
end
128+
end
102129
end
103130
end

0 commit comments

Comments
 (0)