Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce server_ca_file parameter #910

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@
#
# $server_ssl_verify_client:: Defines the Apache mod_ssl SSLVerifyClient setting in Foreman vhost conf file.
#
# $server_ca_file_configure:: Defines if the server_ca_file should also be configured for Foreman itself.
#
# $client_ssl_ca:: Defines the SSL CA used to communicate with Foreman Proxies
#
# $client_ssl_cert:: Defines the SSL certificate used to communicate with Foreman Proxies
Expand Down Expand Up @@ -250,6 +252,7 @@
Variant[Enum[''], Stdlib::Absolutepath] $server_ssl_crl = $foreman::params::server_ssl_crl,
Optional[String] $server_ssl_protocol = $foreman::params::server_ssl_protocol,
Enum['none','optional','require','optional_no_ca'] $server_ssl_verify_client = $foreman::params::server_ssl_verify_client,
Boolean $server_ca_file_configure = $foreman::params::server_ca_file_configure,
Stdlib::Absolutepath $client_ssl_ca = $foreman::params::client_ssl_ca,
Stdlib::Absolutepath $client_ssl_cert = $foreman::params::client_ssl_cert,
Stdlib::Absolutepath $client_ssl_key = $foreman::params::client_ssl_key,
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
$server_ssl_protocol = undef
$server_ssl_verify_client = 'optional'

$server_ca_file_configure = false

# We need the REST API interface with OAuth for some REST Puppet providers
$oauth_active = true
$oauth_map_users = false
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
server_ssl_key: '/etc/ssl/private/snakeoil.pem',
server_ssl_crl: '/etc/ssl/certs/ca/crl.pem',
server_ssl_protocol: '-all +TLSv1.2',
server_ca_file_configure: true,
client_ssl_ca: '/etc/ssl/certs/ca.pem',
client_ssl_cert: '/etc/ssl/certs/snakeoil.pem',
client_ssl_key: '/etc/ssl/private/key.pem',
Expand Down Expand Up @@ -268,6 +269,7 @@
is_expected.to contain_concat__fragment('foreman_settings+01-header.yaml')
.with_content(%r{^:websockets_ssl_key: /etc/ssl/private/snakeoil-ws\.pem$})
.with_content(%r{^:websockets_ssl_cert: /etc/ssl/certs/snakeoil-ws\.pem$})
.with_content(%r{^:server_ca_file: /etc/ssl/certs/ca\.pem$})
end
end

Expand Down
3 changes: 3 additions & 0 deletions templates/settings.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
:ssl_certificate: <%= scope.lookupvar("foreman::client_ssl_cert") %>
:ssl_ca_file: <%= scope.lookupvar("foreman::client_ssl_ca") %>
:ssl_priv_key: <%= scope.lookupvar("foreman::client_ssl_key") %>
<% if scope.lookupvar("foreman::server_ca_file_configure") -%>
:server_ca_file: <%= scope.lookupvar("foreman::server_ssl_ca") %>
<% end -%>

# HSTS setting
:hsts_enabled: <%= scope.lookupvar("foreman::hsts_enabled") %>
Expand Down