summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-22 08:40:21 +0200
committerGitHub <noreply@github.com>2023-07-22 08:40:21 +0200
commit266a4cacf615549b9b8654808380ab3e9fb04953 (patch)
tree8d963cb8f6ec8d10b7edccf81b4a7b8f51b5ced7 /data
parente4ab616ba826c93896d18c4d49e0f26a47f90c76 (diff)
parentcd6f7994a9c5d6501ce56b57362c7f33f64fa3d5 (diff)
downloadvyos-1x-266a4cacf615549b9b8654808380ab3e9fb04953.tar.gz
vyos-1x-266a4cacf615549b9b8654808380ab3e9fb04953.zip
Merge pull request #2101 from sever-sever/T5354
sshguard: T5354: Add service ssh dynamic-protection
Diffstat (limited to 'data')
-rw-r--r--data/templates/ssh/sshguard_config.tmpl27
-rw-r--r--data/templates/ssh/sshguard_whitelist.tmpl7
2 files changed, 34 insertions, 0 deletions
diff --git a/data/templates/ssh/sshguard_config.tmpl b/data/templates/ssh/sshguard_config.tmpl
new file mode 100644
index 000000000..fbcbac908
--- /dev/null
+++ b/data/templates/ssh/sshguard_config.tmpl
@@ -0,0 +1,27 @@
+### Autogenerated by ssh.py ###
+
+{% if dynamic_protection is defined and dynamic_protection is not none %}
+# Full path to backend executable (required, no default)
+BACKEND="/usr/lib/x86_64-linux-gnu/sshg-fw-nft-sets"
+
+# Shell command that provides logs on standard output. (optional, no default)
+# Example 1: ssh and sendmail from systemd journal:
+LOGREADER="LANG=C journalctl -afb -p info -n1 -t sshd -o cat"
+
+#### OPTIONS ####
+# Block attackers when their cumulative attack score exceeds THRESHOLD.
+# Most attacks have a score of 10. (optional, default 30)
+THRESHOLD={{ dynamic_protection.threshold }}
+
+# Block attackers for initially BLOCK_TIME seconds after exceeding THRESHOLD.
+# Subsequent blocks increase by a factor of 1.5. (optional, default 120)
+BLOCK_TIME={{ dynamic_protection.block_time }}
+
+# Remember potential attackers for up to DETECTION_TIME seconds before
+# resetting their score. (optional, default 1800)
+DETECTION_TIME={{ dynamic_protection.detect_time }}
+
+# IP addresses listed in the WHITELIST_FILE are considered to be
+# friendlies and will never be blocked.
+WHITELIST_FILE=/etc/sshguard/whitelist
+{% endif %}
diff --git a/data/templates/ssh/sshguard_whitelist.tmpl b/data/templates/ssh/sshguard_whitelist.tmpl
new file mode 100644
index 000000000..c972ec343
--- /dev/null
+++ b/data/templates/ssh/sshguard_whitelist.tmpl
@@ -0,0 +1,7 @@
+### Autogenerated by ssh.py ###
+
+{% if dynamic_protection.allow_from is defined and dynamic_protection.allow_from is not none %}
+{% for address in dynamic_protection.allow_from %}
+{{ address }}
+{% endfor %}
+{% endif %}