SHOREWALL-SECMARKS(5) | Configuration Files | SHOREWALL-SECMARKS(5) |
secmarks - Shorewall file
/etc/shorewall[6]/secmarks
Unlike rules in the shorewall-rules[1](5) file, evaluation of rules in this file will continue after a match. So the final secmark for each packet will be the one assigned by the LAST rule that matches.
The secmarks file is used to associate an SELinux context with packets. It was added in Shorewall version 4.4.13.
The columns in the file are as follows (where the column name is followed by a different name in parentheses, the different name is used in the alternate specification syntax).
SECMARK - {SAVE|RESTORE|context|?COMMENT comment}
SAVE
RESTORE
context
?COMMENT
CHAIN - {P|I|F|O|T}[:{N|I|U|IU|NI|NU|NIU|NUI:E|ER}]
SOURCE - {-interface|[interface:]address-or-range[,address-or-range]...}[exclusion]
MAC addresses must be prefixed with "~" and use "-" as a separator.
Example: ~00-A0-C9-15-39-78
You may exclude certain hosts from the set already defined through use of an exclusion (see shorewall-exclusion[2](5)).
Addresses may be specified using an ipset name preceded by '+'.
DEST - {-|{interface|[interface:]address-or-range[,address-or-range]...}[exclusion]
You may exclude certain hosts from the set already defined through use of an exclusion (see shorewall-exclusion[2](5)).
Addresses may be specified using an ipset name preceded by '+'.
PROTO - {-|tcp:syn|ipp2p|ipp2p:udp|ipp2p:all|protocol-number|protocol-name|all}[,...]
Beginning with Shorewall 4.5.12, this column can accept a comma-separated list of protocols.
DPORT - [-|port-name-number-or-range[,port-name-number-or-range]...]
If the protocol is ipp2p, this column is interpreted as an ipp2p option without the leading "--" (example bit for bit-torrent). If no PORT is given, ipp2p is assumed.
This column is ignored if PROTOCOL = all but must be entered if any of the following field is supplied. In that case, it is suggested that this field contain "-"
This column was formerly labelled DEST PORT(S).
SPORT - [-|port-name-number-or-range[,port-name-number-or-range]...]
This column was formerly labelled SOURCE PORT(S).
USER - [!][user-name-or-number][:group-name-or-number]
When this column is non-empty, the rule applies only if the program generating the output is running under the effective user and/or group specified (or is NOT running under that id if "!" is given).
Examples:
joe
:kids
!:kids
MARK - [!]value[/mask][:C]
If you don't want to define a test but need to specify anything in the following columns, place a "-" in this field.
!
value
mask
:C
Mark the first incoming packet of a connection on the loopback interface and destined for address 127.0.0.1 and tcp port 3306 with context system_u:object_r:mysqld_t:s0 and save that context in the conntrack table. On subsequent input packets in the connection, set the context from the conntrack table.
/etc/shorewall/interfaces:
#ZONE INTERFACE BROADCAST OPTIONS - lo - ignore
/etc/shorewall/secmarks:
#SECMARK CHAIN SOURCE DEST PROTO DPORT SPORT USER MARK system_u:object_r:mysqld_packet_t:s0 I:N lo 127.0.0.1 tcp 3306 SAVE I:N lo 127.0.0.1 tcp 3306 RESTORE I:ER
/etc/shorewall/secmarks
/etc/shorewall6/secmarks
http://james-morris.livejournal.com/11010.html
http://www.shorewall.net/configuration_file_basics.htm#Pairs[5]
02/11/2019 | Configuration Files |