From nobody Tue Aug 30 04:36:32 2022 X-Original-To: questions@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 4MGvf018ptz4bW5V for ; Tue, 30 Aug 2022 04:36:40 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from prime.gushi.org (prime.gushi.org [IPv6:2620:137:6000:10::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "prime.gushi.org", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MGvdy5h14z3DN7 for ; Tue, 30 Aug 2022 04:36:38 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from smtpclient.apple ([12.169.99.98]) (authenticated bits=0) by prime.gushi.org (8.16.1/8.16.1) with ESMTPSA id 27U4aXav014694 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Aug 2022 21:36:35 -0700 (PDT) (envelope-from freebsd@gushi.org) DKIM-Filter: OpenDKIM Filter v2.10.3 prime.gushi.org 27U4aXav014694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gushi.org; s=prime2014; t=1661834195; bh=CwUvLgR5+03IUgWQH29/xp7A3119+9VBg1Zis7UcN0A=; h=From:Subject:Date:To; z=From:=20"Dan=20Mahoney=20(Ports)"=20|Subject:= 20Firewall=20rules=20in=20a=20directory|Date:=20Mon,=2029=20Aug=20 2022=2021:36:32=20-0700|To:=20questions@freebsd.org; b=vFpSMUvdjAVrfZRCJuhgAWM2XLcystExO4pz0plMBjCTeJMuBLdOawsneAqEeLbJi B1XDxxf/En11Rqjz/DgpYzfWfITUMSaGimfOMh0e5vk6w/TXJWi/KmBPOzjpMEtNzm a1PVYGaiwUjpGo8khd10WTx6Y7ge4wjJH8DZqZGD320PjPl7/tLzwcwc65+a/2AdnD Ate+tkG7PwOBIsiIroqCoeTmwSWeLSU2LfEdCIGjo87+AN0ltSRkS+X/EpZsGM8j4c C3JJBkbXaIxD0q0WTo6fr3krpx4OuvGPwMkuIt+9gqB0hy1MK1yDNkVw624uMQDY8U QcR2usHVZU5tA== X-Authentication-Warning: prime.gushi.org: Host [12.169.99.98] claimed to be smtpclient.apple From: "Dan Mahoney (Ports)" Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Firewall rules in a directory Message-Id: <3FAB82EC-2C82-4201-AA47-B1AA92B89677@gushi.org> Date: Mon, 29 Aug 2022 21:36:32 -0700 To: questions@freebsd.org X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (prime.gushi.org [149.20.68.142]); Tue, 30 Aug 2022 04:36:35 +0000 (UTC) X-Rspamd-Queue-Id: 4MGvdy5h14z3DN7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gushi.org header.s=prime2014 header.b=vFpSMUvd; dmarc=pass (policy=none) header.from=gushi.org; spf=pass (mx1.freebsd.org: domain of freebsd@gushi.org designates 2620:137:6000:10::142 as permitted sender) smtp.mailfrom=freebsd@gushi.org X-Spamd-Result: default: False [-6.20 / 15.00]; DWL_DNSWL_MED(-2.00)[gushi.org:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gushi.org,none]; R_DKIM_ALLOW(-0.20)[gushi.org:s=prime2014]; RCVD_IN_DNSWL_MED(-0.20)[2620:137:6000:10::142:from]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[questions@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[gushi.org:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:393507, ipnet:2620:137:6000::/44, country:US]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N All, At the dayjob, we=E2=80=99ve taken to putting our ipfw rules into a = directory using rcorder=E2=80=99able files. This way, each of our = puppet manifests can drop its own rules into place without having to = manage a monolithic file. It=E2=80=99s a simple patch to rc.firewall, where if you set = firewall_type to a file, it just runs it, but if it=E2=80=99s a = directory, it would treat it as such: *) if [ -r "${firewall_type}" ]; then if [ -f "${firewall_type}" ]; then ${fwcmd} ${firewall_flags} ${firewall_type} else if [ -d "${firewall_type}" ]; then for fwfile in `rcorder $firewall_type/*` do ipfw -q $fwfile; done fi fi Is there a possibility of getting this into base? -Dan=