SHOREWALL-BLRULES(5)
π SHOREWALL-BLRULES(5) β blrules, the Blacklist file bestie β¨
okay so welcome to the blrules manual page, aka shorewall's Blacklist file β yes that's the whole NAME, we're keeping it cute but complete π
β¨ SYNOPSIS β¨
/etc/shorewall[6]/blrules
πΈ DESCRIPTION πΈ
bestie. this file is literally where you do your blacklisting and your whitelisting. it's giving gatekeeper energy, but make it firewall π«Ά
the rules in here get applied based on how BLACKLIST is set in shorewall.conf(5). no cap, that setting controls the whole vibe of this file.
the format of the rules in this file? same format as the rules in shorewall-rules(5). identical. the only difference between the two files is in the ACTION column, which is the first column. that's it, that's the plot twist π
π¦ ACTION π¦
{ACCEPT|BLACKLIST|blacklog|CONTINUE|DROP|A_DROP|REJECT|A_REJECT|WHITELIST|LOG|QUEUE|NFQUEUE[(queuenumber)]|[?]COMMENT|action|macro[(target)]}[:{log-level|none}[!][:tag]]
this tells shorewall what to do with a packet when it matches the rule. it has to be one of these, periodt:
BLACKLISTβ added way back in Shorewall 4.5.3. this one is actually a macro, and it expands like this:- if
BLACKLIST_LOGLEVELis specified inshorewall.conf(5), then the macro expands toblacklog. - otherwise it expands to the action specified for
BLACKLIST_DISPOSITIONinshorewall.conf(5).
- if
blacklogβ you may only use this ifBLACKLIST_LOGLEVELis specified inshorewall.conf(5). it logs, audits (if that's specified), and applies theBLACKLIST_DISPOSITIONfromshorewall.conf(5).ACCEPT|CONTINUE|WHITELISTβ exempts the packet from the remaining rules in this file. the packet is free πDROPβ ignore the packet. not today.A_DROPβ the audited version ofDROP. this needsAUDIT_TARGETsupport in the kernel and inip6tables.REJECTβ disallow the packet and return an icmp-unreachable or an RST packet.A_REJECTβ the audited versions ofREJECT. requiresAUDIT_TARGETsupport in the kernel andip6tables.LOGβ simply log the packet and continue on with the next rule. just observing, no interference πQUEUEβ queue the packet to a user-space application like ftwall (http://p2pwall.sf.net). that application may reinsert the packet for further processing.NFLOG[(nflog-parameters)]β queues matching packets to a back end logging daemon via a netlink socket, then continues to the next rule. checkshorewall-logging(5) for the tea.NFQUEUEβ queues the packet to a user-space application using thenfnetlink_queuemechanism. if a queuenumber isn't specified, queue zero (0) is assumed.?COMMENTβ the rest of the line gets attached as a comment to the Netfilter rule(s) generated by the following entries. that comment shows up delimited by/* ... */in the output ofshorewall show <chain>. to stop the comment from being attached to further rules, just include?COMMENTon a line by itself.actionβ the name of an action declared inshorewall-actions(5) or in/usr/share/shorewall/actions.std.macroβ the name of a macro defined in a file namedmacro.macro. if the macro accepts an action parameter (peep the macro source to see if it hasPARAMin the TARGET column) then the macro name is followed by the parenthesized target (ACCEPT,DROP,REJECT, ...) to be substituted for the parameter.
example: FTP(ACCEPT).
the ACTION may optionally be followed by : and a syslog log level (e.g., REJECT:info or Web(ACCEPT):debug). this causes the packet to be logged at the specified level. so extra, so iconic β¨
and if the ACTION names an action declared in shorewall-actions(5) or in /usr/share/shorewall/actions.std, then:
- if the log level is followed by
!then all rules in the action are logged at the log level. - if the log level is not followed by
!then only those rules in the action that don't specify logging get logged at the specified level. - the special log level
none!suppresses logging by the action.
you may also specify NFLOG (it must be in upper case) as a log level. this will log to the NFLOG target for routing to a separate log through use of ulogd (shorewall-logging.htm).
actions that specify logging may be followed by a log tag (a string of alphanumeric characters) which gets appended to the string generated by the LOGPREFIX (in shorewall.conf(5)).
for all the remaining columns, go see shorewall-rules(5). i'm not re-explaining my bestie's whole lore here π
π EXAMPLES π
IPv4 Example 1: Drop 6to4 packets from the net.
DROP net:192.88.99.1 all
IPv4 Example 2: Don't subject packets from 70.90.191.120/29 to the remaining rules in the file.
WHITELIST net:70.90.191.120/29 all
IPv6 Example 1: Drop Teredo packets from the net.
DROP net:[2001::/32] all
IPv6 Example 2: Don't subject packets from 2001:DB8::/64 to the remaining rules in the file.
WHITELIST net:[2001:DB8::/64] all
π FILES π
/etc/shorewall/blrules/etc/shorewall6/blrules
π¦ SEE ALSO π¦
https://shorewall.org/blacklisting_support.htmhttps://shorewall.org/configuration_file_basics.htm#Pairsshorewall(8)
π NOTES π
shorewall.confhttps://shorewall.org/manpages/shorewall.conf.htmlshorewall-rules(5)https://shorewall.org/manpages/shorewall-rules.htmlshorewall-logging(5)https://shorewall.org/manpages/shorewall-logging.htmlshorewall-actionshttps://shorewall.org/manpages/shorewall-actions.htmlhttps://shorewall.org/blacklisting_support.htmhttps://shorewall.org/blacklisting_support.htmhttps://shorewall.org/configuration_file_basics.htm#Pairshttps://shorewall.org/configuration_file_basics.htm#Pairs
and that's the whole page, bestie!! this one's from the Configuration Files manual, dated 09/24/2020, and it answers to the name SHOREWALL-BLRULES(5) πβ¨ go forth and blacklist responsibly π
π¦ where this page comes from
- alpine 3.22: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.23: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.24: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- debian bookworm: shorewall 5.2.8-2 Β· GPL-2.0-or-later
- debian trixie: shorewall 5.2.8-6 Β· GPL-2.0-or-later
- fedora 43: shorewall 5.2.8-17.fc43 Β· GPL-2.0-or-later
- fedora 44: shorewall 5.2.8-18.fc44 Β· GPL-2.0-or-later
- nixos 26.05: shorewall 5.2.8
- nixpkgs unstable: shorewall 5.2.8
- ubuntu noble: shorewall 5.2.8-5 Β· GPL-2.0-or-later
- ubuntu questing: shorewall 5.2.8-6
- ubuntu resolute: shorewall 5.2.8-6build1 Β· GPL-2.0-or-later
- ubuntu stonking: shorewall 5.2.8-6build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms