Skip to content

Commit fccd2f7

Browse files
committed
Address firewall config review comments
1 parent c482afb commit fccd2f7

File tree

3 files changed

+24
-29
lines changed

3 files changed

+24
-29
lines changed

doc/source/configuration/firewall.rst

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ API network:
239239
enable_external_api_firewalld: true
240240
external_api_firewalld_zone: "{{ public_net_name | net_zone }}"
241241
242+
Network configuration
243+
---------------------
244+
242245
Ensure every network in ``networks.yml`` has a zone defined. The standard
243246
configuration is to set the internal network zone to ``trusted`` and every
244247
other zone to the name of the network. See
@@ -253,20 +256,29 @@ The variable is a list of firewall rules to apply. Each item is a dictionary
253256
containing arguments to pass to the firewalld module. The variable can be
254257
defined as a group var or host var in the kayobe inventory.
255258

256-
The example below would enable SSH on the ``provision_oc`` network, and disable
257-
UDP port 1000 on the ``admin_oc`` network for the Wazuh manager Infrastructure
259+
The structure of custom rules is different from the default rules. Custom rules
260+
use the firewalld Ansible module format. Arguments are omitted if not provided,
261+
with the following exceptions:
262+
263+
* ``offline: true``
264+
* ``permanent: true``
265+
* ``state: enabled``
266+
267+
The main differences are that the ``zone`` argument is mandatory, and the
268+
``network`` argument is not.
269+
270+
The example below would enable SSH in the ``provision_oc`` zone, and disable
271+
UDP port 1000 in the ``admin_oc`` zone for the Wazuh manager Infrastructure
258272
VM:
259273

260274
.. code-block:: yaml
261275
:caption: ``etc/kayobe/inventory/group_vars/wazuh_manager/firewall``
262276
263277
stackhpc_firewalld_rules_extra:
264278
- service: ssh
265-
network: "{{ provision_oc_net_name }}"
266279
zone: "{{ provision_oc_net_name | net_zone }}"
267280
state: enabled
268281
- port: 1000/udp
269-
network: "{{ admin_oc_net_name }}"
270282
zone: "{{ admin_oc_net_name | net_zone }}"
271283
state: disabled
272284
@@ -275,23 +287,6 @@ validated before being applied. Use with caution. If you need to add a custom
275287
rule, consider adding it to the default rule list with an appropriate boolean
276288
condition, and where possible merge your changes back into upstream SKC.
277289

278-
Kolla-Ansible configuration
279-
---------------------------
280-
281-
Ensure Kolla Ansible opens up ports in firewalld for services on the public
282-
API network:
283-
284-
.. code-block:: yaml
285-
:caption: ``etc/kayobe/kolla/globals.yml``
286-
287-
enable_external_api_firewalld: true
288-
external_api_firewalld_zone: "{{ public_net_name | net_zone }}"
289-
290-
Ensure every network in ``networks.yml`` has a zone defined. The standard
291-
configuration is to set the internal network zone to ``trusted`` and every
292-
other zone to the name of the network. See
293-
``etc/kayobe/environments/ci-multinode/networks.yml`` for a practical example.
294-
295290
Validation
296291
----------
297292

doc/source/configuration/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ the various features provided.
88
.. toctree::
99
:maxdepth: 1
1010

11-
walled-garden
1211
release-train
1312
host-images
1413
lvm
1514
swap
1615
cephadm
1716
monitoring
18-
wazuh
1917
vault
18+
wazuh
19+
walled-garden
20+
security-hardening
21+
firewall
2022
magnum-capi
2123
ci-cd
22-
security-hardening
2324
cloudkitty
24-
firewall

etc/kayobe/inventory/group_vars/all/firewall

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ stackhpc_firewalld_rules_template: |
6666
{{ stackhpc_common_firewalld_rules_template +
6767
(stackhpc_controller_firewalld_rules_template if 'controllers' in group_names else []) +
6868
(stackhpc_compute_firewalld_rules_template if 'compute' in group_names else []) +
69-
(stackhpc_storage_firewalld_rules_template if 'storage' in group_names else []) +
69+
(stackhpc_ceph_firewalld_rules_template if 'ceph' in group_names else []) +
7070
(stackhpc_monitoring_firewalld_rules_template if 'monitoring' in group_names else []) +
7171
(stackhpc_seed_firewalld_rules_template if 'seed' in group_names else []) +
7272
(stackhpc_seed_hypervisor_firewalld_rules_template if 'seed-hypervisor' in group_names else []) +
@@ -209,9 +209,9 @@ stackhpc_compute_firewalld_rules_template:
209209
enabled: "{{ ('vxlan' in (kolla_neutron_ml2_type_drivers + kolla_neutron_ml2_tenant_network_types)) | bool }}"
210210

211211
###############################################################################
212-
# Storage firewalld rules
212+
# Ceph firewalld rules
213213

214-
stackhpc_storage_firewalld_rules_template:
214+
stackhpc_ceph_firewalld_rules_template:
215215
# Ceph Prometheus exporter
216216
- rules:
217217
- port: 9283/tcp
@@ -251,7 +251,7 @@ stackhpc_wazuh_manager_infra_vm_firewalld_rules_template:
251251
network: "{{ provision_oc_net_name }}"
252252
state: enabled
253253
- port: 443/tcp
254-
network: "{{ public_net_name }}"
254+
network: "{{ wazuh_dashboard_net_name | default(provision_oc_net_name) }}"
255255
state: enabled
256256
- port: 9200/tcp
257257
network: "{{ provision_oc_net_name }}"

0 commit comments

Comments
 (0)