| Current Path : /proc/self/root/proc/self/root/proc/self/root/opt/cpguard/cpglfd/configs/jails.available/ |
| Current File : //proc/self/root/proc/self/root/proc/self/root/opt/cpguard/cpglfd/configs/jails.available/ssh.yaml |
jails:
- name: "ssh-multi"
enabled: true
log_paths:
# ubuntu/debian based distros
- "/var/log/auth.log"
# fedora/centos/rhel based distros
- "/var/log/secure"
# - "/tmp/goguard_test"
# ?? RULES LIST (List of Objects)
rules:
# Rule 1: Standard Password Failure (Inherits global max_retries: 3)
- regexp: "Failed password for .* from (?P<ip>\\d+\\.\\d+\\.\\d+\\.\\d+)"
# Rule 2: Invalid User (Stricter: Override to 2 retries)
- regexp: "Invalid user .* from (?P<ip>\\d+\\.\\d+\\.\\d+\\.\\d+)"
max_retries: 2
# Rule 3: Disconnected Preauth
- regexp: "Disconnected from (?P<ip>\\d+\\.\\d+\\.\\d+\\.\\d+) .* \\[preauth\\]"
# Rule 4: Connection Closed Preauth
- regexp: "Connection closed by (authenticating user \\S+ )?(?P<ip>\\d+\\.\\d+\\.\\d+\\.\\d+).* \\[preauth\\]"
# Rule 5: Max Attempts Exceeded
- regexp: "error: maximum authentication attempts exceeded for .* from (?P<ip>\\d+\\.\\d+\\.\\d+\\.\\d+)"
# ?? GLOBAL DEFAULTS (For this jail)
max_retries: 3
find_time: "1m"
ban_time: "1h"
# ?? ACTIONS (Must be a list of objects to match your Struct)
actions:
- name: "cpgblock-ssh"
# Standard SSH port 22 block
ban_command: '/usr/bin/cpgcli ip --temp-block {{.IP}} --reason "Blocked by {{.JailName}} due to more than {{.MaxRetry}} abusive access within {{.FindTime}} seconds" --extra " LogFile: {{.LogPath}} | Reason: {{.LogLine}}"'
unban_command: "/usr/bin/cpgcli ip --temp-block {{.IP}} --remove"