From owner-freebsd-questions@freebsd.org Thu May 14 12:31:12 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 CE7EB2F0F80 for ; Thu, 14 May 2020 12:31:12 +0000 (UTC) (envelope-from Norman.Gray@glasgow.ac.uk) Received: from plockton.cent.gla.ac.uk (plockton.cent.gla.ac.uk [130.209.16.75]) (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 49N9rH5FDzz4H6q for ; Thu, 14 May 2020 12:31:11 +0000 (UTC) (envelope-from Norman.Gray@glasgow.ac.uk) Received: from cas07.campus.gla.ac.uk ([130.209.14.164]) by plockton.cent.gla.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1jZD12-0006xh-IY for freebsd-questions@freebsd.org; Thu, 14 May 2020 13:31:08 +0100 Received: from CAS08.campus.gla.ac.uk (130.209.14.165) by cas07.campus.gla.ac.uk (130.209.14.164) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 May 2020 13:31:08 +0100 Received: from GBR01-CWL-obe.outbound.protection.outlook.com (104.47.20.54) by CAS08.campus.gla.ac.uk (130.209.14.165) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 14 May 2020 13:31:08 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7HcLYy3KJbov+/dIFB1XRIVpO7neRXxVmfLjMFIXUvEqbHj83LHvf0duD7LSgFwoyKdrO8i/rYDV8Lp01m8HhVFRVQ+d2hbe0ZP+taFlvQJC7hK7zqvYO/mEiyBCkrmYhK1suLRTiddwMobpMxe1ESZzo9vTEnkm6xkdfBxkN+nsn0wofxtBzfkHF40Y3NSNYFkyo4naF3TQoECCaBDx0d+iiChv82KSpSAR+xhzbGJWjQGSnHttFMgTjbfGhVdN3HxVK+DnSBBE90ztVMMVipIquwmTyOt1kjKph1OyqvMO6nd9wyGaQAoebVHUGv8SjVUFEhdaflQoNHTq5ArwQ== 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=+u2+TtTGGH9DAbv0ZqozO56TYzJC971eGDI3gp/zId8=; b=PhzM46znjgMYQocEPwuiKMRli/mOO/qMAzGVkdOdR56cJEqakDGxwP77ueAgRu2h/0LvXqIg96mJePUK18jnvYTq1cG0Ot9rK17DNN3sV4uylcsrog0JDXWnvCudRiA9KvD19Zz4n3DiF9diD1FhYZh0tg4UrJQhzFID791Nb23wSndbmovIqoK+ZO1kKFhEG6+lapLfV/R6imBA2sLGzBuRZRCilKifaejUZDEXj0c6+jQ15wg4vO7S/tVS89Xl016DA72onZExviV/0/n8KhN4zYvQJx+tvO8+2nRZ3luc+75Tak7J+cq4f4iiOVC/BPSrCJyFpwkMrF2FgXjPhw== 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=+u2+TtTGGH9DAbv0ZqozO56TYzJC971eGDI3gp/zId8=; b=RgIu2gyGHnBbwuteKUzErGaiqa8E8qxfY6A8zE9z6yrSvxTAcIObbaI2888QugrJR6zstgUpzxBDH6BtpjBx5H+f1J0I74TiwQBXqfNmiqITVism62k1XLbleE2vkwcKh3K5izjje0qcGJhkoXp2zI++U1gdAlmEfShXS6zm0iM= Received: from CWXP265MB0149.GBRP265.PROD.OUTLOOK.COM (10.164.144.19) by CWXP265MB2053.GBRP265.PROD.OUTLOOK.COM (20.181.79.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Thu, 14 May 2020 12:31:07 +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.2979.033; Thu, 14 May 2020 12:31:07 +0000 From: "Norman Gray" To: RW via freebsd-questions Subject: blacklistd: spurious whitelisting of IPs Date: Thu, 14 May 2020 13:31:05 +0100 X-Mailer: MailMate (1.13.1r5671) Message-ID: <52AD5746-A693-42D2-A4DC-5D38341AA979@glasgow.ac.uk> Content-Type: text/plain; format=flowed X-ClientProxiedBy: LO2P265CA0117.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::33) 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.112] (81.2.70.164) by LO2P265CA0117.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.25 via Frontend Transport; Thu, 14 May 2020 12:31:07 +0000 X-Mailer: MailMate (1.13.1r5671) X-Originating-IP: [81.2.70.164] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd54e2d4-0efb-46a2-dd7d-08d7f802ad14 X-MS-TrafficTypeDiagnostic: CWXP265MB2053: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 040359335D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jk6OdPdgJ16mrjCZYSF4AuY0O9MjguPdVrEJ6yleG9ezx5D4dmz+YCcjDaybWZ4u9Jac99VrQR2JLr25KR2M6rtQl+EnJ0JdLOLPJqK4NEqEZT4Q4hc7YDaeyajQ213Gme3vaaDWHaOguYoxTVGGBHxOmFopH17e38paPEHv67o3dFy2VYyCJma38KjDALNvbaLKivMBlqwz8VcdZQNPz1jq+1/T5xJCTca5X3khfed7aw1BP8eh2dFs+jyXYwXW0kHlOahPAHdSiegOXVcXFoWKWzM4FAIt9wQc0rnEHbaiBwrn4HG/+nRYnqiB+ku5ZmMjhRdbPxLbNAJ7MhPwgZhBp2ExxWrAf8xV/W7H3A0ScqimQcKyIsBmBvZ1Latfo/I07Rdu21c2phHZwSXSvWrS55Cw8dJg8veO3g+XyY6XRfPYc9bxbb14ocl0W3yNwsG5JaCxbk+D0N13E6JuOnrUHxYO6Y8RotjrPY7fDuGXotfncxsE41vJOZAKyDF5OXGSg87H5bse1HaCsRlPP/C+PWT2KV3bQva7Zx3Wuz8l/RSZr6rQKGAGb09GjuwS2KsjOtb6SqrR+J5rFcF/sENzpgCn5bM9v+dym2UeZbA= 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:(39860400002)(346002)(366004)(396003)(376002)(136003)(478600001)(66556008)(33656002)(316002)(26005)(6916009)(6706004)(5660300002)(186003)(36756003)(786003)(16576012)(16526019)(86362001)(66476007)(6486002)(2616005)(956004)(66946007)(8676002)(8936002)(52116002)(2906002)(966005)(78286006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: i20AJxA1/vGAumVU+DCUu8XJvbFGC+9rgyw7noH541Pq0jNzWkmd0GAghVRe2zY4HTwqN9xIfJCt2bHLAOg+xWU9f169A0FXlh6edTbFbCuZvqOGYXOxCm/sg/V9S56kAHLu3jsSmWHhdf/5+vp936eWDbo6MQ5kdN0T6woru90W0Prq3WTradOQzExTaifzF0j3yOSnvQZpz7TSeR/u8QG0CkZNcF+h+20FPumvcsnF1hIFK8msso0Ir6YLrVcUx4p59m+nighp8hcTLyH8uI95NwhjvOcy8vpjTC6DFPTeLG3GKnJ5i2I0Cob5PYqaIDr+bSzQPrWXpBMjMOWwh28gLOWttgSerdyhjaI5/yP8QbGT86pew97jdb8KCSm/dTvASSSSBJ7k+11OUqcCw3T4JBn3CMtDNg1vvk7kEN/Js3VJEj7Qe0tPwr8PRHy2tGRhQF6XEq3M5Joz7zggQfKYMK12C58mrBhE1p2QQbQ= X-MS-Exchange-CrossTenant-Network-Message-Id: dd54e2d4-0efb-46a2-dd7d-08d7f802ad14 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2020 12:31:07.5622 (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: 8krKPcuci7yBc26IYXOd1CJ1fk3JSKhugSDImUflHBDp/KC+HUF9Bg81rOfIf9fzitIBHvMbzbu5KCyA6XfusA3k5ugAprP3CPGQuHcYvfw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP265MB2053 X-OriginatorOrg: glasgow.ac.uk X-Rspamd-Queue-Id: 49N9rH5FDzz4H6q X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gla.onmicrosoft.com header.s=selector2-gla-onmicrosoft-com header.b=RgIu2gyG; dmarc=none; spf=none (mx1.freebsd.org: domain of Norman.Gray@glasgow.ac.uk has no SPF policy when checking 130.209.16.75) smtp.mailfrom=Norman.Gray@glasgow.ac.uk X-Spamd-Result: default: False [-6.98 / 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)[75.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]; DMARC_NA(0.00)[glasgow.ac.uk]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-2.98)[ip: (-9.77), ipnet: 130.209.0.0/16(-4.67), asn: 786(-0.39), country: GB(-0.07)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[75.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)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; 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.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 12:31:12 -0000 Greetings. My blacklistctl dump -a output currently looks a bit like this address/ma:port id nfail last access 130.209.XX.XX/32:22 0/-1 1970/01/01 01:00:00 194.XX.XX.XX/32:22 3/-1 2020/05/14 00:35:05 [ IP addresses partially redacted ] [...plus various reasonable-looking lines...] Both those IP ranges are 'friendly', and the first is the local /16. The odd thing is the -1 as the nfail limit, meaning 'do not block' or 'whitelisted', which I can't explain. My blacklistd.conf looks like: [local] ssh stream * * * 4 24h ftp stream * * * 3 24h smtp stream * * * 3 24h submission stream * * * 3 24h * * * * * 3 60 [remote] 130.209.XX.XX:ssh * * * * * * 194.XX.XX.XX:ssh * * * * * * 130.209.XX.XX:ssh * * * * * * The [local] stanza is almost the default; the [remote] explicitly whitelists three machines. But the whitelisted machines _do not_ match the nfail=-1 machines in the blacklistctl output. They're in the same 130.209.0.0/16 and 194.0.0.0/8, but are not the same IP address. Looking further back, I can see a similar pattern, with these netblocks, but no others, apparently whitelisted. What's going on? It's as if the local lines were being parsed as 130.209.0.0/16:ssh and 194.0.0.0/8:ssh, but there's nothing in the by-hand parser of the .conf file that suggests that's what's happening (see lines 224 and 586, last changed March 2018). The machine this is running on is hosting a couple of jails (one of which is the bastion host that this is really protecting, and the blacklistd is listening on sockets in both the host and the bastion jail), it has four IP addresses (two of which are in a private IP range), and it has a non-trivial, but not particularly complicated pf firewall configuration. This is the blacklistd in FreeBSD 12.0-RELEASE-p8 (I can't find a version option on blacklistd nor any version strings in the blacklistd binary). I'm perplexed. 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