From 38be6c13f76e893cf47636257071b440dec0c5b2 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sun, 7 Sep 2025 17:32:13 +0200 Subject: initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- bundles/fail2ban/items.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 bundles/fail2ban/items.py (limited to 'bundles/fail2ban/items.py') diff --git a/bundles/fail2ban/items.py b/bundles/fail2ban/items.py new file mode 100644 index 0000000..9627587 --- /dev/null +++ b/bundles/fail2ban/items.py @@ -0,0 +1,31 @@ +if node.os != "alpine": + raise BundleError(f"{node.name}: OS {node.os} is not supported.") + +from os.path import join + +svc_openrc = { + "fail2ban": { + "enabled": True, + "running": True, + "needs": { + "pkg_apk:fail2ban", + "bundle:firewall", + "bundle:tgnotify", + }, + }, +} + +files = { +} + +repo.libs.gen.add_files_recursive( + files, + join(repo.path, "bundles", "fail2ban", "files"), + { + "triggers": { + "svc_openrc:fail2ban:restart", + }, + }, +) + +# TODO: metrics? https://github.com/hectorjsmith/fail2ban-prometheus-exporter -- cgit 1.4.1