<commit_before># Firewall configuration written by salt
# Manual customization of this file is not cool.

{% set rules = salt['pillar.get']('firewall', {}) %}

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
{% for rule, config in rules.iteritems() -%}
{% if not config.get("raw") and not config.get("raw_v6") -%}
{% set port = config.get('port', 22) -%}
{% set proto = config.get('protocol', 'tcp') -%}
{% set source = config.get('source') -%}
{% if not source or (source and salt["ip_picker.ip_family"](source) == "ipv4") -%}
# {{ rule }}
-A INPUT -m state --state NEW -m {{ proto }} -p {{ proto }} -s {{ source|default('0.0.0.0/0', true) }} --dport {{ port }} -j ACCEPT
{% endif -%}
{% elif config.get("raw") -%}
# {{ rule }}
{{ config.raw }}
{% endif -%}
{% endfor -%}
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT<commit_msg>Space out the iptables rules better to read them easier<commit_after># Firewall configuration written by salt
# Manual customization of this file is not cool.

{% set rules = salt['pillar.get']('firewall', {}) %}

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]

# Default rules
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT

# SSH
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

{% for rule, config in rules.iteritems() -%}
{% if not config.get("raw") and not config.get("raw_v6") -%}
{% set port = config.get('port', 22) -%}
{% set proto = config.get('protocol', 'tcp') -%}
{% set source = config.get('source') -%}
{% if not source or (source and salt["ip_picker.ip_family"](source) == "ipv4") -%}
# {{ rule }}
-A INPUT -m state --state NEW -m {{ proto }} -p {{ proto }} -s {{ source|default('0.0.0.0/0', true) }} --dport {{ port }} -j ACCEPT
{% endif -%}
{% elif config.get("raw") -%}
# {{ rule }}
{{ config.raw }}
{% endif -%}

{% endfor -%}

# Rejections
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
{'fraction_non_alphanumeric': 0.1999121265377856, 'fraction_numerical': 0.014938488576449912, 'mean_word_length': 3.4647058823529413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2746212', 'n_tokens_mistral': 899, 'n_tokens_neox': 871, 'n_words': 270}