From nobody Tue Aug 30 04:40:34 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 4MGvkb19WNz4bWhB for ; Tue, 30 Aug 2022 04:40:39 +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 4MGvkZ1yBfz3FZM for ; Tue, 30 Aug 2022 04:40: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 27U4eZ7p015096 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Aug 2022 21:40:36 -0700 (PDT) (envelope-from freebsd@gushi.org) DKIM-Filter: OpenDKIM Filter v2.10.3 prime.gushi.org 27U4eZ7p015096 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gushi.org; s=prime2014; t=1661834436; bh=4zs7wI6ldbT/iou2LN03MWKpo80Bt2lBCJYctbrLvRA=; h=From:Subject:Date:References:To:In-Reply-To; z=From:=20"Dan=20Mahoney=20(Ports)"=20|Subject:= 20Re:=20Firewall=20rules=20in=20a=20directory|Date:=20Mon,=2029=20 Aug=202022=2021:40:34=20-0700|References:=20<3FAB82EC-2C82-4201-AA 47-B1AA92B89677@gushi.org>|To:=20questions@freebsd.org|In-Reply-To :=20<3FAB82EC-2C82-4201-AA47-B1AA92B89677@gushi.org>; b=NXx/kKSNF9oqy2F8ZDI7OGrebLTZ4d3fIpRi30OaG5rQbitBuLtrHNU7vj0ekbHRt zjnxDIByfYLxHMdgWKaqylf516gVsStbk32b2RzBzwSFnxi8fCBsaMKzzW42i8zfC+ wW8NEXOt5trWi0+zx+tb8EKTeUGbKVlajHXd5QzD6RccDf7gmIoV7Ey/x7mlt/59f4 /ij5jvHgSM0LK1bpr8hXdjHZYCDr/QQ5BN82p/6Hp7aTJSyG3cmftjamgmiKFt/mK3 j9wHCQBhHXO8stB3zTVdX2+KgieMXMUtnZCJjRBOVS7tc/icjYs5AVB0R5up+KTRb5 fIZ73MlL9Wu1g== 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: Re: Firewall rules in a directory Date: Mon, 29 Aug 2022 21:40:34 -0700 References: <3FAB82EC-2C82-4201-AA47-B1AA92B89677@gushi.org> To: questions@freebsd.org In-Reply-To: <3FAB82EC-2C82-4201-AA47-B1AA92B89677@gushi.org> Message-Id: 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:40:36 +0000 (UTC) X-Rspamd-Queue-Id: 4MGvkZ1yBfz3FZM X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gushi.org header.s=prime2014 header.b="NXx/kKSN"; 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]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gushi.org,none]; MV_CASE(0.50)[]; 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:c]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; PREVIOUSLY_DELIVERED(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 Note, this wasn=E2=80=99t intended to be =E2=80=9Chere=E2=80=99s a diff, = please put it in=E2=80=9D, just an illustration of how trivial an = addition it is. > On Aug 29, 2022, at 9:36 PM, Dan Mahoney (Ports) = wrote: >=20 > All, >=20 > 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. >=20 > 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: >=20 > *) > 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 >=20 > Is there a possibility of getting this into base? >=20 > -Dan