From c4b78405fd353d9d34ffd56593e14d40d21d1d5c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 14 Feb 2020 16:29:49 +0000 Subject: [PATCH 1/1] Make fail2ban use the journal to monitor sshd --- cookbooks/fail2ban/recipes/default.rb | 8 ++++++++ .../fail2ban/templates/default/paths-overrides.local.erb | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 cookbooks/fail2ban/templates/default/paths-overrides.local.erb diff --git a/cookbooks/fail2ban/recipes/default.rb b/cookbooks/fail2ban/recipes/default.rb index a002fe131..6213a3814 100644 --- a/cookbooks/fail2ban/recipes/default.rb +++ b/cookbooks/fail2ban/recipes/default.rb @@ -27,6 +27,14 @@ template "/etc/fail2ban/jail.d/00-default.conf" do notifies :restart, "service[fail2ban]" end +template "/etc/fail2ban/paths-overrides.local" do + source "paths-overrides.local.erb" + owner "root" + group "root" + mode 0o644 + notifies :restart, "service[fail2ban]" +end + service "fail2ban" do action [:enable, :start] end diff --git a/cookbooks/fail2ban/templates/default/paths-overrides.local.erb b/cookbooks/fail2ban/templates/default/paths-overrides.local.erb new file mode 100644 index 000000000..7fbd19a79 --- /dev/null +++ b/cookbooks/fail2ban/templates/default/paths-overrides.local.erb @@ -0,0 +1,4 @@ +# DO NOT EDIT - This file is being maintained by Chef + +[DEFAULT] +sshd_backend = systemd -- 2.43.2