diff --git a/templates/concat/jail.local-stanza.erb b/templates/concat/jail.local-stanza.erb index 3ebfb18..390aca7 100644 --- a/templates/concat/jail.local-stanza.erb +++ b/templates/concat/jail.local-stanza.erb @@ -1,24 +1,24 @@ ################## -[<%= real_jailname %>] -enabled = <%= real_status %> -<% if real_filter != '' -%> -filter = <%= real_filter %> +[<%= @real_jailname %>] +enabled = <%= @real_status %> +<% if @real_filter != '' -%> +filter = <%= @real_filter %> <% end -%> -<% if array_port != [] -%> -port = <%= array_port * ',' %> +<% if @array_port != [] -%> +port = <%= @array_port * ',' %> <% end -%> -<% if array_action != [] -%> -action = <% array_action.each do |a| -%> +<% if @array_action != [] -%> +action = <% @array_action.each do |a| -%> <%= a %> <% end -%> <% end -%> -<% if real_logpath != '' -%> -logpath = <%= real_logpath %> +<% if @real_logpath != '' -%> +logpath = <%= @real_logpath %> <% end -%> -<% if real_maxretry != '' -%> -maxretry = <%= real_maxretry %> +<% if @real_maxretry != '' -%> +maxretry = <%= @real_maxretry %> <% end -%> -<% if real_bantime != '' -%> -bantime = <%= real_bantime %> +<% if @real_bantime != '' -%> +bantime = <%= @real_bantime %> <% end -%> diff --git a/templates/jail.local.erb b/templates/jail.local.erb index 6a866c9..02a1242 100644 --- a/templates/jail.local.erb +++ b/templates/jail.local.erb @@ -11,7 +11,7 @@ enabled = <%= scope.lookupvar('fail2ban::array_jails').include? "imap" %> filter = dovecot action = iptables[name=IMAP, port=imap, protocol=tcp] <% unless scope.lookupvar('fail2ban::mailto').empty? -%> - sendmail-whois[name=POP3, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= fqdn %>] + sendmail-whois[name=POP3, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= @fqdn %>] <% end -%> logpath = /var/log/maillog maxretry = 5 @@ -21,7 +21,7 @@ enabled = <%= scope.lookupvar('fail2ban::array_jails').include? "pop3" %> filter = mail action = iptables[name=POP3, port=pop3, protocol=tcp] <% unless scope.lookupvar('fail2ban::mailto').empty? -%> - sendmail-whois[name=POP3, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= fqdn %>] + sendmail-whois[name=POP3, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= @fqdn %>] <% end -%> logpath = /var/log/maillog maxretry = 5 @@ -31,7 +31,7 @@ enabled = <%= scope.lookupvar('fail2ban::array_jails').include? "ssh" %> filter = sshd action = iptables[name=SSH, port=ssh, protocol=tcp] <% unless scope.lookupvar('fail2ban::mailto').empty? -%> - sendmail-whois[name=SSH, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= fqdn %>] + sendmail-whois[name=SSH, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= @fqdn %>] <% end -%> <% if @operatingsystem == "Debian" -%> logpath = /var/log/auth.log @@ -45,7 +45,7 @@ enabled = <%= scope.lookupvar('fail2ban::array_jails').include? "vsftpd" %> filter = vsftpd action = iptables[name=VSFTPD, port=ftp, protocol=tcp] <% unless scope.lookupvar('fail2ban::mailto').empty? -%> - sendmail-whois[name=VSFTPD, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= fqdn %>] + sendmail-whois[name=VSFTPD, dest=<%= scope.lookupvar('fail2ban::mailto') %>, sender=fail2ban@<%= @fqdn %>] <% end -%> logpath = /var/log/vsftpd.log maxretry = 5 diff --git a/templates/spec.erb b/templates/spec.erb index 87b8c1e..0e81074 100644 --- a/templates/spec.erb +++ b/templates/spec.erb @@ -4,5 +4,5 @@ <%= scope.to_hash.reject { |k,v| !( k.is_a?(String) && v.is_a?(String) ) }.to_yaml %> # Custom Options -<%= options['opt_a'] %> -<%= options['opt_b'] %> +<%= @options['opt_a'] %> +<%= @options['opt_b'] %>