Add firewall setup with UFW

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

View file

@ -9,6 +9,7 @@
- apparmor
- haveged
- mosh
- ufw
- srvadmin-all # Dell OpenManage
- 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]
- import_tasks: users.yml
tags: [setup-users]
- import_tasks: firewall.yml
tags: [setup-firewall]