This repository has been archived on 2023-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
salt-states_old/fail2ban/jails.sls

39 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-03-27 14:05:34 +00:00
# SSH
2023-03-27 10:16:22 +00:00
configure sshd jail:
file.managed:
- name: /etc/fail2ban/jail.d/sshd.local
- source: salt://fail2ban/files/jail.d/sshd.local
- user: root
- group: root
- mode: "0644"
- onlyif:
- pkg.is_installed: openssh
2023-03-27 14:05:34 +00:00
# Nextcloud
configure nextcloud jail:
file.managed:
- name: /etc/fail2ban/jail.d/nextcloud.local
- source: salt://fail2ban/files/jail.d/nextcloud.local
- user: root
- group: root
- mode: "0644"
- onlyif: runuser -l {{ salt['pillar.get']('podman:user', 'root') }} -c 'podman container exists gitea'
2023-03-27 10:16:22 +00:00
2023-03-27 14:05:34 +00:00
configure nextcloud filter:
file.managed:
- name: /etc/fail2ban/filter.d/nextcloud.local
- source: salt://fail2ban/files/filter.d/nextcloud.local
- user: root
- group: root
- mode: "0644"
- onlyif: runuser -l {{ salt['pillar.get']('podman:user', 'root') }} -c 'podman container exists gitea'
2023-03-27 10:16:22 +00:00
2023-03-27 14:05:34 +00:00
######
2023-03-27 10:16:22 +00:00
realod fail2ban config:
cmd.run:
- name: fail2ban-client reload
- onchanges:
- file: configure sshd jail
2023-03-27 14:05:34 +00:00
- file: configure nextcloud jail
- file: configure nextcloud filter