Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/new fw continued #611

Merged
merged 26 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fe708db
Added "run_once: true" to tasks from roles/include_vars_from_other_gr…
pneerincx Aug 3, 2022
f18b905
Changed publicly_exposed for internal management addresses of Talos a…
pneerincx Aug 3, 2022
6126c04
Updated Talos group_vars for changes in the new iptables role (WIP).
pneerincx Aug 3, 2022
3f608d1
Fixes and new features for new iptables role (WIP).
pneerincx Aug 3, 2022
0bcafae
Updated generic firewall config for jumphosts.
pneerincx Aug 5, 2022
56b4381
Removed incorrect comment.
pneerincx Aug 5, 2022
f0c5e0b
Updated defaults for iptables role.
pneerincx Aug 5, 2022
43ed85d
Further improvements for iptables role (WIP).
pneerincx Aug 5, 2022
9cf5ac8
Cleanup: removed files no longer used.
pneerincx Aug 8, 2022
7480143
Wrote small README for iptables role.
pneerincx Aug 8, 2022
626c8ee
Several fixes, updated group vars for changes in iptables role and re…
pneerincx Aug 8, 2022
af9fc2e
Merge branch 'develop' into feature/new_fw_continued
pneerincx Aug 8, 2022
05119ad
Fixed linter issues.
pneerincx Aug 8, 2022
c11e346
Merge branch 'feature/new_fw_continued' of https://github.com/pneerin…
pneerincx Aug 8, 2022
e4ad04d
Fixed linter issues.
pneerincx Aug 8, 2022
d47b8a7
Fixed additional linter issues.
pneerincx Aug 8, 2022
7340bf3
Fixed additional linter issues.
pneerincx Aug 8, 2022
e013a9d
Removed redundant line that overruled an if then else block.
pneerincx Aug 11, 2022
b206fbc
Improved firewall and security group config for iRODS machines on Mer…
pneerincx Aug 11, 2022
f28da7a
Merge branch 'develop' into feature/new_fw_continued
pneerincx Aug 12, 2022
47a6fdc
Relocated configuration of kernel network tweaks to make sure they wi…
pneerincx Aug 15, 2022
cac602e
Merge branch 'feature/new_fw_continued' of https://github.com/pneerin…
pneerincx Aug 15, 2022
dafa64b
Deleted unused roles/iptables/templates/firewall.unit.j2
pneerincx Aug 15, 2022
1fd1a09
Fixed linter issue.
pneerincx Aug 15, 2022
e0d0d39
Merge branch 'develop' into feature/new_fw_continued
pneerincx Aug 15, 2022
58b60da
Update roles/iptables/README.md
pneerincx Aug 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions group_vars/all/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ ssh_host_signer_key_types: '.*(rsa|ed25519).*'
ssh_host_signer_hostnames: "{{ ansible_fqdn }},{{ ansible_hostname }}{% for host in groups['jumphost'] %},{{ host }}+{{ ansible_hostname }}{% endfor %}"
slurm_database_name: "{{ stack_prefix }}_slurm_accounting"
ai_jumphost: "{{ lookup('env','AI_PROXY') }}"
#
# Configure allowed network ports for geerlingguy.firewall role
#
firewall_allowed_tcp_ports:
- '22' # SSH
- '9100' # Node Exporter

#
# Local volume size (root partition) for all instances
#
Expand Down
8 changes: 0 additions & 8 deletions group_vars/cluster.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
---
ansible_python_interpreter: /usr/bin/python2.7
#
# Configure allowed network ports for geerlingguy.firewall role
#
firewall_allowed_tcp_ports:
- '22' # SSH
- '6817' # Slurm
- '6818' # Slurm
- '6819' # Slurm
...
9 changes: 6 additions & 3 deletions group_vars/data_transfer.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
firewall_allowed_tcp_ports:
- 22 # SSH.
- 443 # SSH.
iptables_allow_icmp_inbound:
- ANY
iptables_allow_https_inbound:
- ANY # On data_transfer servers port 443 is used for SSH too.
iptables_allow_ssh_inbound:
- ANY
ssh_host_signer_hostnames: "{{ ansible_hostname }}\
{% for network_id in ip_addresses[ansible_hostname] %}\
{% if ip_addresses[ansible_hostname][network_id]['fqdn'] is defined and
Expand Down
31 changes: 26 additions & 5 deletions group_vars/docs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
---
#
# Configure allowed network ports for geerlingguy.firewall role
# Firewall configuration.
#
firewall_allowed_tcp_ports:
- '22' # SSH
- '80' # HTTP
- '443' # HTTPS
iptables_allow_icmp_inbound:
- "{{ all.ip_addresses['umcg']['net1'] }}"
- "{{ all.ip_addresses['umcg']['net2'] }}"
- "{{ all.ip_addresses['umcg']['net3'] }}"
- "{{ all.ip_addresses['umcg']['net4'] }}"
- "{{ all.ip_addresses['rug']['bwp_net'] }}"
- "{{ all.ip_addresses['rug']['operator'] }}"
- "{{ all.ip_addresses['gcc']['cloud_net'] }}"
- "{{ fender_cluster.ip_addresses['corridor']['public'] }}"
- "{{ gearshift_cluster.ip_addresses['airlock']['vlan16'] }}"
- "{{ hyperchicken_cluster.ip_addresses['portal']['public'] }}"
- "{{ nibbler_cluster.ip_addresses['tunnel']['vlan16'] }}"
- "{{ talos_cluster.ip_addresses['reception']['vlan16'] }}"
- "{{ wingedhelix_cluster.ip_addresses['porch']['vlan16'] }}"
iptables_allow_ssh_inbound:
- "{{ fender_cluster.ip_addresses['corridor']['public'] }}"
- "{{ gearshift_cluster.ip_addresses['airlock']['vlan16'] }}"
- "{{ hyperchicken_cluster.ip_addresses['portal']['public'] }}"
- "{{ nibbler_cluster.ip_addresses['tunnel']['vlan16'] }}"
- "{{ talos_cluster.ip_addresses['reception']['vlan16'] }}"
- "{{ wingedhelix_cluster.ip_addresses['porch']['vlan16'] }}"
iptables_allow_http_inbound:
- ANY
iptables_allow_https_inbound:
- ANY
extra_jumphosts_for_docs_server:
- 'airlock' # Gearshift
- 'reception' # Talos
Expand Down
1 change: 0 additions & 1 deletion group_vars/gearshift_cluster/ip_addresses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ip_addresses:
vlan983:
address: 172.23.40.36
netmask: /32
publicly_exposed: true # This internal IP is linked to a public (floating) IP.
vlan16:
address: 129.125.60.196
netmask: /32
Expand Down
22 changes: 15 additions & 7 deletions group_vars/irods.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
---
firewall_allowed_tcp_ports: # list of open ports on iCAT server
- "22" # SSH.
- "443" # davrods SSL
- "1247" # irods
- "1248" # Control Plane Port
- "5432" # PostgreSQL
- "20000:20199" # irods
#
# Firewall configuration.
#
iptables_allow_icmp_inbound:
- ANY
iptables_allow_ssh_inbound:
- ANY
iptables_allow_ssh_outbound:
- ANY
iptables_allow_https_inbound:
- ANY # For DAVRODS.
iptables_allow_irods:
- ANY
iptables_allow_postgres_outbound:
- ANY

ir_version: '-4.2.11*' # if defined (empty): version will be installed (must start with '-' and end with '*')
ir_server_type: 'icat' # iRODS Server Type
Expand Down
38 changes: 33 additions & 5 deletions group_vars/jenkins.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
---
#
# Configure allowed network ports for geerlingguy.firewall role
# Firewall configuration.
#
firewall_allowed_tcp_ports:
- '22' # SSH
- '80' # HTTP
- '443' # HTTPS
iptables_allow_icmp_inbound:
- "{{ all.ip_addresses['umcg']['net1'] }}"
- "{{ all.ip_addresses['umcg']['net2'] }}"
- "{{ all.ip_addresses['umcg']['net3'] }}"
- "{{ all.ip_addresses['umcg']['net4'] }}"
- "{{ all.ip_addresses['rug']['bwp_net'] }}"
- "{{ all.ip_addresses['rug']['operator'] }}"
- "{{ all.ip_addresses['gcc']['cloud_net'] }}"
- "{{ fender_cluster.ip_addresses['corridor']['public'] }}"
- "{{ gearshift_cluster.ip_addresses['airlock']['vlan16'] }}"
- "{{ hyperchicken_cluster.ip_addresses['portal']['public'] }}"
- "{{ nibbler_cluster.ip_addresses['tunnel']['vlan16'] }}"
- "{{ talos_cluster.ip_addresses['reception']['vlan16'] }}"
- "{{ wingedhelix_cluster.ip_addresses['porch']['vlan16'] }}"
iptables_allow_ssh_inbound:
- "{{ fender_cluster.ip_addresses['corridor']['public'] }}"
- "{{ gearshift_cluster.ip_addresses['airlock']['vlan16'] }}"
- "{{ hyperchicken_cluster.ip_addresses['portal']['public'] }}"
- "{{ nibbler_cluster.ip_addresses['tunnel']['vlan16'] }}"
- "{{ talos_cluster.ip_addresses['reception']['vlan16'] }}"
- "{{ wingedhelix_cluster.ip_addresses['porch']['vlan16'] }}"
iptables_allow_ssh_outbound:
- "{{ hyperchicken_cluster.ip_addresses['portal']['public'] }}"
- "{{ talos_cluster.ip_addresses['reception']['vlan16'] }}"
iptables_allow_https_inbound:
- "{{ all.ip_addresses['umcg']['net1'] }}"
- "{{ all.ip_addresses['umcg']['net2'] }}"
- "{{ all.ip_addresses['umcg']['net3'] }}"
- "{{ all.ip_addresses['umcg']['net4'] }}"
- "{{ all.ip_addresses['rug']['bwp_net'] }}"
- "{{ all.ip_addresses['rug']['operator'] }}"
- "{{ all.ip_addresses['gcc']['cloud_net'] }}"
extra_jumphosts_for_jenkins_server:
- 'airlock' # Gearshift
- 'reception' # Talos
Expand Down
14 changes: 8 additions & 6 deletions group_vars/jumphost.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
firewall_allowed_tcp_ports:
- 22 # SSH.
- 443 # SSH fallback when 22 is blocked.
- 3000 # Grafana server.
firewall_additional_rules:
- "iptables -A INPUT -i eth1 -p tcp -s 129.125.2.233,129.125.2.225,129.125.2.226 --dport 9090 -j ACCEPT -m comment --comment 'prometheus server'"
iptables_allow_icmp_inbound:
- ANY
iptables_allow_https_inbound:
- ANY # Port 443 is used as fallback for SSH on jumphosts. Port 443 outbound is allowed by default.
iptables_allow_ssh_inbound:
- ANY
iptables_allow_ssh_outbound:
- ANY
ssh_host_signer_hostnames: "{{ ansible_hostname }}\
{% for network_id in ip_addresses[ansible_hostname] %}\
{% if ip_addresses[ansible_hostname][network_id]['fqdn'] is defined and
Expand Down
1 change: 0 additions & 1 deletion group_vars/talos_cluster/ip_addresses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ip_addresses:
vlan983:
address: 172.23.40.100
netmask: /32
publicly_exposed: true # This internal IP is linked to a public (floating) IP.
vlan16:
address: 129.125.60.18
netmask: /32
Expand Down
89 changes: 0 additions & 89 deletions group_vars/talos_cluster/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,93 +176,4 @@ ega_fuse_client_mounts:
cineca: '/groups/umcg-cineca/prm08/ega-fuse-client'
solve_rd: '/groups/umcg-solve-rd/prm08/ega-fuse-client'
ega_fuse_client_java_home: '/etc/alternatives/jre_11_openjdk'
iptables_allow_icmp_inbound:
- 'umcg_net1'
- 'umcg_net2'
- 'umcg_net3'
- 'rug_bwp_net'
- 'rug_operator'
- 'rug_gcc_cloud_net'
- 'foyer'
- 'boxy'
- 'bender'
- 'lobby'
- 'calculon'
- 'flexo'
- 'gate'
- 'zinc_finger'
- 'coenzyme'
- 'passage'
- 'leucine_zipper'
- 'chaperone'
- 'airlock'
- 'jenkins1'
- 'jenkins2'
iptables_allow_ssh_inbound:
- 'umcg_net1'
- 'umcg_net2'
- 'umcg_net3'
- 'rug_bwp_net'
- 'rug_operator'
- 'foyer'
- 'boxy'
- 'bender'
- 'lobby'
- 'calculon'
- 'flexo'
- 'gate'
- 'zinc_finger'
- 'coenzyme'
- 'passage'
- 'leucine_zipper'
- 'chaperone'
- 'airlock'
- 'jenkins1'
- 'jenkins2'
iptables_allow_ssh_outbound:
- 'foyer'
- 'boxy'
- 'bender'
- 'lobby'
- 'calculon'
- 'flexo'
- 'gate'
- 'peregrine'
- 'gattaca01'
- 'gattaca02'
- 'cher_ami'
- 'eriba_ds'
- 'molgenis_downloads'
- 'airlock'
- 'surfsara_grid_ui'
- 'lumc_shark_ui'
- 'cnag_sftp'
- 'erasmus_mc_net'
- 'rug_f5_net'
- 'sanger_sftp'
iptables_allow_ebi_mysql_outbound:
- 'ebi_sanger_net1'
- 'ebi_sanger_net2'
iptables_allow_ftp_outbound:
- 'ebi_sanger_net1'
- 'ebi_sanger_net2'
- 'broad_ftp'
- 'ncbi_net1'
- 'ncbi_net2'
iptables_allow_aspera_outbound:
- 'ebi_sanger_net1'
- 'ebi_sanger_net2'
- 'broad_aspera_1'
- 'broad_aspera_2'
- 'broad_aspera_3'
- 'broad_aspera_4'
- 'broad_aspera_5'
- 'broad_aspera_6'
- 'broad_aspera_7'
- 'broad_aspera_8'
- 'broad_aspera_9'
- 'ncbi_net1'
- 'ncbi_net2'
iptables_allow_globus_outbound:
- 'sanger_globus'
...
2 changes: 0 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#
---
roles:
- src: geerlingguy.firewall
version: 2.5.0
- src: geerlingguy.repo-epel
version: 3.0.0
- src: geerlingguy.security
Expand Down
3 changes: 3 additions & 0 deletions roles/include_vars_from_other_groups/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
register: ip_addresses_files_found
delegate_to: localhost
connection: local
run_once: true

- name: Include ip_addresses per stack from ip_addresses.yml files.
ansible.builtin.include_vars:
Expand All @@ -16,10 +17,12 @@
register: included_ip_addresses
delegate_to: localhost
connection: local
run_once: true

- name: Combine network info from ip_addresses per stack into one dict for all items from all stacks.
ansible.builtin.set_fact:
all_ip_addresses: "{{ included_ip_addresses.results | json_query('[].ansible_facts.*[].ip_addresses') | combine() }}"
delegate_to: localhost
connection: local
run_once: true
...
Loading