Date: Mon, 02 Mar 2020 10:10:56 +0100 From: "Kristof Provost" <kp@FreeBSD.org> To: Jov <amutu@amutu.com> Cc: "FreeBSD Mailing List" <freebsd-questions@freebsd.org> Subject: Re: pfctl Recursive in anchor broken(DIOCGETRULES: Invalid argument)? Message-ID: <A02CE96D-8825-4E67-BAEF-6948BEF16BEE@FreeBSD.org> In-Reply-To: <CADyrUxPEp2Jx9bTmyc-wHff8NX_BYa9Sk0cA-zDe4WWK%2BmcKoQ@mail.gmail.com> References: <CADyrUxPEp2Jx9bTmyc-wHff8NX_BYa9Sk0cA-zDe4WWK%2BmcKoQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 26 Feb 2020, at 15:23, Jov wrote: > hi hackers, > I use fail2ban today and find pfctl recursive anchor do not work, it > report > nothing(pfctl -a 'f2b/*' -sr) or get all main rule and a warning(pfctl > -a > '*' -sr,get DIOCGETRULES: Invalid argument). > > detail: > > # pfctl -a 'f2b' -sA >> f2b/dovecot >> f2b/dovecot-auth-worker >> f2b/pam-generic >> f2b/postfix >> f2b/sshd > > #pfctl -a 'f2b/sshd' -sr >> block drop quick proto tcp from <f2b-sshd> to any port = 46 >> #pfctl -a 'f2b/sshd/*' -sr >> block drop quick proto tcp from <f2b-sshd> to any port = 46 >> pfctl -a 'f2b/*' -sr >> # pfctl -a '*' -sr | less >> pfctl: DIOCGETRULES: Invalid argument >> scrub in all fragment reassemble >> block drop in log on vtnet0 all >> block drop out log on vtnet0 all >> ....other main rule > > I’ve done a little digging, and as far as I can tell this has been broken for years. The good news is that I believe it’s only a problem w.r.t. actually enumerating the anchor rules. You can still list the anchors (`pfctl -sA -v`) and then print the rules per anchor (e.g. `pfctl -a 'f2b/sshd' -sr`) Obviously it’s a bug and should be fixed, but your ruleset should actually do what you told it to do. Best regards, Kristof From owner-freebsd-questions@freebsd.org Mon Mar 2 15:28:45 2020 Return-Path: <owner-freebsd-questions@freebsd.org> 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 3E80B25176A for <freebsd-questions@mailman.nyi.freebsd.org>; Mon, 2 Mar 2020 15:28:45 +0000 (UTC) (envelope-from mike@sentex.net) Received: from pyroxene2a.sentex.ca (pyroxene19.sentex.ca [IPv6:2607:f3e0:0:3::19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "pyroxene.sentex.ca", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48WPDq4VfDz3MY9 for <freebsd-questions@freebsd.org>; Mon, 2 Mar 2020 15:28:43 +0000 (UTC) (envelope-from mike@sentex.net) Received: from [IPv6:2607:f3e0:0:4:2510:c765:33b8:fe6b] ([IPv6:2607:f3e0:0:4:2510:c765:33b8:fe6b]) by pyroxene2a.sentex.ca (8.15.2/8.15.2) with ESMTPS id 022FSgQO060434 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 2 Mar 2020 10:28:42 -0500 (EST) (envelope-from mike@sentex.net) Subject: Re: ZFS i/o error on boot unable to start system To: David Christensen <dpchrist@holgerdanske.com>, freebsd-questions@freebsd.org References: <eb8f8f32fcf5559774daf3a772a1ad2e.squirrel@webmail.harte-lyne.ca> <fcc9f93f-3680-d000-840c-a9be86a53ceb@holgerdanske.com> From: mike tancsa <mike@sentex.net> Autocrypt: addr=mike@sentex.net; keydata= mQENBFywzOMBCACoNFpwi5MeyEREiCeHtbm6pZJI/HnO+wXdCAWtZkS49weOoVyUj5BEXRZP xflV2ib2hflX4nXqhenaNiia4iaZ9ft3I1ebd7GEbGnsWCvAnob5MvDZyStDAuRxPJK1ya/s +6rOvr+eQiXYNVvfBhrCfrtR/esSkitBGxhUkBjOti8QwzD71JVF5YaOjBAs7jZUK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OEFl5WrMgFAlywzOQCGwwFCQHhM4AACgkQeVOE Fl5WrMhmjQf/dBCjAVn1J0GzSsHiLvSAQz1cchbdy8LD0Tnpzjgp5KLU7sNojbI8vqt4yKAi cayI88j8+xxNXPMWM4pHELuUuVHS5XTpHa/wwulUtI5w/zyKlUDsIvqTPZLUEwH7DfNBueVM WyNaIjV2kxSmM8rNMC+RkgyfbjGLCkmWsMRVuLIUYpl5D9WHmenUbiErlKU2KvEEXEg/aLKq 3m/AdM9RAYsP9O4l+sAZEfyYoNJzDhTZMzn/9Q0uFPLK9smDQh4WBTFaApveVJPHRKmHPoNF Xxj+yScYdQ4SKH34WnhNSELvnZQ3ulH5tpASmm0w+GxfZqSc8+QCwoKtBRDUxoE56A== Message-ID: <3a085472-cfe5-5166-9426-db8ae3344ab8@sentex.net> Date: Mon, 2 Mar 2020 10:28:43 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <fcc9f93f-3680-d000-840c-a9be86a53ceb@holgerdanske.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 48WPDq4VfDz3MY9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mike@sentex.net designates 2607:f3e0:0:3::19 as permitted sender) smtp.mailfrom=mike@sentex.net X-Spamd-Result: default: False [-2.71 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HFILTER_HELO_IP_A(1.00)[pyroxene2a.sentex.ca]; DMARC_NA(0.00)[sentex.net]; HFILTER_HELO_NORES_A_OR_MX(0.30)[pyroxene2a.sentex.ca]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-1.71)[ipnet: 2607:f3e0::/32(-4.92), asn: 11647(-3.54), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11647, ipnet:2607:f3e0::/32, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions <freebsd-questions.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/> List-Post: <mailto:freebsd-questions@freebsd.org> List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=subscribe> X-List-Received-Date: Mon, 02 Mar 2020 15:28:45 -0000 On 2/28/2020 2:04 PM, David Christensen wrote: > > The most likely explanation is that you broke rc.conf. > I dont think he is getting that far. This looks like the kernel etc are not even loaded yet.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A02CE96D-8825-4E67-BAEF-6948BEF16BEE>