Add zun console to HSTS

At the moment HSTS for base service prohibits wss for the Zun console
In order to add console access only when needed, we do add it
conditionally.

Closes-Bug: #2147415
Change-Id: Ib6197d34783a3b33c8be2edcec3a0918053a13fe
Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
This commit is contained in:
Dmitriy Rabotyagov
2026-04-07 12:28:33 +02:00
parent 3a70ea6e6c
commit 21c2b2b3d8
3 changed files with 23 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
---
# Copyright 2026, Cleura AB.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
zun_wsproxy_port: 6784
zun_wsproxy_proto: "{{ (openstack_service_publicuri_proto == 'https') | ternary('wss', 'ws') }}"
+5 -3
View File
@@ -36,11 +36,13 @@ haproxy_security_child_src_records:
- "{{ external_lb_vip_address }}:{{ nova_spice_html5proxy_base_port }}"
- "{{ external_lb_vip_address }}:{{ nova_novncproxy_port }}"
- "{{ external_lb_vip_address }}:{{ nova_serialconsoleproxy_port }}"
- "{{ ('zun_all' in groups and groups['zun_all'] | length > 0) | ternary(external_lb_vip_address ~ ':' ~ zun_wsproxy_port, '') }}"
haproxy_security_frame_ancestors_records: []
haproxy_security_frame_src_records: "{{ haproxy_security_child_src_records }}"
haproxy_security_connect_src_records:
- "{{ external_lb_vip_address }}:*"
- "wss://{{ external_lb_vip_address }}:{{ ironic_console_port }}"
- "{{ ('zun_all' in groups and groups['zun_all'] | length > 0) | ternary(zun_wsproxy_proto ~ '://' ~ external_lb_vip_address ~ ':' ~ zun_wsproxy_port, '') }}"
haproxy_security_headers_csp: >
http-response set-header {{ haproxy_security_headers_csp_report_only | ternary('Content-Security-Policy-Report-Only', 'Content-Security-Policy') }} "
default-src 'self';
@@ -49,9 +51,9 @@ haproxy_security_headers_csp: >
upgrade-insecure-requests;
style-src 'self' 'unsafe-inline';
script-src 'self' 'unsafe-inline' 'unsafe-eval';
child-src 'self' {{ haproxy_security_child_src_records | join(' ') }};
frame-src 'self' {{ haproxy_security_frame_src_records | join(' ') }};
connect-src 'self' {{ haproxy_security_connect_src_records | join(' ') }};
child-src 'self' {{ haproxy_security_child_src_records | select | join(' ') }};
frame-src 'self' {{ haproxy_security_frame_src_records | select | join(' ') }};
connect-src 'self' {{ haproxy_security_connect_src_records | select | join(' ') }};
img-src 'self' data:;
worker-src blob:;
"
@@ -31,7 +31,7 @@ haproxy_zun_console_service:
haproxy_backend_nodes: "{{ groups['zun_api'] | default([]) }}"
haproxy_ssl: "{{ haproxy_ssl }}"
haproxy_ssl_all_vips: "{{ haproxy_ssl_all_vips }}"
haproxy_port: 6784
haproxy_port: "{{ zun_wsproxy_port }}"
haproxy_balance_type: http
haproxy_timeout_client: 60m
haproxy_timeout_server: 60m