From nobody Wed Apr 19 05:41:51 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q1V680s8Bz451Ml for ; Wed, 19 Apr 2023 05:41:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q1V673MT3z40vR for ; Wed, 19 Apr 2023 05:41:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681882911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c6LdlKbHAb/I1GyUCVDUUfVumKh/NjYrD4PgQSmIuHU=; b=BJkCtxmIF045cYAJG8+6Z8xznORjFkNmpMopoB1V1IeeYbeCEm57/WmHK9EWQ1bloWeeyC KGxgNbJfzmz2Hxq/eE/9zU7c7NGwJ4r3anrSb/L2nD0KLfQofFPIUEPgDNTgYkuBAm3rxA kSPI94SzriOPJvtAd9jwWgFKkQyS+0wIrAsxiNVM21IffCRSOcZR0jVTs7EWN9ac5xdVAg pGB4ShzqHx2d8/3faiyCC3BZn4v2L88pKylgVcMf6xO96bM7VYPOSy6rLOGHGOstKMx2gq leeDGFnmadlCR2//iTFszCSCE9zm09sImsP7L+jfpLVZI/SQbBdc2kNv4j/PtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681882911; a=rsa-sha256; cv=none; b=p3130ulnLH7qaSbQEfpbQehji/6CrKc2SAkkFwEjDDiJfN2ulZAE5Q8jbRGHEHT40mDX3x n/jcfNeKhB6L+i9thUN25u51012mDeIBNR3+QL3w/ahTZq5aIsxfPBFMUqErsbLlHa9YJi IfGuWSmeIVHMU20J4QiawTuX9gq+eurU+sIDdIQ8b0WVnyqHo8OIFUUHJfhx2i0yNy/lf1 iQZp1Qe4et7yf1GoLpOJhaRTognbRid1xqMN0zrZXIQZqJVx9PpaZ2FK5IqGYKkDTtVJp4 4CSONp6e+iuzStwiNkkg/H11r32NzvIzwlbipd6Y8Kzby6orkTr9POs2wHEXGQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q1V672BF4zj9L for ; Wed, 19 Apr 2023 05:41:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 33J5fpLB075765 for ; Wed, 19 Apr 2023 05:41:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 33J5fpcV075764 for bugs@FreeBSD.org; Wed, 19 Apr 2023 05:41:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 270928] Blacklistd does not handle SSHD failed logins Date: Wed, 19 Apr 2023 05:41:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bc979@lafn.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270928 Bug ID: 270928 Summary: Blacklistd does not handle SSHD failed logins Product: Base System Version: 13.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: bc979@lafn.org Created attachment 241577 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D241577&action= =3Dedit A patch to blacklistd to have BL_BADUSER handled as BL_ADD Blacklistd with SSHD does not work properly. To create the problem, config= ure /etc/ssh/sshd.config to enable UseBlacklistd. Then start Blacklistd. Use = ssh from another system to login with an invalid id and password. Try again.=20 Blacklistd should have locked you out. Check with "blacklistctl dump -a"=20 There will not be any entries. The problem is that sshd uses the type BL_BADUSER when calling blacklistd. The code in blacklistd.c says that this type is "ignore for now". The BL_BADUSER type was supposed to immediately block the IP on the first t= ime regardless of the configuration in /etc/blacklistd.conf. However, at this = time it never does anything. As a result the calling IP is never blocked. The simple solution is the attached patch. However, after some consideration, I believe that BL_BADUSER should always be handled as BL_ADD. The purpose of= the configuration file is to give the system administrator control over when callers are blocked. By sshd using BL_BADUSER, the configuration in the co= nfig file is never used. That will certainly confuse the administrator and remo= ves control over blocking from the administrator to the programmer who develops= the code that calls blacklistd. Having sshd block the IP after the first invalid id or password is not a gr= eat idea. A simple fat fingered user will be blocked for 24 hours after the fi= rst login attempt. It is not uncommon for there to be typos in login attempts.= =20 That is a severe penalty for the user. There is no way for the administrat= or to remove the entry from blacklistd (presuming the user can actually contact the administrator). The administrator can only remove the IP address from = the pf blocking table. That will "work" until something causes blacklistd to be restarted. On restart, blacklistd will reenable the block in pf. I believe that blacklistd should not override the administrator's configuration. --=20 You are receiving this mail because: You are the assignee for the bug.=