From 92d485bea50f289745c81ff7b7c51a7def21bb3a Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 28 Dec 2022 17:43:49 +0100 Subject: [PATCH] Create ICMP Firewall rule --- defaults/main.yml | 5 +++++ tasks/firewall.yml | 22 ++++++++++++++++++++++ tasks/main.yml | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 defaults/main.yml create mode 100644 tasks/firewall.yml create mode 100644 tasks/main.yml diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..a2a190a --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,5 @@ +--- +# set ICMP Profiles on private and public networks on default +win_firewall_icmp_profiles: + - private + - public diff --git a/tasks/firewall.yml b/tasks/firewall.yml new file mode 100644 index 0000000..c123782 --- /dev/null +++ b/tasks/firewall.yml @@ -0,0 +1,22 @@ +--- +- name: Firewall rule to alloc ICMP v4 on all type codes + community.windows.win_firewall_rule: + name: ICMP Allow incoming V4 echo request + enabled: yes + state: present + profiles: "{{ win_firewall_icmp_profiles }}" + action: allow + direction: in + protocol: icmpv4 + icmp_type_code: '*' + +- name: Firewall rule to alloc ICMP v6 on all type codes + community.windows.win_firewall_rule: + name: ICMP Allow incoming V6 echo request + enabled: yes + state: present + profiles: "{{ win_firewall_icmp_profiles }}" + action: allow + direction: in + protocol: icmpv6 + icmp_type_code: '*' diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..4801d9d --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- name: Cofigure ICMP on Windows Firewall + ansible.builtin.include_tasks: firewall.yml