Compare commits
3 Commits
892033b880
...
38c333045b
Author | SHA1 | Date | |
---|---|---|---|
38c333045b
|
|||
d4ede33099
|
|||
0bad75788d
|
@ -14,7 +14,7 @@
|
|||||||
apt: pkg={{ debian_firewall_packages }} state=present
|
apt: pkg={{ debian_firewall_packages }} state=present
|
||||||
|
|
||||||
- name: Use iptables backend in firewalld
|
- name: Use iptables backend in firewalld
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
when: ansible_distribution_major_version is version('10', '==')
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/firewalld/firewalld.conf
|
dest: /etc/firewalld/firewalld.conf
|
||||||
regexp: '^FirewallBackend=nftables$'
|
regexp: '^FirewallBackend=nftables$'
|
||||||
@ -26,7 +26,7 @@
|
|||||||
# backend. Using individual calls seems to work around it.
|
# backend. Using individual calls seems to work around it.
|
||||||
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931722
|
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931722
|
||||||
- name: Use individual iptables calls
|
- name: Use individual iptables calls
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
when: ansible_distribution_major_version is version('10', '==')
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/firewalld/firewalld.conf
|
dest: /etc/firewalld/firewalld.conf
|
||||||
regexp: '^IndividualCalls=no$'
|
regexp: '^IndividualCalls=no$'
|
||||||
@ -50,6 +50,31 @@
|
|||||||
loop:
|
loop:
|
||||||
- abusers-ipv4.xml
|
- abusers-ipv4.xml
|
||||||
- abusers-ipv6.xml
|
- abusers-ipv6.xml
|
||||||
|
- spamhaus-ipv4.xml
|
||||||
|
- spamhaus-ipv6.xml
|
||||||
|
notify:
|
||||||
|
- restart firewalld
|
||||||
|
|
||||||
|
- name: Copy Spamhaus update script
|
||||||
|
when: ansible_distribution_version is version('9', '>=')
|
||||||
|
copy: src=update-spamhaus-lists.sh dest=/usr/local/bin/update-spamhaus-lists.sh mode=0755 owner=root group=root
|
||||||
|
|
||||||
|
- name: Copy Spamhaus systemd units
|
||||||
|
when: ansible_distribution_version is version('9', '>=')
|
||||||
|
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} mode=0644 owner=root group=root
|
||||||
|
loop:
|
||||||
|
- update-spamhaus-lists.service
|
||||||
|
- update-spamhaus-lists.timer
|
||||||
|
register: spamhaus_systemd_units
|
||||||
|
|
||||||
|
# need to reload to pick up service/timer/environment changes
|
||||||
|
- name: Reload systemd daemon
|
||||||
|
systemd: daemon_reload=yes
|
||||||
|
when: spamhaus_systemd_units is changed
|
||||||
|
|
||||||
|
- name: Start and enable Spamhaus update timer
|
||||||
|
when: ansible_distribution_version is version('9', '>=')
|
||||||
|
systemd: name=update-spamhaus-lists.timer state=started enabled=yes
|
||||||
notify:
|
notify:
|
||||||
- restart firewalld
|
- restart firewalld
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
- block:
|
- block:
|
||||||
- name: Configure apt mirror
|
- name: Configure apt mirror
|
||||||
template: src=sources.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644
|
template: src=sources.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644
|
||||||
|
when: ansible_architecture != 'armv7l'
|
||||||
|
|
||||||
- name: Set fact for base packages
|
- name: Set fact for base packages
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -123,5 +123,16 @@ Subsystem sftp /usr/lib/openssh/sftp-server
|
|||||||
# PermitTTY no
|
# PermitTTY no
|
||||||
# ForceCommand cvs server
|
# ForceCommand cvs server
|
||||||
|
|
||||||
|
# Based on the ssh-audit profile for OpenSSH 8.4, but with but with all algos
|
||||||
|
# with less than 256 bits removed, as NSA's Suite B removed them years ago and
|
||||||
|
# the new (2018) CNSA suite is 256 bits and up.
|
||||||
|
#
|
||||||
|
# See: https://github.com/jtesta/ssh-audit/blob/master/src/ssh_audit/policy.py
|
||||||
|
# See: https://en.wikipedia.org/wiki/Commercial_National_Security_Algorithm_Suite
|
||||||
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
|
||||||
|
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
|
||||||
|
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
|
||||||
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
|
||||||
|
|
||||||
# only allow shell access by provisioning user
|
# only allow shell access by provisioning user
|
||||||
AllowUsers {{ provisioning_user.name }}
|
AllowUsers {{ provisioning_user.name }}
|
||||||
|
Reference in New Issue
Block a user