Compare commits

..

3 Commits

Author SHA1 Message Date
66750c8b6c roles/common: minor configuration of Debian 13 SSH
Tweak some of the new OpenSSH per-source penalty settings on Debian
13. For now only adjusting the source network masks and reusing the
list of IPs to exempt from fail2ban.

These being built in makes them easier to use, but I think I will
end up sticking with fail2ban for the heavy lifting because it per-
sists across restarts of the daemon, whereas OpenSSH's doesn't. I
will monitor OpenSSH on Debian 13 to see how to best use it along
side fail2ban.
2025-09-22 22:26:09 +03:00
c063d3b3c7 roles/common: use 127.0.0.0/8 for fail2ban ignoreip
We can re-use our fail2ban ignoreip setting for Debian 13's OpenSSH
PerSourcePenaltyExemptList, but OpenSSH is more strict with regards
to masks not being applied to the host portion. I had never noticed
that fail2ban's default was applying the mask on the host portion!
2025-09-22 22:19:37 +03:00
6124a0bc49 roles/common: sshd overrides for Debian 13 2025-09-21 23:27:28 +03:00
12 changed files with 17 additions and 17 deletions

View File

@@ -3,7 +3,7 @@
# I'm currently not sure when we need to restart versus reload # I'm currently not sure when we need to restart versus reload
- name: reload caddy - name: reload caddy
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: caddy name: caddy
state: reloaded state: reloaded

View File

@@ -2,7 +2,7 @@
# ansible.builtin.file: roles/common/handlers/main.yml # ansible.builtin.file: roles/common/handlers/main.yml
- name: Reload sshd - name: Reload sshd
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: "{{ sshd_service_name }}" name: "{{ sshd_service_name }}"
state: reloaded state: reloaded
@@ -10,11 +10,11 @@
ansible.builtin.command: sysctl -p /etc/sysctl.conf ansible.builtin.command: sysctl -p /etc/sysctl.conf
- name: Reload systemd - name: Reload systemd
ansible.builtin.systemd_service: ansible.builtin.systemd:
daemon_reload: true daemon_reload: true
- name: Restart nftables - name: Restart nftables
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: nftables name: nftables
state: restarted state: restarted
@@ -22,6 +22,6 @@
# in the order they are defined, not in the order they are listed in the task's # in the order they are defined, not in the order they are listed in the task's
# notify statement and we must restart fail2ban after updating the firewall. # notify statement and we must restart fail2ban after updating the firewall.
- name: Restart fail2ban - name: Restart fail2ban
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: fail2ban name: fail2ban
state: restarted state: restarted

View File

@@ -47,7 +47,7 @@
- Restart fail2ban - Restart fail2ban
- name: Start and enable fail2ban service - name: Start and enable fail2ban service
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: fail2ban name: fail2ban
state: started state: started
enabled: true enabled: true

View File

@@ -76,11 +76,11 @@
# need to reload to pick up service/timer/environment changes # need to reload to pick up service/timer/environment changes
- name: Reload systemd daemon - name: Reload systemd daemon
when: nftables_systemd_units is changed when: nftables_systemd_units is changed
ansible.builtin.systemd_service: # noqa no-handler ansible.builtin.systemd: # noqa no-handler
daemon_reload: true daemon_reload: true
- name: Start and enable nftables update timers - name: Start and enable nftables update timers
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: "{{ item }}" name: "{{ item }}"
state: started state: started
enabled: true enabled: true
@@ -88,7 +88,7 @@
- update-firehol-nftables.timer - update-firehol-nftables.timer
- name: Start and enable nftables - name: Start and enable nftables
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: nftables name: nftables
state: started state: started
enabled: true enabled: true

View File

@@ -22,7 +22,7 @@
- name: Start and enable systemd's NTP client - name: Start and enable systemd's NTP client
when: ansible_service_mgr == 'systemd' when: ansible_service_mgr == 'systemd'
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: systemd-timesyncd name: systemd-timesyncd
state: started state: started
enabled: true enabled: true

View File

@@ -1,6 +1,6 @@
--- ---
- name: restart mariadb - name: restart mariadb
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: mariadb name: mariadb
state: restarted state: restarted

View File

@@ -1,4 +1,4 @@
--- ---
# ansible.builtin.file: roles/munin/handlers/main.yml # ansible.builtin.file: roles/munin/handlers/main.yml
- name: restart munin-node - name: restart munin-node
ansible.builtin.systemd_service: name=munin-node state=restarted ansible.builtin.systemd: name=munin-node state=restarted

View File

@@ -26,7 +26,7 @@
- restart munin-node - restart munin-node
- name: Start munin-node - name: Start munin-node
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: munin-node name: munin-node
state: started state: started
enabled: true enabled: true

View File

@@ -1,6 +1,6 @@
--- ---
- name: Reload nginx - name: Reload nginx
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: nginx name: nginx
state: reloaded state: reloaded

View File

@@ -82,7 +82,7 @@
# always issues daemon-reload just in case the service/timer changed # always issues daemon-reload just in case the service/timer changed
- name: Start and enable systemd timer to renew Let's Encrypt certs - name: Start and enable systemd timer to renew Let's Encrypt certs
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: renew-letsencrypt.timer name: renew-letsencrypt.timer
state: started state: started
enabled: true enabled: true

View File

@@ -119,7 +119,7 @@
tags: nginx tags: nginx
- name: Start and enable nginx service - name: Start and enable nginx service
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: nginx name: nginx
state: started state: started
enabled: true enabled: true

View File

@@ -1,7 +1,7 @@
--- ---
# For Debian 12 # For Debian 12
- name: Reload php8.2-fpm - name: Reload php8.2-fpm
ansible.builtin.systemd_service: ansible.builtin.systemd:
name: php8.2-fpm name: php8.2-fpm
state: reloaded state: reloaded