Smarter firewall handling again

This commit is contained in:
Sam A. 2023-11-12 18:22:08 +01:00
parent 59febe2622
commit 67f29a6e32
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
2 changed files with 49 additions and 46 deletions

View file

@ -1,6 +1,9 @@
# vim: ft=yaml.ansible # vim: ft=yaml.ansible
# code: language=ansible # code: language=ansible
--- ---
- name: General firewall rules
notify: Reload firewalld
block:
- name: Move main LAN and VPN networks to zone 'drop' - name: Move main LAN and VPN networks to zone 'drop'
ansible.posix.firewalld: ansible.posix.firewalld:
zone: drop zone: drop
@ -35,6 +38,14 @@
- dmz - dmz
- internal - internal
# Until sapt-labx-ctl01 is deployed
- name: Allow incoming connections to SSH port in zone 'drop'
ansible.posix.firewalld:
zone: drop
service: ssh
permanent: true
state: enabled
# When sapt-labx-ctl01 is deployed # When sapt-labx-ctl01 is deployed
# - name: Allow incoming connections from jump host to SSH port in zone 'dmz' # - name: Allow incoming connections from jump host to SSH port in zone 'dmz'
# ansible.posix.firewalld: # ansible.posix.firewalld:
@ -44,20 +55,13 @@
# permanent: true # permanent: true
# state: enabled # state: enabled
# Until sapt-labx-ctl01 is deployed
- name: Allow incoming connections to SSH port in zone 'drop'
ansible.posix.firewalld:
zone: drop
service: ssh
permanent: true
state: enabled
- name: Firewall rules for production and staging - name: Firewall rules for production and staging
loop: loop:
- prod - prod
- stage - stage
loop_control: loop_control:
loop_var: env loop_var: env
notify: Reload firewalld
block: block:
- name: Allow incoming connections from app servers to PostgreSQL port in zone 'internal' - name: Allow incoming connections from app servers to PostgreSQL port in zone 'internal'
ansible.posix.firewalld: ansible.posix.firewalld:

View file

@ -6,7 +6,6 @@
- name: Configure firewall - name: Configure firewall
ansible.builtin.import_tasks: firewall.yml ansible.builtin.import_tasks: firewall.yml
notify: Reload firewalld
- name: Configure user accounts - name: Configure user accounts
ansible.builtin.import_tasks: users.yml ansible.builtin.import_tasks: users.yml