pending changes
All checks were successful
ansible-lint / lint-everything (push) Successful in 1m29s

This commit is contained in:
VC
2025-04-01 15:50:01 +02:00
parent a94e9fcc9e
commit f214e40aac
9 changed files with 66 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
---
global_public_ip_address: 82.66.135.228

View File

@@ -3,7 +3,7 @@
web_hostname: web_hostname:
- host: mail-relay.mateu.be - host: mail-relay.mateu.be
allowed_smtp_ips: ["82.66.135.228", "80.67.179.200"] allowed_smtp_ips: "{{ [global_public_ip_address] + ['80.67.179.200'] }}"
global_smtp_relay_allowed_ips: "{{ allowed_smtp_ips }}" global_smtp_relay_allowed_ips: "{{ allowed_smtp_ips }}"
ufw_allowed_smtp_ips: "{{ allowed_smtp_ips }}" ufw_allowed_smtp_ips: "{{ allowed_smtp_ips }}"

View File

@@ -25,6 +25,7 @@ physicalservers:
hosts: hosts:
frederica: frederica:
serenor: serenor:
ks3370405:
webservers: webservers:
hosts: hosts:

View File

@@ -3,5 +3,4 @@
- name: Install & configure the global SMTP relay - name: Install & configure the global SMTP relay
hosts: ks3370405 hosts: ks3370405
roles: roles:
- ufw
- global_smtp_relay - global_smtp_relay

View File

@@ -20,6 +20,8 @@
import_playbook: mail.yml import_playbook: mail.yml
- name: Run global_smtprelay playbook - name: Run global_smtprelay playbook
import_playbook: global_smtprelay.yml import_playbook: global_smtprelay.yml
- name: Run ufw plabook
import_playbook: ufw.yml
- name: Run xmpp playbook - name: Run xmpp playbook
import_playbook: xmpp.yml import_playbook: xmpp.yml
- name: Run webservers playbook - name: Run webservers playbook

6
playbooks/ufw.yml Normal file
View File

@@ -0,0 +1,6 @@
---
- name: Install & configure UFW
hosts: ks3370405
roles:
- ufw

View File

@@ -350,6 +350,53 @@ config redirect
option dest_port '64738' option dest_port '64738'
option target 'DNAT' option target 'DNAT'
# Allow DNS traffic
config rule
option name 'Allow-INPUT-DNS'
option src 'wan'
list proto 'tcp'
list proto 'udp'
option dest 'dmz'
option dest_ip '{{ hostvars['dns1'].proxmox_net0.ip6 | ansible.utils.ipaddr('address') }}'
option dest_port '53'
option target 'ACCEPT'
option family 'ipv6'
config redirect
option name 'Allow-INPUT-DNS'
option src 'wan'
option src_dport '53'
list proto 'tcp'
list proto 'udp'
option dest 'dmz'
option dest_ip '{{ hostvars['dns1'].proxmox_net0.ip | ansible.utils.ipaddr('address') }}'
option dest_port '53'
option target 'DNAT'
config rule
option name 'Allow-OUTPUT-DNS'
option src 'dmz'
option src_ip '{{ hostvars['dns1'].proxmox_net0.ip | ansible.utils.ipaddr('address') }}'
list proto 'tcp'
list proto 'udp'
option dest 'wan'
option dest_port '53'
option dest_ip '{{ hostvars['ks3370405'].ansible_default_ipv4.address }}'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-OUTPUT-DNS'
option src 'dmz'
option src_ip '{{ hostvars['dns1'].proxmox_net0.ip6 | ansible.utils.ipaddr('address') }}'
list proto 'tcp'
list proto 'udp'
option dest 'wan'
option dest_port '53'
option dest_ip '{{ hostvars['ks3370405'].ansible_default_ipv6.address }}'
option target 'ACCEPT'
option family 'ipv6'
# Allow mail traffic # Allow mail traffic
config rule config rule
option name 'Allow-OUTPUT-SMTP' option name 'Allow-OUTPUT-SMTP'

View File

@@ -4,7 +4,7 @@ myhostname = mail-relay.mateu.be
myorigin = $myhostname myorigin = $myhostname
mydestination = $myhostname, localhost.$mydomain, localhost mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550 unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8, [::1]/128, 82.66.135.228, 80.67.179.200 mynetworks = 127.0.0.0/8, [::1]/128, {{ global_smtp_relay_allowed_ips | join(', ') }}
sendmail_path = /usr/bin/sendmail sendmail_path = /usr/bin/sendmail
newaliases_path = /usr/bin/newaliases newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq mailq_path = /usr/bin/mailq

View File

@@ -34,6 +34,11 @@
src: "{{ item }}" src: "{{ item }}"
loop: "{{ ufw_allowed_smtp_ips }}" loop: "{{ ufw_allowed_smtp_ips }}"
- name: Allow incoming DNS
community.general.ufw:
rule: allow
port: domain
- name: Set logging - name: Set logging
community.general.ufw: community.general.ufw:
logging: "on" logging: "on"