Saltstack Official IPTables Formula
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. iptables_{{ chain_name }}_{{ rule_name }}:
  2. {%- if rule.position is defined %}
  3. iptables.insert:
  4. - position: {{ rule.position }}
  5. {%- else %}
  6. iptables.append:
  7. {%- if loop.index != 1 %}
  8. - require:
  9. - iptables: iptables_{{ chain_name }}_{% if service_name is defined %}{{ service_name }}_{% endif %}{{ loop.index - 1 }}
  10. {%- endif %}
  11. {%- endif %}
  12. - table: {{ rule.get('table', 'filter') }}
  13. - chain: {{ chain_name }}
  14. {%- if rule.jump is defined %}
  15. - jump: {{ rule.jump }}
  16. {%- endif %}
  17. {%- if rule.match is defined %}
  18. - match: {{ rule.match }}
  19. {%- endif %}
  20. {%- if rule.connection_state is defined %}
  21. - connstate: {{ rule.connection_state }}
  22. {%- endif %}
  23. {%- if rule.protocol is defined %}
  24. - proto: {{ rule.protocol }}
  25. {%- endif %}
  26. {%- if rule.destination_port is defined %}
  27. - dport: {{ rule.destination_port }}
  28. {%- endif %}
  29. {%- if rule.source_port is defined %}
  30. - sport: {{ rule.source_port }}
  31. {%- endif %}
  32. {%- if rule.in_interface is defined %}
  33. - in-interface: {{ rule.in_interface }}
  34. {%- endif %}
  35. {%- if rule.out_interface is defined %}
  36. - out-interface: {{ rule.out_interface }}
  37. {%- endif %}
  38. {%- if rule.to_destination is defined %}
  39. - to-destination: {{ rule.to_destination }}
  40. {%- endif %}
  41. {%- if rule.to_source is defined %}
  42. - to-source: {{ rule.to_source }}
  43. {%- endif %}
  44. {%- if rule.source_network is defined %}
  45. - source: {{ rule.source_network }}
  46. {%- endif %}
  47. {%- if rule.destination_network is defined %}
  48. - destination: {{ rule.destination_network }}
  49. {%- endif %}
  50. {%- if chain.policy is defined %}
  51. - require_in:
  52. - iptables: iptables_{{ chain_name }}_policy
  53. {%- endif %}
  54. - save: True