From 123e38b970c6b58e2614fe39f7889cf1e29527f0 Mon Sep 17 00:00:00 2001 From: Oxbian Date: Fri, 28 Apr 2023 19:03:32 +0200 Subject: Adding Fail2Ban monitoring / matrix message --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 01efaa9..ae382eb 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Thanks to those commands you will be able to get the last update without losing ## Logwatch -First you need to configure matrix-sender, I recommand you to check the repo [matrix-sender](https://github.com/Oxbian/matrix-sender). +First you need to configure matrix-sender, I recommend you to check the repo [matrix-sender](https://github.com/Oxbian/matrix-sender). After that you need to edit `logwatch.sh` to add the `matrix.sh` absolute path. @@ -61,6 +61,23 @@ After that you will need to add those lines in your pam configuration `/etc/pam. session optional pam_exec.so seteuid /etc/ssh/login-notify.sh ``` +## Fail2Ban + +First you need to configure matrix-sender, I recommend you to check the repo [matrix-sender](https://github.com/Oxbian/matrix-sender). + +After that you need to edit `Fail2Ban/matrix.conf` and change the absolute path to your `matrix.sh` script. + +Once all this is done, you can copy the `jail.local` in your `jail.d` folder and `matrix.conf` in the `action.d` folder. + +```bash +sudo ln -sf "$(pwd)/Fail2Ban/jail.local" /etc/fail2ban/jail.d/jail.local +sudo ln -sf "$(pwd)/Fail2Ban/matrix.conf" /etc/fail2ban/action.d/matrix.conf +``` + +After that just restart the fail2ban service and check for errors, and if you have some, fix them. + +You will probably need to edit the jail.local script to your liking. + ## Contributing If you want to contribute, make a pull request with your contribution. -- cgit v1.2.3