Enhanced security feature added to OpenSSH to defend against password guessing attacks

To the OpenSSH codebase added built-in protection against automated password guessing attacks, during which bots try to guess the user’s password by trying various standard combinations. To block such attacks, the PerSourcePenalties parameter has been added to the sshd_config configuration file, which allows you to define a blocking threshold that is triggered when there are a large number of unsuccessful connection attempts from the same IP address. The new security mechanism will be included in the next release of OpenSSH and will enabled by default in OpenBSD 7.6.

When security is enabled, the sshd process begins to monitor the termination status of child processes, identifying situations when authentication failed or when a process was terminated abnormally due to a failure. A high rate of authentication failures indicates attempts to guess passwords, and crashes may indicate attempts to exploit vulnerabilities in sshd.

The PerSourcePenalties parameter specifies the minimum threshold of abnormal events, after exceeding which the IP address for which suspicious activity has been recorded will be blocked. Using the PerSourceNetBlockSize parameter, you can additionally define a subnet mask to block the entire subnet to which the problematic IP belongs.

To disable blocking for individual subnets, the PerSourcePenaltyExemptList parameter has been proposed, which can be useful in situations leading to false positives, for example, when the SSH server is accessed from a large network, requests from different users from which come from the same IP due to the use of a translator addresses or proxies.

Thanks for reading: