Skip to content

Commit af23995

Browse files
ekohlevgeni
authored andcommitted
Fixes #38279 - Respect crypto-policies in mosquitto on EL
The default built in ciphers can be less secure. On Red Hat there is the special cipher that's PROFILE=SYSTEM where OpenSSL will respect what's configured in crypto-policies. This keeps the configuration out of the installer while still giving the user control. Out of the box this is also more secure.
1 parent 69d55c9 commit af23995

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

manifests/plugin/remote_execution/mosquitto.pp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
$mosquitto_ssl_dir = "${mosquitto_config_dir}/ssl"
3434
$broker = $facts['networking']['fqdn']
3535

36+
if $facts['os']['family'] == 'RedHat' {
37+
$additional_config = ['ciphers PROFILE=SYSTEM']
38+
} else {
39+
$additional_config = []
40+
}
41+
3642
class { 'mosquitto':
3743
package_name => 'mosquitto',
3844
package_ensure => $ensure,
@@ -46,7 +52,7 @@
4652
"keyfile ${mosquitto_ssl_dir}/ssl_key.pem",
4753
"require_certificate ${require_certificate}",
4854
"use_identity_as_username ${use_identity_as_username}",
49-
],
55+
] + $additional_config,
5056
}
5157

5258
file { "${mosquitto_config_dir}/foreman.acl":

spec/classes/foreman_proxy__plugin__remote_execution__mosquitto_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
} end
1212

1313
describe 'with default settings' do
14+
let(:ciphers_option) { os_facts.dig(:os, 'family') == 'RedHat' ? ['ciphers PROFILE=SYSTEM'] : [] }
15+
1416
it 'should configure mosquitto' do
1517
should contain_class('mosquitto').
1618
with({
@@ -26,7 +28,7 @@
2628
'keyfile /etc/mosquitto/ssl/ssl_key.pem',
2729
'require_certificate true',
2830
'use_identity_as_username true'
29-
]
31+
] + ciphers_option
3032
})
3133
end
3234

0 commit comments

Comments
 (0)