@@ -230,22 +230,11 @@ Seed Hypervisor firewalld Configuration
230
230
Custom rules
231
231
------------
232
232
233
- Custom firewalld rules can be added for any of the following groups using their
234
- corresponding variables:
235
-
236
- * All hosts - ``stackhpc_common_firewalld_rules_extra ``
237
- * Controllers - ``stackhpc_controller_firewalld_rules_extra ``
238
- * Compute - ``stackhpc_compute_firewalld_rules_extra ``
239
- * Storage - ``stackhpc_storage_firewalld_rules_extra ``
240
- * Monitoring - ``stackhpc_monitoring_firewalld_rules_extra ``
241
- * Wazuh Manager Infrastructure VM - ``stackhpc_wazuh_manager_infra_vm_firewalld_rules_extra ``
242
- * Ansible Control host Infrastructure VM - ``stackhpc_ansible_control_infra_vm_firewalld_rules_extra ``
243
- * Seed - ``stackhpc_seed_firewalld_rules_extra ``
244
- * Seed Hypervisor - ``stackhpc_seed_hypervisor_firewalld_rules_extra ``
245
-
246
- Each variable is a list of firewall rules to apply. Each item is a dict
247
- containing arguments to pass to the firewalld module. The variables can be
248
- defined as group vars, host vars, or in the extra vars files.
233
+ Custom firewalld rules can be added to ``stackhpc_firewalld_rules_extra ``
234
+
235
+ The variable is a list of firewall rules to apply. Each item is a dict
236
+ containing arguments to pass to the firewalld module. The variable can be
237
+ defined as a group var or host var in the kayobe inventory.
249
238
250
239
The example below would enable SSH on the ``provision_oc `` network, and disable
251
240
UDP port 1000 on the ``admin_oc `` network for the Wazuh manager Infrastructure
254
243
.. code-block :: yaml
255
244
:caption : ` ` etc/kayobe/inventory/group_vars/wazuh_manager/firewall``
256
245
257
- stackhpc_wazuh_manager_infra_vm_firewalld_rules_extra :
246
+ stackhpc_firewalld_rules_extra :
258
247
- service : ssh
259
248
network : " {{ provision_oc_net_name }}"
260
249
zone : " {{ provision_oc_net_name | net_zone }}"
@@ -264,11 +253,10 @@ VM:
264
253
zone : " {{ admin_oc_net_name | net_zone }}"
265
254
state : disabled
266
255
267
- Beware that if any rules are found that directly conflict (a service or port is
268
- both enabled and disabled) the configuration will fail. There is currently no
269
- way to override rules in the standard configuration, other than to find the
270
- rule and delete it manually. If you find a standard rule that does not work for
271
- your deployment, please consider merging your changes back in to upstream SKC.
256
+ Extra rules have higher precedence than the default rules, but are not
257
+ validated before being applied. Use with caution. If you need to add a custom
258
+ rule, consider adding it to the default rule list with an appropriate boolean
259
+ condition, and where possible merge your changes back into upstream SKC.
272
260
273
261
Validation
274
262
----------
@@ -282,9 +270,9 @@ that will be applied to a host.
282
270
283
271
If the command above prints a template, rather than a clean list of rules, the
284
272
configuration is invalid. The kayobe configuration dump command can be used on
285
- other variables such as ``stackhpc_firewalld_rules_unverified `` or
286
- ``stackhpc_*_firewalld_rules `` to debug the configuration. See the ` How it
287
- works `_ section for more details.
273
+ other variables such as ``stackhpc_firewalld_rules_default `` or
274
+ ``stackhpc_*_firewalld_rules_template `` to debug the configuration. See the
275
+ ` How it works `_ section for more details.
288
276
289
277
Kolla-Ansible configuration
290
278
---------------------------
@@ -342,20 +330,17 @@ rules. The rules can then be enabled and disabled in sets, based on properties
342
330
of the cloud. For example, if ``kolla_enable_designate `` is true, a set of
343
331
rules will be enabled in ``stackhpc_controller_firewalld_rules_template ``.
344
332
345
- The rules are then formatted into a single list of the enabled default rules
346
- for a group e.g. ``stackhpc_controller_firewalld_rules_default `` for
347
- controllers. It is worth noting that the rules are also manipulated to reduce
333
+ The templates are combined into a single list,
334
+ ``stackhpc_firewalld_rules_template ``. Templates are selected according to the
335
+ host's group membership, as well as a set of common rules, which is enabled for
336
+ all hosts.
337
+
338
+ The rules are then formatted into a single list of the enabled default rules:
339
+ ``stackhpc_firewalld_rules_default ``. The Rules are manipulated to reduce
348
340
duplication. When no zone is specified in a rule template, it is inferred from
349
- the network.
341
+ the network. They are also validated. Conflicting rules will result in an
342
+ error. Non-applicable rules are dropped.
350
343
351
344
The default rules are combined with any extra rules defined for the deployment.
352
- For controllers, these are ``stackhpc_controller_firewalld_rules_extra ``. The
353
- complete set of controller firewalld rules is
354
- ``stackhpc_controller_firewalld_rules ``.
355
-
356
- Each group-specific list of rules is combined into
357
- ``stackhpc_firewalld_rules_unverified `` based on the host's group membership,
358
- as well as a set of common rules, which is enabled for all hosts.
359
-
360
- ``stackhpc_firewalld_rules `` is the final list of rules that have been verified
361
- for correctness.
345
+ The complete set of controller firewalld rules is
346
+ ``stackhpc_firewalld_rules ``.
0 commit comments