SoylentNews
SoylentNews is people
https://soylentnews.org/

Title    OpenSSH Introduces Options to Penalize Undesirable Behavior
Date    Tuesday June 11, @11:31AM
Author    janrinok
Topic   
from the raise-shields-and-return-fire dept.
https://soylentnews.org/article.pl?sid=24/06/10/1517206

upstart writes:

OpenSSH introduces options to penalize undesirable behavior:

In a recent commit, Damien Miller (djm@) introduced the new sshd(8) configurations options, PerSourcePenalties and PerSourcePenaltyExemptList, to provide a built in facility in sshd(8) itself to penalize undesirable behavior, and to shield specific clients from penalty, respectively.

The commit message reads,

List: openbsd-cvs Subject: CVS: cvs.openbsd.org: src From: Damien Miller <djm () cvs ! openbsd ! org Date: 2024-06-06 17:15:26 CVSROOT: /cvs Module name: src Changes by: djm@cvs.openbsd.org 2024/06/06 11:15:26 Modified files: usr.bin/ssh : misc.c misc.h monitor.c monitor_wrap.c servconf.c servconf.h srclimit.c srclimit.h sshd-session.c sshd.c sshd_config.5 Log message: Add a facility to sshd(8) to penalise particular problematic client behaviours, controlled by two new sshd_config(5) options: PerSourcePenalties and PerSourcePenaltyExemptList.

When PerSourcePenalties are enabled, sshd(8) will monitor the exit status of its child pre-auth session processes. Through the exit status, it can observe situations where the session did not authenticate as expected. These conditions include when the client repeatedly attempted authentication unsucessfully (possibly indicating an attack against one or more accounts, e.g. password guessing), or when client behaviour caused sshd to crash (possibly indicating attempts to exploit sshd). When such a condition is observed, sshd will record a penalty of some duration (e.g. 30 seconds) against the client's address. If this time is above a minimum threshold specified by the PerSourcePenalties, then connections from the client address will be refused (along with any others in the same PerSourceNetBlockSizeCIDR range). Repeated offenses by the same client address will accrue greater penalties, up to a configurable maximum. A PerSourcePenaltyExemptList option allows certain address ranges to be exempt from all penalties. We hope these options will make it significantly more difficult for attackers to find accounts with weak/guessable passwords or exploit bugs in sshd(8) itself. PerSourcePenalties is off by default, but we expect to enable it automatically in the near future.

This new facility comes in addition to the already well known and loved pf.confstate tracking options, and is for now available only in OpenBSD-current, but is almost certainly to be available in the upcoming OpenBSD 7.6 release.

At first we were wondering whether these options would be enabled by default before the new release. We did not have to wait long. This subsequent commit settled the issue:

List: openbsd-cvs Subject: CVS: cvs.openbsd.org: src From: Damien Miller <djm () cvs ! openbsd ! org Date: 2024-06-06 20:25:48 CVSROOT: /cvs Module name: src Changes by: djm@cvs.openbsd.org 2024/06/06 14:25:48 Modified files: usr.bin/ssh : servconf.c Log message: enable PerSourcePenalties by default. ok markus NB. if you run a sshd that accepts connections from behind large NAT blocks, proxies or anything else that aggregates many possible users behind few IP addresses, then this change may cause legitimate traffic to be denied. Please read the PerSourcePenalties, PerSourcePenaltyExemptList and PerSourceNetBlockSize options in sshd_config(5) for how to tune your sshd(8) for your specific circumstances.

So now we know: starting with OpenBSD 7.6, PerSourcePenalties will be enabled by default, and admins who do not themselves run PF or other network translation mechanisms will need to keep the consequences of inconsiderate NAT use in mind.


Original Submission

Links

  1. "upstart" - https://soylentnews.org/~upstart/
  2. "OpenSSH introduces options to penalize undesirable behavior" - https://undeadly.org/cgi?action=article;sid=20240607042157
  3. "commit" - https://marc.info/?l=openbsd-cvs&m=171769392207688&w=2
  4. "sshd(8)" - https://man.openbsd.org/sshd
  5. "PerSourcePenalties" - https://man.openbsd.org/sshd_config.5#PerSourcePenalties
  6. "PerSourcePenaltyExemptList" - https://man.openbsd.org/sshd_config.5#PerSourcePenaltyExemptList
  7. "sshd_config(5)" - https://man.openbsd.org/sshd_config
  8. "PerSourcePenalties" - https://man.openbsd.org/sshd_config#PerSourcePenalties
  9. "PerSourcePenaltyExemptList" - https://man.openbsd.org/sshd_config#PerSourcePenaltyExemptList
  10. "PerSourceNetBlockSize" - https://man.openbsd.org/sshd_config.5#PerSourceNetBlockSize
  11. "pf.confstate tracking options" - https://man.openbsd.org/pf.conf#Stateful_Tracking_Options
  12. "OpenBSD" - https://www.openbsd.org/
  13. "subsequent commit" - https://marc.info/?l=openbsd-cvs&m=171770534714766&w=2
  14. "Original Submission" - https://soylentnews.org/submit.pl?op=viewsub&subid=63001

© Copyright 2024 - SoylentNews, All Rights Reserved

printed from SoylentNews, OpenSSH Introduces Options to Penalize Undesirable Behavior on 2024-06-17 06:46:34