2024-04-05 04:00:50 +00:00
|
|
|
[OPTIONS]
|
|
|
|
|
|
|
|
enable: 1
|
|
|
|
|
|
|
|
[RULES]
|
|
|
|
|
|
|
|
IN Ping(ACCEPT) -log nolog # don’t be rude
|
|
|
|
IN SSH(ACCEPT) -i mgmt # for ansible etc.
|
|
|
|
IN ACCEPT -source {{ nodes | map('device_address') | flatten | selectattr('family.value', '==', 4) | map(attribute='address') | join(',') }} # my cluster
|
|
|
|
IN ACCEPT -source {{ nodes | map('device_address') | flatten | selectattr('family.value', '==', 6) | map(attribute='address') | join(',') }} # my cluster
|
2024-06-19 11:33:32 +00:00
|
|
|
{% for service in cluster_services %}
|
2024-04-05 04:00:50 +00:00
|
|
|
{% set prefixes = service | allowed_prefixes %}
|
|
|
|
{% set ports = service.ports | compact_numlist(range_delimiter=':') %}
|
2024-08-03 09:44:03 +00:00
|
|
|
{% if prefixes | ipv4 %}
|
|
|
|
IN ACCEPT -source {{ prefixes | ipv4 | join(',') }} -p {{ service.protocol.value }} -dport {{ ports }} # {{ service.name }}
|
2024-04-05 04:00:50 +00:00
|
|
|
{% endif %}
|
2024-08-03 09:44:03 +00:00
|
|
|
{% if prefixes | ipv6 %}
|
|
|
|
IN ACCEPT -source {{ prefixes | ipv6 | join(',') }} -p {{ service.protocol.value }} -dport {{ ports }} # {{ service.name }}
|
2024-04-05 04:00:50 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|