<commit_before>---
- name: Enable all established connection
  iptables:
    chain: INPUT
    ctstate: ESTABLISHED,RELATED
    jump: ACCEPT
- name: Enable incoming connection
  iptables:
    chain: INPUT
    ctstate: NEW
    protocol: tcp
    destination_port: "{{item}}"
    jump: ACCEPT
  with_items:
    - ssh
    - http
    - https
- name: Enable incoming icmp echo
  iptables:
    chain: INPUT
    protocol: icmp
    # Эта штука работает только в ansible 2.2
    #icmp_type: echo
    jump: ACCEPT
- name: Disable all other incoming packets
  command: iptables -P INPUT DROP
  # Эта штука работает в ansible 2.2
  #iptables:
  #  chain: INPUT
  #  policy: DROP
- name: Save ruleset
  shell: iptables-save > /etc/iptables.rules<commit_msg>#45: iptables без состояний<commit_after>---
- name: Enable incoming connection
  iptables:
    chain: INPUT
    protocol: tcp
    destination_port: "{{item}}"
    jump: ACCEPT
  with_items:
    - ssh
    - http
    - https
- name: Enable traffic for outgoing connection
  iptables:
    chain: INPUT
    protocol: tcp
    source_port: "{{item}}"
    jump: ACCEPT
  with_items:
    - http
    - https
    - git
- name: Enable dns traffic
  iptables:
    chain: INPUT
    protocol: udp
    source_port: domain
    jump: ACCEPT
- name: Enable incoming icmp echo
  iptables:
    chain: INPUT
    protocol: icmp
    # Эта штука работает только в ansible 2.2
    #icmp_type: echo
    jump: ACCEPT
- name: Disable all other incoming packets
  command: iptables -P INPUT DROP
  # Эта штука работает в ansible 2.2
  #iptables:
  #  chain: INPUT
  #  policy: DROP
- name: Save ruleset
  shell: iptables-save > /etc/iptables.rules
{'fraction_non_alphanumeric': 0.08428657435279951, 'fraction_numerical': 0.006020469596628537, 'mean_word_length': 2.6447368421052633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1058573', 'n_tokens_mistral': 589, 'n_tokens_neox': 591, 'n_words': 182}