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

horizon: Add SSL protocol option. #2437

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions chef/cookbooks/horizon/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
default[:horizon][:policy_file][:neutron_fwaas] = "neutron-fwaas-policy.json"

default[:horizon][:apache][:ssl] = false
default[:horizon][:apache][:ssl_protocol] = "all -SSLv3"
default[:horizon][:apache][:ssl_crt_file] = "/etc/apache2/ssl.crt/openstack-dashboard-server.crt"
default[:horizon][:apache][:ssl_key_file] = "/etc/apache2/ssl.key/openstack-dashboard-server.key"
default[:horizon][:apache][:generate_certs] = false
Expand Down
1 change: 1 addition & 0 deletions chef/cookbooks/horizon/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@
user: node[:apache][:user],
group: node[:apache][:group],
use_ssl: node[:horizon][:apache][:ssl],
ssl_protocol: node[:horizon][:apache][:ssl_protocol],
ssl_crt_file: node[:horizon][:apache][:ssl_crt_file],
ssl_key_file: node[:horizon][:apache][:ssl_key_file],
ssl_crt_chain_file: node[:horizon][:apache][:ssl_crt_chain_file],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Listen <%= @bind_host %>:<%= @bind_port_ssl %>
<VirtualHost <%= @bind_host %>:<%= @bind_port_ssl %>>
SSLEngine On
SSLCipherSuite DEFAULT_SUSE
SSLProtocol all -SSLv2 -SSLv3
SSLProtocol <%= @ssl_protocol %>
# Prevent plaintext downgrade for 180 days
Header always set Strict-Transport-Security "max-age=15552000"
SSLCertificateFile <%= @ssl_crt_file %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def upgrade(template_attrs, template_deployment, attrs, deployment)
attrs["apache"]["ssl_protocol"] = template_attrs["apache"]["ssl_protocol"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do this only if attrs["apache"]["ssl_protocol"] is not already defined (because of a backported earlier migration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which is preferred way, if unless attrs.key? or if attr["..."].nil?, but the former looks better.

return attrs, deployment
end

def downgrade(template_attrs, template_deployment, attrs, deployment)
attrs["apache"].delete("ssl_protocol")
OttoHollmann marked this conversation as resolved.
Show resolved Hide resolved
return attrs, deployment
end
3 changes: 2 additions & 1 deletion chef/data_bags/crowbar/template-horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"apache": {
"ssl": false,
"generate_certs": false,
"ssl_protocol": "all -SSLv3",
"ssl_crt_file": "/etc/apache2/ssl.crt/openstack-dashboard-server.crt",
"ssl_key_file": "/etc/apache2/ssl.key/openstack-dashboard-server.key",
"ssl_crt_chain_file": ""
Expand All @@ -52,7 +53,7 @@
"horizon": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 302,
"schema-revision": 303,
OttoHollmann marked this conversation as resolved.
Show resolved Hide resolved
"element_states": {
"horizon-server": [ "readying", "ready", "applying" ]
},
Expand Down
1 change: 1 addition & 0 deletions chef/data_bags/crowbar/template-horizon.schema
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"mapping": {
"ssl": { "type": "bool", "required": true },
"generate_certs": { "type": "bool", "required": true },
"ssl_protocol": { "type": "str" },
"ssl_crt_file": { "type": "str" },
"ssl_key_file": { "type": "str" },
"ssl_crt_chain_file": { "type": "str" }
Expand Down
1 change: 1 addition & 0 deletions crowbar_framework/config/locales/horizon/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ en:
apache:
ssl: 'Protocol'
generate_certs: 'Generate (self-signed) certificates'
ssl_protocol: 'SSL Protocol Version'
OttoHollmann marked this conversation as resolved.
Show resolved Hide resolved
ssl_crt_file: 'SSL Certificate File'
ssl_key_file: 'SSL (Private) Key File'
ssl_crt_chain_file: 'SSL Certificate Chain File'
Expand Down