Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a60273
commit ebac9f3
Showing
8 changed files
with
147 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
- name: Ensure iptables is installed # well aware nftables is a thing | ||
become: yes | ||
ansible.builtin.apt: | ||
name: "{{ item.package }}" | ||
state: present | ||
update_cache: yes | ||
when: | ||
- tor_exit_enabled | bool | ||
loop: | ||
- package: iptables-persistent | ||
- package: iptables | ||
|
||
- name: Drop outbound tcp ports - ipv4 | ||
ansible.builtin.iptables: | ||
chain: OUTPUT | ||
jump: DROP | ||
protocol: tcp | ||
destination_port: "{{ item.port }}" | ||
loop: | ||
- port: 2525 | ||
- port: 587 | ||
- port: 465 | ||
- port: 25 | ||
- port: 22 | ||
when: | ||
- (tor_exit_enabled | bool) and (not ipv6_enabled | bool) | ||
become: yes | ||
|
||
- name: Drop outbound udp ports - ipv4 | ||
ansible.builtin.iptables: | ||
chain: OUTPUT | ||
jump: DROP | ||
protocol: udp | ||
destination_port: "{{ item.port }}" | ||
loop: | ||
- port: 2525 | ||
- port: 587 | ||
- port: 465 | ||
- port: 25 | ||
- port: 22 | ||
become: yes | ||
when: | ||
- (tor_exit_enabled | bool) and (not ipv6_enabled | bool) | ||
|
||
- name: Drop outbound tcp ports - ipv6 | ||
ansible.builtin.iptables: | ||
ip_version: ipv6 | ||
chain: OUTPUT | ||
jump: DROP | ||
protocol: tcp | ||
destination_port: "{{ item.port }}" | ||
loop: | ||
- port: 2525 | ||
- port: 587 | ||
- port: 465 | ||
- port: 25 | ||
- port: 22 | ||
when: | ||
- (tor_exit_enabled | bool) and (ipv6_enabled | bool) | ||
become: yes | ||
|
||
- name: Drop outbound udp ports - ipv6 | ||
ansible.builtin.iptables: | ||
ip_version: ipv6 | ||
chain: OUTPUT | ||
jump: DROP | ||
protocol: udp | ||
destination_port: "{{ item.port }}" | ||
loop: | ||
- port: 2525 | ||
- port: 587 | ||
- port: 465 | ||
- port: 25 | ||
- port: 22 | ||
become: yes | ||
when: | ||
- (tor_exit_enabled | bool) and (ipv6_enabled | bool) | ||
|
||
- name: Save current state of the firewall in system file - ipv4 | ||
community.general.iptables_state: | ||
state: saved | ||
path: /etc/iptables/rules.v4 | ||
become: yes | ||
when: | ||
- (tor_exit_enabled | bool) and (not ipv6_enabled | bool) | ||
|
||
- name: Save current state of the firewall in system file - ipv6 | ||
community.general.iptables_state: | ||
state: saved | ||
path: /etc/iptables/rules.v6 | ||
become: yes | ||
when: | ||
- (tor_exit_enabled | bool) and (ipv6_enabled | bool) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
--- | ||
- hosts: testnode | ||
- hosts: | ||
- testnode4 | ||
vars: | ||
contact_info: "email:tor[]shadowbrokers.eu - testing automation" | ||
contact_info: "email:tor[]shadowbrokers.eu url:shadowbrokers.eu proof:dns-rsa btc:bc1qu9m2sy836pmyku0t3vnmpjxfjds8p2x5psyl6y ciissversion:2 - EXPERIMENTAL NODE" | ||
tor_contact_email: tor@shadowbrokers.eu | ||
hostname: "{{ inventory_hostname }}" | ||
ipv6_enabled: "{{ ipv6_enabled_conf | default('yes') }}" | ||
tor_exit_enabled: "{{ tor_exit_enabled_conf | default('no') }}" | ||
kilobytes_burst: "{{ kilobytes_burst_conf | default('') }}" | ||
kilobytes_rate: "{{ kilobytes_rate_conf | default('') }}" | ||
tor_family: > | ||
testing | ||
none | ||
roles: | ||
- setup-manjaro-user | ||
- setup-apparmor | ||
- restrict-kernel | ||
- setup-dns | ||
- install-and-configure-tor | ||
# - install-netdata-agent | ||
- set-ssh-config #any reboots after this role, will fail during very first setup with root user | ||
- get-node-hash | ||
- upgrade-bookworm-from-bullseye | ||
# - setup-manjaro-user | ||
# - setup-apparmor | ||
# - restrict-kernel | ||
# - setup-dns | ||
# - install-and-configure-tor | ||
# - install-netdata-agent | ||
# - set-ssh-config | ||
# - get-node-hash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters