🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.netbsd.tech.userlevel
4 messages
4 total messages Started by Brook Milligan Sun, 29 Nov 2026 17:21
blocklist / npf in daily output
#85
Author: Brook Milligan
Date: Sun, 29 Nov 2026 17:21
72 lines
3217 bytes
Given the state of the current internet, it seems that blocklistd and an appropriate npf rule would be the recommended best practice.  To facilitate monitoring them, I wonder if adding the following (see below) to /etc/daily and /etc/defaults/daily.conf would be appropriate.

I have been running something like this for some time and find the output useful for monitoring that blocklist/npf are working correctly.

Note that with this patch nothing different will happen on any systems with this installed, as the defaults for check_blocklist and check_npf are NO.

I appreciate any comments.  Thanks a lot.

Cheers,
Brook


Index: etc/daily
===================================================================
RCS file: /cvsroot/src/etc/daily,v
retrieving revision 1.93
diff -u -r1.93 daily
--- etc/daily 23 Sep 2018 23:16:34 -0000 1.93
+++ etc/daily 26 Nov 2026 17:03:35 -0000
@@ -246,6 +246,21 @@
fi
fi

+if checkyesno check_blocklist; then
+ echo ""
+ echo "blocklist:"
+ blocklistctl dump ${check_blocklist_flags}
+ echo ""
+fi
+
+if checkyesno check_npf; then
+ for npf_rule in ${npf_rules}; do
+ echo "NPF rule: ${npf_rule}"
+ npfctl rule "${npf_rule}" list
+ echo ""
+ done
+fi
+
if checkyesno run_fsck; then
echo ""
echo "Checking file systems:"
Index: etc/defaults/daily.conf
===================================================================
RCS file: /cvsroot/src/etc/defaults/daily.conf,v
retrieving revision 1.18
diff -u -r1.18 daily.conf
--- etc/defaults/daily.conf 30 Jul 2012 17:09:34 -0000 1.18
+++ etc/defaults/daily.conf 26 Nov 2026 17:03:35 -0000
@@ -23,6 +23,8 @@
show_remote_fs=NO
check_mailq=YES
check_network=YES
+check_blocklist=NO
+check_npf=NO
full_netstat=NO
run_fsck=NO
run_fsck_flags=""


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: blocklist / npf in daily output
#86
Author: Martin Husemann
Date: Mon, 30 Nov 2026 08:19
26 lines
1719 bytes
On Sun, Nov 29, 2026 at 10:21:55AM -0700, Brook Milligan wrote:
> +if checkyesno check_blocklist; then
> + echo ""
> + echo "blocklist:"
> + blocklistctl dump ${check_blocklist_flags}
> + echo ""
> +fi

This all looks good to me, but I have an additional feature request :-)

Could we make an optional summary version of this? I don't
want to have 100eds of blocked IPs in my daily, but would like to see
a one-line-per service summary (easy awk job), like:

service		blocked
22		41
587		542


Thanks,

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: blocklist / npf in daily output
#87
Author: Brook Milligan
Date: Mon, 30 Nov 2026 16:28
48 lines
2467 bytes
> On Nov 30, 2026, at 01:19, Martin Husemann <martin@duskware.de> wrote:
> 
> On Sun, Nov 29, 2026 at 10:21:55AM -0700, Brook Milligan wrote:
>> +if checkyesno check_blocklist; then
>> + echo ""
>> + echo "blocklist:"
>> + blocklistctl dump ${check_blocklist_flags}
>> + echo ""
>> +fi
> 
> This all looks good to me, but I have an additional feature request :-)
> 
> Could we make an optional summary version of this? I don't
> want to have 100eds of blocked IPs in my daily, but would like to see
> a one-line-per service summary (easy awk job), like:
> 
> service blocked
> 22 41
> 587 542

Interesting idea.  I think you mean something like the following:

if checkyesno check_blocklist; then
        echo ""
        echo "blocklist summary:"
        (echo "service  blocked"; \
		blocklistctl dump -b \
		| sed -e 's/:/ /‘ \
		| awk 'NR>1 {a[$3]++;} END { for (i in a) print i, "\t", a[i]; }’ \
		| sort -k 1,1n;
	)
fi

How do you imagine this being controlled?  That is, how best to differentiate between a request for the detailed list and one for the summary?  Are you imagining another rc variable, e.g., check_blocklist_summary?

Cheers,
Brook


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: blocklist / npf in daily output
#88
Author: Martin Husemann
Date: Mon, 30 Nov 2026 16:53
14 lines
1540 bytes
On Mon, Nov 30, 2026 at 09:28:56AM -0700, Brook Milligan wrote:

> How do you imagine this being controlled?  That is, how best to
> differentiate between a request for the detailed list and one for the
> summary?  Are you imagining another rc variable, e.g.,
> check_blocklist_summary?

Yes, that is exactly what I had in mind.

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads