xref: /netbsd-src/external/bsd/blocklist/bin/blocklistctl.8 (revision 4048e18bedf38d258c97e1dc430eaf20fbe2d717)
1.\" $NetBSD: blocklistctl.8,v 1.3 2025/01/27 17:23:25 christos Exp $
2.\"
3.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Christos Zoulas.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd January 27, 2025
31.Dt BLOCKLISTCTL 8
32.Os
33.Sh NAME
34.Nm blocklistctl
35.Nd display and change the state of the blocklistd database
36.Sh SYNOPSIS
37.Nm
38.Cm dump
39.Op Fl abdnrw
40.Sh DESCRIPTION
41.Nm
42is a program used to display and change the state of the
43.Xr blocklistd 8
44database.
45The following sub-commands are supported:
46.Ss dump
47.Pp
48The following options are available for the
49.Cm dump
50sub-command:
51.Bl -tag -width indent
52.It Fl a
53Show all database entries, by default it shows only the active ones.
54Inactive entries will be shown with a last-access (or, with
55.Fl r ,
56the remaining) time of
57.Ql never .
58.It Fl b
59Show only the blocked entries.
60.It Fl d
61Increase debugging level.
62.It Fl n
63Don't display a header.
64.It Fl r
65Show the remaining blocked time instead of the last activity time.
66.It Fl w
67Normally the width of addresses is good for IPv4, the
68.Fl w
69flag, makes the display wide enough for IPv6 addresses.
70.El
71.Pp
72The output of the
73.Cm dump
74sub-command consists of a header (unless
75.Fl h
76was given) and one line for each record in the database, where each line
77has the following columns:
78.Bl -tag -width indent
79.It Ql address/ma:port
80The remote address, mask, and local port number of the client connection
81associated with the database entry.
82.It Ql id
83column will show the identifier for the packet filter rule associated
84with the database entry, though this may only be the word
85.Ql OK
86for packet filters which do not creat a unique identifier for each rule.
87.It Ql nfail
88The number of
89.Em failures
90reported for the client on the noted port, as well as the number of
91failures allowed before blocking (or, with
92.Fl a ,
93an asterisk
94.Aq * )
95.It So last access Sc | So remaining time Sc
96The last time a the client was reported as attempting access, or, with
97.Fl r ,
98the time remaining before the rule blocking the client will be removed.
99.El
100.Sh SEE ALSO
101.Xr blocklistd 8
102.Sh NOTES
103Sometimes the reported number of failed attempts can exceed the number
104of attempts that
105.Xr blocklistd 8
106is configured to block.
107This can happen either because the rule has been removed manually, or
108because there were more attempts in flight while the rule block was being
109added.
110This condition is normal; in that case
111.Xr blocklistd 8
112will first attempt to remove the existing rule, and then it will re-add
113it to make sure that there is only one rule active.
114.Sh HISTORY
115.Nm
116first appeared in
117.Nx 7 .
118.Fx
119support for
120.Nm
121was implemented in
122.Fx 11 .
123.Sh AUTHORS
124.An Christos Zoulas
125