From owner-freebsd-questions@freebsd.org Thu Apr 23 19:05:35 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8163B2C08BA for ; Thu, 23 Apr 2020 19:05:35 +0000 (UTC) (envelope-from Norman.Gray@glasgow.ac.uk) Received: from hillend.cent.gla.ac.uk (hillend.cent.gla.ac.uk [130.209.16.102]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 497Rb23p29z4Chn for ; Thu, 23 Apr 2020 19:05:33 +0000 (UTC) (envelope-from Norman.Gray@glasgow.ac.uk) Received: from cas07.campus.gla.ac.uk ([130.209.14.164]) by hillend.cent.gla.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1jRhAB-0006RT-Qe for freebsd-questions@freebsd.org; Thu, 23 Apr 2020 20:05:31 +0100 Received: from cas07.campus.gla.ac.uk (130.209.14.164) by cas07.campus.gla.ac.uk (130.209.14.164) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Apr 2020 20:05:31 +0100 Received: from GBR01-LO2-obe.outbound.protection.outlook.com (104.47.21.56) by cas07.campus.gla.ac.uk (130.209.14.164) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 23 Apr 2020 20:05:31 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+/x8isKcqcSHp1z8qeuAA0RG6J/WjGJ5pP3ObirzkDjp+gXe2ZwFJ9776E7mcGyfoQ2FE/D6DbI5sowfwwSAT3mxWGhQCvhKQ/OQzuGn18kFh0zxWaKfAqa2bmpbIl4OuGVrFp7L19YjtX1HEIupexww1ny8NEaR/PM0iMd6hlJEJqqIx/R1PiH2UW6BNUMM9zaCz9yXjku63ZEHnjSLuTXfq8hvUwALCU78QvtK9I2eEscu7yNm8W/iC3fuQ36kMC9Oqg2/1jpGg5h7XEFLvzlxqY5bakNEug9KTyHU6V5Tb9MCOuFIRa7q0Z0frJjRwQtfTvTG40GP8QpkzHUcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BlKQZNYpJpZL89odjw/cxH209JN/PA078FHW64n7zbE=; b=Arv5hx/vI2kp5sJU01XlfyTJpQfc7I3kutmXRZPUPwjih5gyruM47HOXrr0J4Iep/RqEEDoUOQaURpVZFVgLkwUtqN0Mw6lZmMeMorTmQ1iobFQIojA3Godo9NZBSxp8RLtyv4uUv8KUip4FDuzmC/T2t8FXch5oMOBtBKzfTkvtn15HhUSDDKxE7Pw+oZ1GvVmBn8Xiq5J5lrHV4v6DdevF+rbBzHHBOxCASixshxxNK0MKJTsxJa/o3CNmBlj+Br10/e1Q01cJd4iKe+ZdNbiJ+8///PWU5yVJHCEVCvaYC/ANjDEY/u+YsDqyrnHP7nGIWGdmTtoIL3UncjQVIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=glasgow.ac.uk; dmarc=pass action=none header.from=glasgow.ac.uk; dkim=pass header.d=glasgow.ac.uk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gla.onmicrosoft.com; s=selector2-gla-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BlKQZNYpJpZL89odjw/cxH209JN/PA078FHW64n7zbE=; b=HnCb2zOD9cjDR4f5hpwbeOwI1Lk/IKvQvVJNYnQRW+aexD60I8587RdK/NF+NpOScafA+IK2ykfOyNFpAG0i4wPt+ORPlE9O2RF+sJ2lHs/56jdspW02jom+vzO1mvSbtPry/uyMahaM7geIiuaSfO90Rv8bkdHhHLHlt1p6WaI= Received: from CWXP265MB0149.GBRP265.PROD.OUTLOOK.COM (10.164.144.19) by CWXP265MB0184.GBRP265.PROD.OUTLOOK.COM (10.164.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 23 Apr 2020 19:05:30 +0000 Received: from CWXP265MB0149.GBRP265.PROD.OUTLOOK.COM ([fe80::40d7:744b:8734:b8dd]) by CWXP265MB0149.GBRP265.PROD.OUTLOOK.COM ([fe80::40d7:744b:8734:b8dd%6]) with mapi id 15.20.2921.032; Thu, 23 Apr 2020 19:05:30 +0000 From: "Norman Gray" To: FreeBSD Questions Mailing List Subject: Re: blacklistd: what does it detect? Date: Thu, 23 Apr 2020 20:05:28 +0100 X-Mailer: MailMate (1.13.1r5671) Message-ID: In-Reply-To: <701E0B01-CD41-4A95-9FAC-44D3ED711FCD@glasgow.ac.uk> References: <701E0B01-CD41-4A95-9FAC-44D3ED711FCD@glasgow.ac.uk> Content-Type: text/plain; format=flowed X-ClientProxiedBy: LO2P265CA0086.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::26) To CWXP265MB0149.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:8::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [130.209.33.158] (81.2.70.164) by LO2P265CA0086.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29 via Frontend Transport; Thu, 23 Apr 2020 19:05:30 +0000 X-Mailer: MailMate (1.13.1r5671) X-Originating-IP: [81.2.70.164] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15031225-828d-4fae-d81a-08d7e7b94abc X-MS-TrafficTypeDiagnostic: CWXP265MB0184: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-Forefront-PRVS: 03827AF76E X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CWXP265MB0149.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(366004)(39860400002)(346002)(136003)(66556008)(26005)(66574012)(66946007)(2616005)(81156014)(52116002)(956004)(2906002)(186003)(16526019)(8936002)(6706004)(86362001)(8676002)(478600001)(6916009)(66476007)(6486002)(786003)(16576012)(53546011)(36756003)(966005)(5660300002)(316002)(33656002)(78286006); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: glasgow.ac.uk does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: awILLr/m/IsC417EvPDc3K3H43MUmzYvNaNIxd/vDBj+QpDmy8iCKuLfUm1wbnqdxBnsNw3PiT4+Ao0Rmvwfggjy3doPqH4S/7N2rdSkIKIkyKaxurwYXQXeSF+B02iNyWPg9iVheTSq5tgEpvzw+muI3BXbw6d0fwFsF4lasbihPdFfl1vbmSsKCNmp9ceu0BYTdGZVRTsTQfFcBH4/V8OOkrVB/FK9K8tjOOU208mAM/OXOniTajRN8HjTN9449HHtxAo3mke5ftXlM8GjbTdmzuxvxXJ6WbFQx+2DRCCWV7YDj9SU3NbxkV9YwlGWtQJTkfmoI5qFMZOjIpeNx+iyFURdPjH9dXh21ynHKyvDXHcibjb5+xBHgxEy67zEKterorkIcfi208cwVRNdVvC3VjxtCkuSiUZj0LpU5gioAd3YWxAzzbdPpGojolhOXbK3QutVy6/X21r1Uv6vg/KMTXqJprQseyJSwhVhTw+bQZjXz4QdE/xhNGKOLNZeT3RmX437aB+xP1IvtoxCVMdZDhILHHCFVMeMTMp4AcJbrH3ZnuKTYFsJDWDIxlseOpKeyZga1j5YNYleWZor/w588zvzHaYtB5W8dF4RthQ= X-MS-Exchange-AntiSpam-MessageData: gqT22ueATj+zk2L0aBaAuUmo2YaN49Z0RGhcrAmmnDn6WlmzRRzEQpwwt4xpqR7PvV2bxyAKvWOSISbb4mJ4QQa+i4Nin6XNGsQDaHuwqrvoP2lGhBNVmGgiy2n3lMPHoO3LZYEOgzEavgOuuvpVHw== X-MS-Exchange-CrossTenant-Network-Message-Id: 15031225-828d-4fae-d81a-08d7e7b94abc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2020 19:05:30.6879 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6e725c29-763a-4f50-81f2-2e254f0133c8 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zWt0eu8bJxzjp5LsysC2JpMMr1oe9C1sGqKnGWzzxsXLDSRb2QPGJPm7XXFF1BnB4loPnvSBLx+akc0YpMFnn1BM1BvAAz+SFGLJX41IlZM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP265MB0184 X-OriginatorOrg: glasgow.ac.uk X-Rspamd-Queue-Id: 497Rb23p29z4Chn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gla.onmicrosoft.com header.s=selector2-gla-onmicrosoft-com header.b=HnCb2zOD; dmarc=none; spf=none (mx1.freebsd.org: domain of Norman.Gray@glasgow.ac.uk has no SPF policy when checking 130.209.16.102) smtp.mailfrom=Norman.Gray@glasgow.ac.uk X-Spamd-Result: default: False [-4.01 / 15.00]; RCVD_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gla.onmicrosoft.com:s=selector2-gla-onmicrosoft-com]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[102.16.209.130.rep.mailspike.net : 127.0.0.18]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[glasgow.ac.uk]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.01)[ipnet: 130.209.0.0/16(-4.61), asn: 786(-0.36), country: GB(-0.07)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[102.16.209.130.list.dnswl.org : 127.0.11.2]; DKIM_TRACE(0.00)[gla.onmicrosoft.com:+]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:786, ipnet:130.209.0.0/16, country:GB]; ARC_ALLOW(-1.00)[i=1]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2020 19:05:35 -0000 Greetings (again). On 23 Apr 2020, at 11:24, Norman Gray wrote: > On 20 Apr 2020, at 12:43, Norman Gray wrote: > > >> I've enabled blacklistd on a 12.1 machine accessible to the open >> internet, but it's not blocking as many failed ssh attempts as I >> expect. Am I misunderstanding something? > > > Is there documentation anywhere (outside of the source) of how > blacklistd and sshd interact? > > There seems to be very little correlation between what I find in > auth.log and what blacklistd is acting on, as reported by > blacklistctl. Addresses seem to be blocked which barely appear in the > log, and not blocked after making multiple appearances in one message > or another. I received an off-list pointer to (thank you!), which is a YouTube video of a good 2015 talk by the blacklistd developer, Christos Zoulas, talking about the design of the daemon. There's nothing here which isn't, really, in the other documentation in the FreeBSD manual and the various manpages, but it provides a very useful overview of the approach and goals, which has given me, at least, a much clearer idea of what blacklistd is and isn't doing. Basically: * blacklistd-supporting daemons, such as the sshd in FreeBSD, tell the blacklistd daemon 'consider blocking this IP' or 'this IP is OK', on the basis of some criterion compiled into that daemon (ie, there's nothing to configure here) * any other logging the (eg) sshd daemon does is for human information only, and may or may not straightforwardly correspond to what it said to the blacklistd daemon. Thus... > My immediate goal is to cut down noise in the 'daily security run' > log, and if that's chattering about connection attempts that > sshd/blacklistd think aren't worth acting on, then I'm going to feel > tempted to start fiddling with /etc/periodic/security/800.loginfail > (which would probably be a bad idea). ...if blacklistd is up and running, then there seems to be a case for omitting at least some reporting of login failures. How I do that in a neat and maintainable way is of course a separate question. Best wishes, Norman -- Norman Gray : http://www.astro.gla.ac.uk/users/norman/it/ Research IT Coordinator SUPA School of Physics and Astronomy, University of Glasgow, UK Charity number SC004401