'\" t .\" Title: shorewall-blrules .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 09/24/2020 .\" Manual: Configuration Files .\" Source: Configuration Files .\" Language: English .\" .TH "SHOREWALL\-BLRULES" "5" "09/24/2020" "Configuration Files" "Configuration Files" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" blrules \- shorewall Blacklist file .SH "SYNOPSIS" .HP \w'\fB/etc/shorewall[6]/blrules\fR\ 'u \fB/etc/shorewall[6]/blrules\fR .SH "DESCRIPTION" .PP This file is used to perform blacklisting and whitelisting\&. .PP Rules in this file are applied depending on the setting of BLACKLIST in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5)\&. .PP The format of rules in this file is the same as the format of rules in \m[blue]\fBshorewall\-rules (5)\fR\m[]\&\s-2\u[2]\d\s+2\&. The difference in the two files lies in the ACTION (first) column\&. .PP \fBACTION\- {\fR\fB\fBACCEPT\fR\fR\fB|BLACKLIST|blacklog|CONTINUE|DROP|A_DROP|REJECT|A_REJECT|\fR\fB\fBWHITELIST\fR\fR\fB|\fR\fB\fBLOG\fR\fR\fB|\fR\fB\fBQUEUE\fR\fR\fB|\fR\fB\fBNFQUEUE\fR\fR\fB[\fR\fB\fB(\fR\fR\fB\fIqueuenumber\fR\fR\fB\fB)\fR\fR\fB]\fR\fB\fB|[?]COMMENT\fR\fR\fB|\fR\fB\fIaction\fR\fR\fB|\fR\fB\fImacro\fR\fR\fB[\fR\fB\fB(\fR\fR\fB\fItarget\fR\fR\fB\fB)\fR\fR\fB]}\fR\fB\fB[:\fR\fR\fB{\fR\fB\fIlog\-level\fR\fR\fB|\fR\fB\fBnone\fR\fR\fB}[\fR\fB\fB\fB!\fR\fR\fR\fB][\fR\fB\fB:\fR\fR\fB\fItag\fR\fR\fB]]\fR .RS 4 Specifies the action to be taken if the packet matches the rule\&. Must be one of the following\&. .PP \fBBLACKLIST\fR .RS 4 Added in Shorewall 4\&.5\&.3\&. This is actually a macro that expands as follows: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If BLACKLIST_LOGLEVEL is specified in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5), then the macro expands to \fBblacklog\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Otherwise it expands to the action specified for BLACKLIST_DISPOSITION in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5)\&. .RE .RE .PP \fBblacklog\fR .RS 4 May only be used if BLACKLIST_LOGLEVEL is specified in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5)\&. Logs, audits (if specified) and applies the BLACKLIST_DISPOSITION specified in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2 (5)\&. .RE .PP \fBACCEPT|CONTINUE|WHITELIST\fR .RS 4 Exempt the packet from the remaining rules in this file\&. .RE .PP \fBDROP\fR .RS 4 Ignore the packet\&. .RE .PP A_DROP .RS 4 Audited version of DROP\&. Requires AUDIT_TARGET support in the kernel and ip6tables\&. .RE .PP \fBREJECT\fR .RS 4 disallow the packet and return an icmp\-unreachable or an RST packet\&. .RE .PP A_REJECT .RS 4 Audited versions of REJECT\&. Require AUDIT_TARGET support in the kernel and ip6tables\&. .RE .PP \fBLOG\fR .RS 4 Simply log the packet and continue with the next rule\&. .RE .PP \fBQUEUE\fR .RS 4 Queue the packet to a user\-space application such as ftwall (http://p2pwall\&.sf\&.net)\&. The application may reinsert the packet for further processing\&. .RE .PP \fBNFLOG\fR[(\fInflog\-parameters\fR)] .RS 4 queues matching packets to a back end logging daemon via a netlink socket then continues to the next rule\&. See \m[blue]\fBshorewall\-logging(5)\fR\m[]\&\s-2\u[3]\d\s+2\&. .RE .PP \fBNFQUEUE\fR .RS 4 Queues the packet to a user\-space application using the nfnetlink_queue mechanism\&. If a \fIqueuenumber\fR is not specified, queue zero (0) is assumed\&. .RE .PP \fB?COMMENT\fR .RS 4 The rest of the line will be attached as a comment to the Netfilter rule(s) generated by the following entries\&. The comment will appear delimited by "/* \&.\&.\&. */" in the output of "shorewall show "\&. To stop the comment from being attached to further rules, simply include ?COMMENT on a line by itself\&. .RE .PP \fIaction\fR .RS 4 The name of an \fIaction\fR declared in \m[blue]\fBshorewall\-actions\fR\m[]\&\s-2\u[4]\d\s+2(5) or in /usr/share/shorewall/actions\&.std\&. .RE .PP \fImacro\fR .RS 4 The name of a macro defined in a file named macro\&.\fImacro\fR\&. If the macro accepts an action parameter (Look at the macro source to see if it has PARAM in the TARGET column) then the \fImacro\fR name is followed by the parenthesized \fItarget\fR (\fBACCEPT\fR, \fBDROP\fR, \fBREJECT\fR, \&.\&.\&.) to be substituted for the parameter\&. .sp Example: FTP(ACCEPT)\&. .RE .sp The \fBACTION\fR 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\&. .sp If the \fBACTION\fR names an \fIaction\fR declared in \m[blue]\fBshorewall\-actions\fR\m[]\&\s-2\u[4]\d\s+2(5) or in /usr/share/shorewall/actions\&.std then: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the log level is followed by "!\*(Aq then all rules in the action are logged at the log level\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the log level is not followed by "!" then only those rules in the action that do not specify logging are logged at the specified level\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The special log level \fBnone!\fR suppresses logging by the action\&. .RE .sp You may also specify \fBNFLOG\fR (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 (\m[blue]\fBshorewall\-logging\&.htm\fR\m[]\&\s-2\u[3]\d\s+2)\&. .sp Actions specifying logging may be followed by a log tag (a string of alphanumeric characters) which is appended to the string generated by the LOGPREFIX (in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5))\&. .RE .PP For the remaining columns, see \m[blue]\fBshorewall\-rules (5)\fR\m[]\&\s-2\u[2]\d\s+2\&. .SH "EXAMPLES" .PP IPv4 Example 1: .RS 4 Drop 6to4 packets from the net\&. .sp .if n \{\ .RS 4 .\} .nf DROP net:192\&.88\&.99\&.1 all .fi .if n \{\ .RE .\} .RE .PP IPv4 Example 2: .RS 4 Don\*(Aqt subject packets from 70\&.90\&.191\&.120/29 to the remaining rules in the file\&. .sp .if n \{\ .RS 4 .\} .nf WHITELIST net:70\&.90\&.191\&.120/29 all .fi .if n \{\ .RE .\} .RE .PP IPv6 Example 1: .RS 4 Drop Teredo packets from the net\&. .sp .if n \{\ .RS 4 .\} .nf DROP net:[2001::/32] all .fi .if n \{\ .RE .\} .RE .PP IPv6 Example 2: .RS 4 Don\*(Aqt subject packets from 2001:DB8::/64 to the remaining rules in the file\&. .sp .if n \{\ .RS 4 .\} .nf WHITELIST net:[2001:DB8::/64] all .fi .if n \{\ .RE .\} .RE .SH "FILES" .PP /etc/shorewall/blrules .PP /etc/shorewall6/blrules .SH "SEE ALSO" .PP \m[blue]\fBhttps://shorewall\&.org/blacklisting_support\&.htm\fR\m[]\&\s-2\u[5]\d\s+2 .PP \m[blue]\fBhttps://shorewall\&.org/configuration_file_basics\&.htm#Pairs\fR\m[]\&\s-2\u[6]\d\s+2 .PP shorewall(8) .SH "NOTES" .IP " 1." 4 shorewall.conf .RS 4 \%https://shorewall.org/manpages/shorewall.conf.html .RE .IP " 2." 4 shorewall-rules (5) .RS 4 \%https://shorewall.org/manpages/shorewall-rules.html .RE .IP " 3." 4 shorewall-logging(5) .RS 4 \%https://shorewall.org/manpages/shorewall-logging.html .RE .IP " 4." 4 shorewall-actions .RS 4 \%https://shorewall.org/manpages/shorewall-actions.html .RE .IP " 5." 4 https://shorewall.org/blacklisting_support.htm .RS 4 \%https://shorewall.org/blacklisting_support.htm .RE .IP " 6." 4 https://shorewall.org/configuration_file_basics.htm#Pairs .RS 4 \%https://shorewall.org/configuration_file_basics.htm#Pairs .RE