Skip to content

Instantly share code, notes, and snippets.

@tbaschak
Created August 18, 2014 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbaschak/56009937fb7782f69f0a to your computer and use it in GitHub Desktop.
Save tbaschak/56009937fb7782f69f0a to your computer and use it in GitHub Desktop.
fail2ban:
pkg:
- installed
service:
- running
- require:
- pkg: fail2ban
- watch:
- file: /etc/fail2ban/jail.local
/etc/fail2ban/jail.local:
file:
- managed
{% if 'iredmail' in grains['roles'] %}
- source: salt://settings/fail2ban/mail-jail.local
{% else %}
- source: salt://settings/fail2ban/jail.local
{% endif %}
- require:
- pkg: fail2ban
{% if 'iredmail' in grains['roles'] %}
/etc/fail2ban/filter.d/postfix-sasl.conf:
file:
- managed
- source: salt://settings/fail2ban/mail/filter.d/postfix-sasl.conf
- require:
- pkg: fail2ban
/etc/fail2ban/filter.d/dovecot.conf:
file:
- managed
- source: salt://settings/fail2ban/mail/filter.d/dovecot.conf
- require:
- pkg: fail2ban
/etc/fail2ban/filter.d/roundcube-auth.conf:
file:
- managed
- source: salt://settings/fail2ban/mail/filter.d/roundcube-auth.conf
- require:
- pkg: fail2ban
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment