Add firewall setup with UFW

This commit is contained in:
Sam A. 2022-11-10 21:48:24 +01:00
parent 0e7cc20bce
commit 0b977793cd
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
3 changed files with 23 additions and 0 deletions

View file

@ -9,6 +9,7 @@
- apparmor - apparmor
- haveged - haveged
- mosh - mosh
- ufw
- srvadmin-all # Dell OpenManage - srvadmin-all # Dell OpenManage
- name: Install necessary packages via pip - name: Install necessary packages via pip

View file

@ -0,0 +1,20 @@
---
- name: Setup firewall with UFW
community.general.ufw:
state: enabled
policy: deny
- name: Allow necessary ports
community.general.ufw:
rule: allow
port: "{{ item }}"
loop:
- 22 # Gitea SSH
- 80 # HTTP
- 443 # HTTPS
- 389 # OpenLDAP
- 636 # OpenLDAP
- 25 # Email
- 465 # Email
- 587 # Email
- 993 # Email
- 19022 # SSH

View file

@ -7,4 +7,6 @@
tags: [install-base-packages] tags: [install-base-packages]
- import_tasks: users.yml - import_tasks: users.yml
tags: [setup-users] tags: [setup-users]
- import_tasks: firewall.yml
tags: [setup-firewall]