Skip to content

Commit

Permalink
Merge pull request #39 from myii/ci/use-fail2ban.ng-in-kitchen
Browse files Browse the repository at this point in the history
ci(kitchen): use `fail2ban.ng` in `state_top`
  • Loading branch information
myii authored Jan 10, 2020
2 parents d7d26f4 + 10b403f commit f7f12d0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion fail2ban/ng/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'group': 'root',
'mode': '644',
},
}, merge=salt['pillar.get']('fail2ban:lookup')) %}
}, merge=salt['pillar.get']('fail2ban:ng:lookup')) %}

{% set fail2ban = salt['pillar.get'](
'fail2ban:ng',
Expand Down
2 changes: 1 addition & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ suites:
base:
'*':
- misc.fake_log_files
- fail2ban
- fail2ban.ng
pillars:
top.sls:
base:
Expand Down
36 changes: 21 additions & 15 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fail2ban:
filter: sshd
logpath: /var/log/auth.log
maxretry: 6
port: ssh
port: ssh
ignoreip: 127.0.0.1/8
ssh_ddos:
action: iptables[name=SSH, port=ssh, protocol=tcp]
Expand Down Expand Up @@ -46,14 +46,16 @@ fail2ban:
#
ng:
lookup:
prefix: '/opt'
package: 'fail2ban-new-package'
loglevel: ERROR
bantime: 600
maxretry: 3
backend: auto

# fail2ban.local
config:

# FTP-style
source_path: salt://path-to-fail2ban-file
# # FTP-style
# source_path: salt://path-to-fail2ban-file

# Template-style
loglevel: ERROR
Expand All @@ -62,8 +64,8 @@ fail2ban:
# jail.local
jails:

# FTP-style
source_path: salt://path-to-jail-file
# # FTP-style
# source_path: salt://path-to-jail-file

# Template-style
DEFAULT:
Expand Down Expand Up @@ -99,10 +101,12 @@ fail2ban:
actionban: csf -d <ip> Added by Fail2Ban for <name>
actionunban: csf -dr <ip>

# FTP-style
test-action:
config:
source_path: salt://path-to-action-file
# yamllint disable rule:comments-indentation
# # FTP-style
# test-action:
# config:
# source_path: salt://path-to-action-file
# yamllint enable rule:comments-indentation

# filter.d
filters:
Expand All @@ -116,7 +120,9 @@ fail2ban:
Definition:
failregex: <HOST>.*(GET|POST).*(\.php|\.asp|\.exe|\.pl|\.cgi|\.scgi).*

# FTP-style
test-filter:
config:
source_path: salt://path-to-filter-file
# yamllint disable rule:comments-indentation
# # FTP-style
# test-filter:
# config:
# source_path: salt://path-to-filter-file
# yamllint enable rule:comments-indentation

0 comments on commit f7f12d0

Please sign in to comment.