Compare commits

...

326 Commits

Author SHA1 Message Date
Tom Eastep
5fbc5f1430 Apply Paul Gear's patch for Ubuntu 16.04
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-02 07:26:10 -07:00
Tom Eastep
cae7c5d300 Fix link
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-01 10:44:12 -07:00
Tom Eastep
bba851117a Correct typo in manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-01 10:44:01 -07:00
Matt Darfeuille
91702f094d patches and request
Tom,

Some patches for the trunk repo(fixes.patch):

Patch1: Fix a typo in the path being printed for the standard actions
file.
Patch2: Will only install the shorewall's manpages if the variable
MANDIR is none-empty(I did it only for the sake of completeness)!
Patch3: Will only install the shorewall-lite's manpages if the
variable MANDIR is none-empty.
Patch4: Correct multiple product name's typos in
shorewall-init/install.sh.
Patch5: Remove ~/.shorewallrc when shorewall-core is uninstalled.

And two other  patches for the release repo(changelog-1.patch):

Patch1: Changed restart to reload for the line: 'Update DHCP
article(refresh -> restart).
Patch2: Rephrased the line for the newly added ?WARNING and ?INFO
directives.

Request:
Could the date of the compiled firewall script also be displayed when
'shorewall status' is executed?

-Matt

-------------- Enclosure number 2 ----------------
>From a5ae24bbe9b25aefdbcc4d7c8e5d013a36b03078 Mon Sep 17 00:00:00 2001
From: Matt Darfeuille <matdarf@gmail.com>
Date: Sat, 23 Apr 2016 14:44:19 +0200
Subject: [PATCH 1/5] Fix typo in printed path for standard actions file

Signed-off-by: Matt Darfeuille <matdarf@gmail.com>
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-28 16:42:52 -07:00
Tom Eastep
49c94bc5ec Fix Shorewall6 init.sh
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-28 16:42:32 -07:00
Tom Eastep
67c2587890 Correct typos in the Events article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-25 16:09:10 -07:00
Tom Eastep
f6b7eb4ea0 Correct handling of persistent provider with no IP address
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-25 12:27:00 -07:00
Tom Eastep
f16e3f1fbe Issue warning when enable/disable won't work correctly
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-19 10:42:50 -07:00
Tom Eastep
71bd7a4647 Update the STARTUP_LOG description in shorewall[6].conf
- Update list of commands

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-19 07:49:37 -07:00
Tom Eastep
ab95607f5f Document ?WARNING and ?INFO
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 14:47:08 -07:00
Tom Eastep
f9bbca8b05 Expand the list of commands that write to STARTUP_LOG
- add the safe-* commands

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 14:16:13 -07:00
Tom Eastep
0faf3b6db1 Send INFO messages to STDERR rather than STDOUT 2016-04-18 13:59:29 -07:00
Tom Eastep
3253c882e9 Merge branch '5.0.8' 2016-04-18 12:36:28 -07:00
Tom Eastep
5212dba7cb Add an ESTABLISHED,RELATED rule for docker0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 10:13:05 -07:00
Tom Eastep
35a22eedac Reword error message when tcclass MARK is too large
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 10:06:04 -07:00
Tom Eastep
2b7ef0fe32 Update the tcclasses manpage to discuss fw mark filter priority
- Also correct default priorities for tos= and tcp-ack

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 09:18:48 -07:00
Tom Eastep
b53de922d1 Catch 0 in the MARK column of the tcclasses file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 08:50:10 -07:00
Matt Darfeuille
365ffaf645 questions
On 17 Apr 2016 at 7:45, Tom Eastep wrote:

> On 04/17/2016 06:23 AM, Matt Darfeuille wrote:
>
> >> Tom, I neglected the git part of that request!(sorry):
> >>
> >> Could changes be also made in the git code repo that take for account
> >> case insensitive system?:
> >>
> >> What I suggest doing is using the deprecated extension when the case
> >> of a file is changed in the code so git wouldn't show 'Modified: ...'
> >> and simply modifying shorewall/install.sh to strip the file from the
> >> deprecated extension and then copying it to the deprecated directory.
> >>
> >> In other words: when changing the case of a file tracked by git could
> >> case-insensitivity platform be taken in to account?
> >>
> >> -Matt
> >>
> >> P.S. I'll test SW_LOGGERTAG tomorrow!!!:)
> >
> > Or do you have a better solution, if no, I could do the changes to
> > shorewall/install.sh!?
>
> Sure -- go ahead. We'll do it in the master branch, though, since I've
> now created a 5.0.8 branch for the upcoming release.
>
> >
> > You might want to apply the attached patch to changelog.txt in the
> > release repo!
> >
>
> Applied -- thanks!
>
> -Tom
> --
> Tom Eastep        \ When I die, I want to go like my Grandfather who
> Shoreline,         \ died peacefully in his sleep. Not screaming like
> Washington, USA     \ all of the passengers in his car
> http://shorewall.net \________________________________________________
>
>

Attached as case.patch are 3 patches:

1 and 2 simply rename the deprecated files(adding .deprecated)

Patch 3 will modify Shorewall/install.sh to reflect the new naming
scheme!

I didn't have the time to test SW_LOGGERTAG but will do so in the
coming days!!!:)

-Matt

-------------- Enclosure number 1 ----------------
From 2ecd761b414af61c5854d6427fb9ec8ab1365c7b Mon Sep 17 00:00:00 2001
From: Matt Darfeuille <matdarf@gmail.com>
Date: Sun, 17 Apr 2016 18:34:40 +0200
Subject: [PATCH 1/3] Rename macro.SNMPTrap to macro.SNMPTrap.deprecated

Signed-off-by: Matt Darfeuille <matdarf@gmail.com>
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-17 13:50:17 -07:00
Tom Eastep
ae852b513d Correct indentation issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-17 10:23:18 -07:00
Tom Eastep
9611b588e3 Use a uniform format for log timestamps
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:52:35 -07:00
Tom Eastep
eb95532248 Enable compiler logging on reload and restart
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:52:17 -07:00
Tom Eastep
fb8dbcf44b Use a uniform format for log timestamps
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:49:38 -07:00
Tom Eastep
62a14aab28 Enable compiler logging on reload and restart
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:37:42 -07:00
Tom Eastep
335f2968f8 Implement ?INFO and ?WARNING
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:20:09 -07:00
Tom Eastep
32f888a7d4 Add an ENVIRONMENT section to the CLI manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-15 15:41:55 -07:00
Tom Eastep
c725372639 Correct logging of 'reloaded' message
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-15 14:46:21 -07:00
Tom Eastep
524838ae47 Implement $SW_LOGGERTAG
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-15 14:29:51 -07:00
Tom Eastep
549af8b402 Update config files where address and gateway variables can be used
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-15 10:51:39 -07:00
Tom Eastep
6aa0ecae4f Re-factor the code for saving/loading ipsets
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-14 15:15:47 -07:00
Tom Eastep
434e042494 Add the deprecated/ directories to the CONFIG_PATH
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-14 14:17:06 -07:00
Tom Eastep
9fa0df2fd1 Move the code that generates zap_ipsets() to after save_ipsets() generation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-14 09:56:48 -07:00
Tom Eastep
074655d1bd Fix AUTOMAKE and the start command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-14 09:43:21 -07:00
Tom Eastep
216bc715e8 Clean up V4/V5 ipset enforcement
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-14 09:00:38 -07:00
Tom Eastep
541ecb67b4 Update dhcp article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-13 17:36:56 -07:00
Tom Eastep
dbd42e1d5d More ipset fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-12 16:29:13 -07:00
Tom Eastep
04ec8273ef Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code 2016-04-12 07:13:29 -07:00
Tuomo Soini
772f88b1fd action.A_Reject: improve comment text
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-12 13:17:56 +03:00
Tuomo Soini
3e0b8c60a2 Reverse the order of ICMP and Broadcast checking in the default actions
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-12 10:12:29 +03:00
Tom Eastep
fc2b555cdb Correct date formatting in startup_error()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-11 15:24:35 -07:00
Tom Eastep
16afd880b2 Reverse the order of ICMP and Broadcast checking in the default actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-11 11:16:46 -07:00
Tom Eastep
76a5841fcd Reverse the order of Broadcast and ICMP checking in the default actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-11 10:47:11 -07:00
Tom Eastep
9758e8cdc5 Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code 2016-04-11 10:41:44 -07:00
Tom Eastep
2cf3706864 Correct handling of a zone with two interfaces
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-11 10:32:26 -07:00
Tom Eastep
3028dafbac Correct DBL 'src-dst' handling
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-11 09:13:17 -07:00
Tom Eastep
16a31c3d29 Make MINIUPNPD work with DOCKER
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-11 09:02:44 -07:00
Tom Eastep
d3f377e915 Don't double-save the dynamic blacklisting ipset
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-11 08:37:39 -07:00
Tuomo Soini
54a5748395 macros: RedisCluster and RedisSentinel
http://redis.io/topics/sentinel

Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-11 14:39:21 +03:00
Tom Eastep
6c00f72f44 Create ipsets with the 'counters' option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-10 18:09:41 -07:00
Tom Eastep
8dc88898c8 Tidy up the output of 'shorewall[6][-lite] show bl'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-10 17:22:22 -07:00
Tom Eastep
deaaecdf1c Add 'nodbl' interface option.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-10 16:09:39 -07:00
Tom Eastep
05e4049174 Ipset-based blacklisting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-10 16:07:56 -07:00
Tom Eastep
ef10515a42 Correct FASTACCEPT description
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-10 07:20:45 -07:00
Tom Eastep
5db6cb1b7d Correct load_ipsets()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-09 16:07:10 -07:00
Tom Eastep
76c8917aa7 Add a sixth parameter to Drop and Reject
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-08 09:10:45 -07:00
Tom Eastep
be58d530c4 Document 'logjump'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-08 09:09:59 -07:00
Tom Eastep
321476fd51 Tweak terminating() implementation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-08 08:24:57 -07:00
Tom Eastep
bd6b32eb25 Add a progress message for REJECT_ACTION processing
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-07 10:30:54 -07:00
Tom Eastep
4fdf54eca1 Tweak process_reject_action()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-07 10:02:48 -07:00
Tom Eastep
70bbd21b35 Ensure that the REJECT_ACTION is terminating
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-07 09:34:38 -07:00
Tom Eastep
87a9b95f73 Catch case where a transformed rule jumps to its own chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-07 08:58:50 -07:00
Tom Eastep
ecd7261365 Use -g when target is a terminating chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-07 08:48:36 -07:00
Tom Eastep
293cd1d66a Always go to the reject chain rather than jump to it
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-06 09:14:06 -07:00
Tom Eastep
436b5d89ce Correct comment
- The chain will only exist if logging wasn't specified for the same
  disposition.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-06 08:50:29 -07:00
Tom Eastep
26795cf082 Correct setup of $usedactions{A_REJECT}
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-06 08:18:36 -07:00
Tom Eastep
95e4071f34 Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code 2016-04-06 07:42:46 -07:00
Tuomo Soini
6366fb40cf ProxyARP.xml: fix proxyndp sample column matching
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-06 12:00:41 +03:00
Tuomo Soini
20179a5c9d remove completely false README.txt
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-06 10:23:58 +03:00
Tom Eastep
b7e6893f7d Restore DropUPnP behavior in Reject
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-05 20:00:15 -07:00
Tom Eastep
3ac3ae279f Add A_REJECT action
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-05 16:38:39 -07:00
Tom Eastep
54843c617d Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code 2016-04-05 11:46:42 -07:00
Tom Eastep
e9467326f3 Allow allow REJECT to take a parameter
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-05 11:20:44 -07:00
Tuomo Soini
80bf77e8a8 modules.xtables: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:31:36 +03:00
Tuomo Soini
1e5ebee799 modules.tc: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:31:36 +03:00
Tuomo Soini
74fe7b302e modules.ipset: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:31:36 +03:00
Tuomo Soini
d70e18535b modules.extensions: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:31:36 +03:00
Tuomo Soini
64a6b36918 modules.essential: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:31:36 +03:00
Tuomo Soini
35bc0bd8ef lib.base: format to new headers
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:27:47 +03:00
Tuomo Soini
4034ebc270 modules.xtables: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:25:36 +03:00
Tuomo Soini
bd33bb7105 modules.tc: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:25:36 +03:00
Tuomo Soini
dbb23d8807 modules.ipset: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:25:36 +03:00
Tuomo Soini
5c4ee58f44 modules.extensions: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:25:36 +03:00
Tuomo Soini
bf8b519da6 modules.essential: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:25:36 +03:00
Tuomo Soini
724d430ba4 action.template: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:20:55 +03:00
Tuomo Soini
11479b14f9 action.mangletemplate: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:20:55 +03:00
Tuomo Soini
54eea167e5 action.Broadcast: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:20:55 +03:00
Tuomo Soini
8d92d07352 action.AllowICMPs: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:20:55 +03:00
Tuomo Soini
6122a1db19 action.A_AllowICMPs: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:20:55 +03:00
Tuomo Soini
2962809243 action.Untracked: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
23a91d7c26 action.template: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
30b2b2dcb4 action.TCPFlags: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
46a86cfa58 action.SetEvent: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
ad2dfd9eaf action.RST: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
001aabf72c action.ResetEvent: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
7052819a9c action.Related: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
2b1244c110 action.Reject: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
94803b63b1 action.NotSyn: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
5f33cb5d0a action.New: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
deda26c790 action.mangletemplate: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
f9f349a148 action.Invalid: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
2842e897c9 action.IfEvent: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
de44a16094 action.GlusterFS: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
6560e74c2c action.Established: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
f7ddf3008d action.DropSmurfs: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
cb608172d3 action.dropInvalid: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
f806010521 action.Drop: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
205254e043 action.DNSAmp: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
a7efa12fff action.Broadcast: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
95c4f2d7f6 action.AutoBLL: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
89189f7836 action.AutoBL: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
c2e3156e5c action.A_Reject: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
ffe9f88c07 action.allowInvalid: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tuomo Soini
e4c9c83e2b action.A_Drop: reformat to new header style
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-04-05 20:13:55 +03:00
Tom Eastep
9a7f6512a1 Delete IPv6 actions that duplicate IPv4 actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-04 15:58:39 -07:00
Tom Eastep
77a93d10a4 Don't pass an argument to DropUPnP out of Drop and Reject
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-04 15:55:48 -07:00
Tom Eastep
a96ee0ab9a Make IPv6 Auth default consistent with IPv4
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-04 12:59:09 -07:00
Tom Eastep
646572098c Update IPv6 Article
- Remove 'No NAT' bullet

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-04 12:55:37 -07:00
Tom Eastep
75df718865 Reword comment in push_action_params()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-04 09:41:28 -07:00
Tom Eastep
ae8e2f70ea Efficiency change to known_interface()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-03 17:34:02 -07:00
Tom Eastep
39f5b77e5f Fix known_interface()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-03 16:31:45 -07:00
Tom Eastep
cb5a2519f3 Keep hyphens in @chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-03 16:30:31 -07:00
Tom Eastep
4151f7c504 Revert change to log_[i]rule_limit
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-03 16:29:52 -07:00
Tom Eastep
054837aeea Use the real chain name in log messages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-03 13:04:25 -07:00
Tom Eastep
ebf55a84f0 Correct trace instructions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-03 12:47:28 -07:00
Tom Eastep
b637d303b9 Correct use of a physical interface name in the hosts file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-02 17:27:20 -07:00
Tom Eastep
0dbf42424d Make physical name a synonym for the correcponding logical name.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-02 10:04:05 -07:00
Tom Eastep
f22e8d6d55 Allow physical interface to work in the ecn file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-01 15:10:49 -07:00
Tom Eastep
d98305c6f4 Correct default for MINIUPNOD
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-01 12:20:42 -07:00
Tom Eastep
3cbfdadb32 Merge branch '5.0.7' 2016-04-01 09:46:53 -07:00
Tom Eastep
81d76e3817 Document + in the MODULESDIR setting.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-01 09:43:06 -07:00
Tom Eastep
df1b1f6768 Add MINIUPNPD option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-01 08:57:08 -07:00
Tom Eastep
3881b38e02 Fix similar INTERFACE column issue in the nat and netmap files.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-31 14:16:43 -07:00
Tom Eastep
8a8f3b6f59 Merge branch '5.0.7' 2016-03-31 12:55:16 -07:00
Tom Eastep
b9bed00123 Correct handling of a physical name in a masq rule
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-31 12:52:30 -07:00
Tom Eastep
38aa7797c4 Allow protocol and user lists in actions and macros
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-30 08:34:42 -07:00
Tom Eastep
404540ffe1 Merge branch '5.0.7' 2016-03-30 08:17:19 -07:00
Tom Eastep
dd3c0daa08 Handle inline matches correctly in the mangle file
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-29 13:33:47 -07:00
Tom Eastep
4fddfcfba0 More complete fix for inline matches
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-29 13:15:01 -07:00
Tom Eastep
421d5f6043 Move Raw matches to last.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-29 09:31:27 -07:00
Tom Eastep
382ab380a2 Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code 2016-03-29 07:36:49 -07:00
Tuomo Soini
2342c7cd9c Perl/Shorewall/Chains.pm: Fix warning with older perl 2016-03-29 09:58:33 +03:00
Tom Eastep
66ae4975b2 Allow :R with DIVERT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-28 15:52:49 -07:00
Tom Eastep
5b7a9db170 Correct clearing of inline matches
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-28 15:48:59 -07:00
Roberto C. Sánchez
899a317c95 Fix typos 2016-03-26 22:25:30 -04:00
Tom Eastep
89adc3ea68 Use an address variable rather than find_first_interface_address()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-26 13:13:15 -07:00
Tom Eastep
ad87d94e33 Small efficiency change
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-26 13:12:33 -07:00
Tom Eastep
8a6941707a Updates to the config basics article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-26 09:01:02 -07:00
Tom Eastep
0b049a55e0 Correct Three-interface doc.
- find_interface_address -> find_first_interface_address
2016-03-25 09:34:49 -07:00
Tom Eastep
f86abf9552 Eliminate @columnstack -- simple save the columns array on the call stack.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-22 10:49:40 -07:00
Tom Eastep
9fe1a34412 Tighten up editing of configuration options
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-21 12:03:45 -07:00
Tom Eastep
abe533b6e3 Correct the action on ingress filters
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-19 13:45:33 -07:00
Tom Eastep
1c3140789c Add stab to ingress qdiscs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-19 13:25:39 -07:00
Tom Eastep
0399a346d0 Replace a silly line of code.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-19 12:05:45 -07:00
Tom Eastep
6ed3861d76 Correct Mangle Action Handling for second visit to the same action
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 15:25:52 -07:00
Tom Eastep
7a18847c14 Correct handling of log level in a _DEFAULT setting.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 15:25:14 -07:00
Tom Eastep
273c89a753 Implement MARK and CONNMARK in the rules file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 11:42:58 -07:00
Tom Eastep
2bebf1c95a Make '&' and '|' work with CONNMARK
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 11:30:52 -07:00
Tom Eastep
18573037f9 More 'check -r' fixes around Docker
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 11:09:39 -07:00
Tom Eastep
818628138b Add MARK and CONNMARK to the %targets table
- Also, sort the table entries

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 10:21:35 -07:00
Tom Eastep
2adec0eb65 Implement a filename cache for find_file()
- Don't need to search the CONFIG_PATH for re-open of same file.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 09:45:41 -07:00
Tom Eastep
6ae94767b7 Correct a comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-18 08:31:52 -07:00
Tom Eastep
9f26c010ac Remove embedded Perl from allowInvalid and dropInvalid
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-17 08:59:29 -07:00
Tom Eastep
9ab2310dc8 Correct an incorrect comment in process_rules()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-17 08:47:33 -07:00
Tom Eastep
0b5d59870b Remove embedded Perl from Shorewall6 Drop and Reject actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-16 15:07:59 -07:00
Tom Eastep
c9c5f0174c Remove trailing blank lines from action.TCPFlags 2016-03-16 14:54:05 -07:00
Tom Eastep
5fc391cb58 Document passed() in the config basics document
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-15 15:19:21 -07:00
Tom Eastep
da0653cb2f Declare passed() in Shorewall::User rather than importing it from Config
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-15 14:16:15 -07:00
Tom Eastep
65ce6ed226 Update modules to use passed() for parameter testing
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-15 12:06:32 -07:00
Tom Eastep
eb9dd3e485 Implement passed() in Config.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-15 12:00:56 -07:00
Tom Eastep
796f191d48 Don't re-stat action files in process_action()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-15 09:03:36 -07:00
Tom Eastep
71c26beab4 Remove dead code (caused by bad test)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 17:56:34 -07:00
Tom Eastep
6f04902963 Make use of 'state=' in actions a fatal error
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 17:55:54 -07:00
Tom Eastep
bd2295c4c3 Avoid embedded Perl in the Broadcast action when ADDRTYPE is available
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 15:57:32 -07:00
Tom Eastep
901c6d34f6 Correct typo in Rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 15:56:57 -07:00
Tom Eastep
741da14789 Ignore 'state' in the actions file with a warning
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 15:46:29 -07:00
Tom Eastep
34c3828b7c Fix action.Related
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 15:44:16 -07:00
Tom Eastep
eed7692952 Document the state action option.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 15:15:32 -07:00
Tom Eastep
3c544b20e6 Convert the state actions to use the 'state' action option
- Also avoid the CLI having to know about builtin actions

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 14:54:09 -07:00
Tom Eastep
dd547c90a8 Implement the 'state' action option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 14:30:36 -07:00
Tom Eastep
35fac8c2ea Avoid repeated %actions lookup in process_action()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 12:37:45 -07:00
Tom Eastep
513b828788 Pass '$prerule' to process_inline()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 10:56:07 -07:00
Tom Eastep
28e0cb5335 Use filename stored in the actions table
- Avoid a find_file call on each action invocation

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 10:55:39 -07:00
Tom Eastep
c631173310 Eliminate the %inlines table
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-14 10:47:18 -07:00
Tom Eastep
95da427ea8 Update manpages for 'audit' actions.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 15:53:31 -07:00
Tom Eastep
2c14b7c9e3 Rename %actparms to %actparams
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 15:36:38 -07:00
Tom Eastep
8e7af2e95e Additional editing of audit action parameters.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 15:28:49 -07:00
Tom Eastep
6be4fd377f Make RST and NotSyn 'audit' actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 14:40:12 -07:00
Tom Eastep
44c0bffcd3 Add 'audit' option to actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 14:39:46 -07:00
Tom Eastep
2c3644a510 Make Action/Inline binary options into a bitmap
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 14:15:43 -07:00
Tom Eastep
407bc8f8db More prerule fixes in expand_rule()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 12:57:23 -07:00
Tom Eastep
2743a411ae Add a jump to DOCKER from OUTPUT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 12:51:36 -07:00
Tom Eastep
1a23e840d7 Restore NotSyn rule in action.Reject
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 12:21:24 -07:00
Tom Eastep
bed747c20b Restore NotSyn and RST logic using perl_action_tcp_helper()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 10:49:23 -07:00
Tom Eastep
c2fd48c4c6 Include pre-rule matches when the target is a chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 10:08:17 -07:00
Tom Eastep
054637880b Cleanup of Standard Actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-13 10:06:02 -07:00
Tom Eastep
5f01bc75bd Better fix for $current_param in the INLINE block of process_rule()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 18:28:27 -08:00
Tom Eastep
0e59b82503 Handle '+' in inline matches the mangle and masq files
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 17:14:15 -08:00
Tom Eastep
33343aaf17 Modify TCP-specific actions to use + in inline_matches
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 17:01:52 -08:00
Tom Eastep
90ace544eb Implement '+' to specify inline matches as "early"
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 16:39:46 -08:00
Tom Eastep
c36cee28fb Save/Restore $current_param in process_inline()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 16:39:08 -08:00
Tom Eastep
df5f34951c Correct actions
- Restore the TCP-related actions
- Correct typo in action.Drop

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 15:09:31 -08:00
Tom Eastep
ec2ebee0e6 Clear inline matches between calls to process_rule()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 15:08:47 -08:00
Tom Eastep
a50c52675b Correct a comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 15:08:04 -08:00
Tom Eastep
bb7b3123df Eliminate ?begin perl ... ?end Perl in many actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 12:15:07 -08:00
Tom Eastep
3960fa6e0e Performance tweak to read_a_line()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-12 09:05:30 -08:00
Tom Eastep
a7fda02d88 Print lines copied into the generated script when tracing
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-11 15:59:49 -08:00
Tom Eastep
68a324c62c Small tweaks to read_a_line()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-11 13:56:03 -08:00
Tom Eastep
d179615fca 'trace' and 'check -r' uses $PAGER
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-11 13:26:23 -08:00
Tom Eastep
6779c8307f Optimize chain resolution in process_mangle_rule1()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-10 15:26:52 -08:00
Tom Eastep
147c7e284f Fix a couple of Mangle Action blunders
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-10 13:59:29 -08:00
Tom Eastep
8d657775af Fix 'check -r'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-10 13:41:59 -08:00
Tom Eastep
b14bf0e779 Remove unused globals from the Rules module
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-10 11:14:51 -08:00
Tom Eastep
dc286c472c More tidying up of Mangle Actions
- Delete an inadvertently-added blank line
- Move $convert declaration back to the Tc module
- Add comments in the Tc module about key moved declarations

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-09 15:51:54 -08:00
Tom Eastep
87f63b7160 Allow USE_DEFAULT_RT with NetworkManager
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-09 14:17:40 -08:00
Tom Eastep
617218f8ea Merge branch '5.0.6' 2016-03-09 11:36:46 -08:00
Tom Eastep
09c3be0adb Correct typo that cases restart failure.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-09 11:18:05 -08:00
Tom Eastep
ec9148637f Inline mangle actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-09 10:28:02 -08:00
Tom Eastep
991d8d2d3f Move convert_tos() back to the Tc module
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-08 11:17:14 -08:00
Tom Eastep
301bce5d34 Clean up mangle actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-08 09:27:43 -08:00
Tom Eastep
1add0487f6 Document Mangle Actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-07 14:56:20 -08:00
Tom Eastep
a4aa020a84 Add R chain designator
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-07 13:51:49 -08:00
Tom Eastep
81c16d2d67 More Mangle Action Changes
- Move open_mangle_for_output() back to the Tc module
- Eliminate global variables in process_mangle_rule1()
- Allow creation of mangle action chains
- Minor (but needed) logic changes

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-07 13:51:28 -08:00
Tom Eastep
bbbf54f7c3 Merge branch '5.0.6' 2016-03-07 08:59:17 -08:00
Tom Eastep
c37e41ee9c Avoid duplicate route rules from 'disable'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-06 15:48:33 -08:00
Tom Eastep
ba6dc9c5c0 First cut at mangle actions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-06 12:42:22 -08:00
Tom Eastep
89b2c2fb55 Move mangle processing into the Rules module
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-06 08:59:37 -08:00
Tom Eastep
43a81e85f7 Add FAQ 1105 (Wifidog)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-05 16:34:01 -08:00
Tom Eastep
c5bb04dcb2 Add FAQ 1105 (Wifidog)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-05 14:41:30 -08:00
Tom Eastep
d4e2508a90 Clarify USE_DEFAULT_RT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-04 14:26:42 -08:00
Tom Eastep
2bb143b28c Save/restore nat OUTPUT jump to DOCKER
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-04 12:21:45 -08:00
Tom Eastep
99f83da3ab Avoid duplicate rules after reload
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-04 11:09:53 -08:00
Tom Eastep
89e3e959dc Revert bad change
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-04 10:20:55 -08:00
Tom Eastep
9e41264671 Go back to generating docker0 rules when it is defined to Shorewall
- Avoids issues after 'stop'

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-04 09:27:47 -08:00
Tom Eastep
3fb715740d Avoid duplicated code blocks in save_dynamic_chains()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-04 09:27:04 -08:00
Tom Eastep
ed6ff96aa0 Replace another $VARDIR instance
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-03 14:11:57 -08:00
Tom Eastep
18dac19d86 Remove dead code from save_dynamic_chains()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-03 14:09:55 -08:00
Tom Eastep
d5ea876e93 Replace $VARDIR with ${VARDIR} for consistency
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-03 11:54:14 -08:00
Tom Eastep
f7a6ad1412 Clean up formatting in define_firewall() and stop_firewall()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-03 09:24:43 -08:00
Tom Eastep
b279869629 Fix DOCKER issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-02 20:59:44 -08:00
Tom Eastep
62880bdf1b Don't populate PAGER in the sample config files.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-02 13:04:47 -08:00
Tom Eastep
c56ba534d6 Yet more PAGER fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-02 12:34:39 -08:00
Tom Eastep
90bc894200 More PAGER fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-02 08:58:26 -08:00
Tom Eastep
90d254f0c3 Add PAGER option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-02 08:32:49 -08:00
Tom Eastep
4e9f4742cb Merge branch 'master' into 5.0.6 2016-03-01 15:13:20 -08:00
Tom Eastep
a95de8d092 Page the output of verbose commands
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-03-01 15:12:54 -08:00
Tom Eastep
68cce5ff73 Eliminate some sillyness in normalize_action()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-29 11:17:15 -08:00
Tom Eastep
8a02624f05 Update copyrights in the install and uninstall scripts
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-29 11:03:09 -08:00
Tom Eastep
1c1881859f Delete untrue comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-29 08:45:47 -08:00
Tom Eastep
5b163e9bc2 Save/restore docker0 rules when it isn't defined to Shorewall
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-27 14:09:29 -08:00
Tom Eastep
71d64ab380 Add DOCKER network support
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-27 13:36:47 -08:00
Tom Eastep
64de3d0e83 Add Docker article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-26 15:30:39 -08:00
Tom Eastep
36d8518562 Code compaction
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-26 13:13:56 -08:00
Tom Eastep
6c88eb6916 Add an ECN action to shorewall-mangle(8)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-26 09:33:16 -08:00
Tom Eastep
fb03fd0a5c Correct another silly typo -- this time in allowBcast()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-26 08:00:27 -08:00
Tom Eastep
d50ba365fb Correct silly typo in setup_ecn()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-26 08:00:17 -08:00
Tom Eastep
f265596613 Add sample ulogd.conf file to the logging article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-25 14:01:37 -08:00
Tom Eastep
6e1cc0f1d0 Correct stop/start Docker handling
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-25 13:37:44 -08:00
Tom Eastep
ee5ef07035 Correct another silly typo -- this time in allowBcast()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-24 14:58:10 -08:00
Tom Eastep
3c8696b91d Correct silly typo in setup_ecn()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-24 09:35:13 -08:00
Tom Eastep
fd4de0c66a Create more compact DOCKER conditional rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-22 14:46:35 -08:00
Tom Eastep
49536562e2 Emit more compact code when conditionally adding DOCKER chains
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-22 13:49:22 -08:00
Tom Eastep
36b6863b02 Update copyright date on lib.core
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-22 13:48:48 -08:00
Tom Eastep
6a8e280483 Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code 2016-02-21 12:59:10 -08:00
Tom Eastep
63b501996e Require ADDRTYPE for DOCKER=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-21 12:26:39 -08:00
Tom Eastep
7a9e9ad945 Decommit DOCKER=Yes in IPv6.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-21 12:03:41 -08:00
Tom Eastep
f4312a38b9 Add all Docker rules in the stopped state
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-21 10:33:45 -08:00
Tom Eastep
fc6a1f6d0d Don't create Docker chains/rules if Docker isn't running
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-21 09:54:37 -08:00
Tom Eastep
83b899b030 Save/Restore Docker-generated rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-20 14:02:54 -08:00
Tom Eastep
61f6cacc30 Infrastructure required by Docker
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-20 14:01:48 -08:00
Tom Eastep
caba1cd770 DOCKER=Yes requires IPTABLES_S
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-20 10:03:06 -08:00
Tom Eastep
4306ff1029 Correct 'save_dynamic_chains'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-20 09:57:11 -08:00
Tom Eastep
663f82c158 Move nat POSTROUTING rules to SHOREWALL if DOCKER=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-20 09:24:06 -08:00
Tuomo Soini
b39639e1f2 macro.SNMPtrap: fix file name to use common naming
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2016-02-20 18:45:55 +02:00
Tom Eastep
e66d9f6547 Add DOCKER option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 17:42:54 -08:00
Tom Eastep
2ee1d11f94 Cleanup of ORIGINAL DEST column references
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 12:40:36 -08:00
Tom Eastep
016acfb9de Final cleanup of PORT(S) column headings
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 12:31:53 -08:00
Tom Eastep
665381f194 Remove 'LAST LINE' anachronisms
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 12:04:32 -08:00
Tom Eastep
b6af7a0ebb Update the packet marking article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 11:16:24 -08:00
Tom Eastep
839f7f3329 Correct policy file column heading names
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 11:04:20 -08:00
Tom Eastep
0a73d365dd Update three-interface guide for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 11:02:48 -08:00
Tom Eastep
749fdfa5af Update Xen articles for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:46:36 -08:00
Tom Eastep
e36bf75f9f Update the whitelisting article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:29:41 -08:00
Tom Eastep
bc50c45e63 Update the Vserver article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:26:10 -08:00
Tom Eastep
9203c8a4a9 Update the VPN Basics document for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:23:24 -08:00
Tom Eastep
02ab9cd4ac Update the UPnP doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:19:27 -08:00
Tom Eastep
1dff1444dd Update the Universal guide for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:17:34 -08:00
Tom Eastep
3562a5b1bd Update the two-interface guide for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:17:20 -08:00
Tom Eastep
b73fb58745 Update the Traffic Shaping article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 10:17:05 -08:00
Tom Eastep
26f760b761 Update start/stop article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:57:15 -08:00
Tom Eastep
b95a15631c Update standalone article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:51:16 -08:00
Tom Eastep
60f319a718 Update Simple Bridge article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:46:23 -08:00
Tom Eastep
ce47ea7ec7 Update simple TC article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:33:19 -08:00
Tom Eastep
e60c230140 Update the Squid document for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:30:28 -08:00
Tom Eastep
491d55b04a Correct NAT file column heading
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:22:15 -08:00
Tom Eastep
ccb5f6b052 Modify the Setup Guide for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:20:47 -08:00
Tom Eastep
c3d005526c Update Logging article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:07:06 -08:00
Tom Eastep
909822230b Fix tunnels file column headings
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:03:09 -08:00
Tom Eastep
6cba78e89a Update Aliased Interface article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-19 09:02:44 -08:00
Tom Eastep
abc29f0f91 Update the Samba article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 16:25:30 -08:00
Tom Eastep
a1ad796469 Update QOS example for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 16:20:08 -08:00
Tom Eastep
c4e1cf2c2e Update the Proxy ARP article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:59:58 -08:00
Tom Eastep
8fd7de3900 Update the ports article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:57:40 -08:00
Tom Eastep
4050aa5180 Update the Port Knocking article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:54:32 -08:00
Tom Eastep
0e2a3f7265 Update the ping article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:52:29 -08:00
Tom Eastep
ed29505f67 Update the OpenVZ article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:50:48 -08:00
Tom Eastep
44813f75fd Update the OpenVPN article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:45:02 -08:00
Tom Eastep
9cae0243a5 Update NAT article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:21:34 -08:00
Tom Eastep
6a8a229342 Update My Network article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:19:06 -08:00
Tom Eastep
d88a00d0cb Update multi-zone article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 15:12:47 -08:00
Tom Eastep
477a5eb36a Update Multi-ISP doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 10:01:33 -08:00
Tom Eastep
4640e4c51e Update MAC doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 09:46:35 -08:00
Tom Eastep
b4c4fd2efb Update the laptop article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 09:38:50 -08:00
Tom Eastep
3277bd991b Update ipset doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 09:10:41 -08:00
Tom Eastep
745e04823d Update the IPSEC doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 09:06:09 -08:00
Tom Eastep
0a8905f25b Update configuration basics doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-18 08:56:11 -08:00
Tom Eastep
353d4d1b70 Update Helpers doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 16:32:29 -08:00
Tom Eastep
94f2f5aaab Update the FTP article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 16:27:46 -08:00
Tom Eastep
a959c4a3bb Update the Events document for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 16:18:33 -08:00
Tom Eastep
340ae1cca1 Update Dynamic Zone document for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 16:01:21 -08:00
Tom Eastep
0b1588207d Update the DHCP document for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 15:58:37 -08:00
Tom Eastep
9e6109bc36 Update the Bridge document for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 15:55:21 -08:00
Tom Eastep
a47cfb4f63 Update the blacklisting article for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 15:48:10 -08:00
Tom Eastep
6599425ce9 Update the anatomy doc for 5.0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 15:32:47 -08:00
Tom Eastep
0a2dc77be0 Update the Actions document
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 15:32:24 -08:00
Tom Eastep
f33f333937 Make 'default' and 'none' case insensitive in the GATEWAY column
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 15:25:46 -08:00
Tom Eastep
5fc242f760 Use new column names in action.template
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 15:13:42 -08:00
Tom Eastep
94cfe54f92 Allow routing tables with no default route
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-02-17 11:49:09 -08:00
175 changed files with 6152 additions and 4994 deletions

View File

@@ -2,7 +2,7 @@
#
# Script to install Shoreline Firewall Core Modules
#
# (c) 2000-2011,2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.net
#

View File

@@ -266,7 +266,7 @@ search_log() # $1 = IP address to search for
#
# Show traffic control information
#
show_tc() {
show_tc1() {
show_one_tc() {
local device
@@ -292,6 +292,19 @@ show_tc() {
}
show_tc() {
echo "$g_product $SHOREWALL_VERSION Traffic Control at $g_hostname - $(date)"
echo
shift
if [ -z "$1" ]; then
$g_tool -t mangle -L -n -v | $output_filter
echo
fi
show_tc1 $1
}
#
# Show classifier information
#
@@ -326,7 +339,15 @@ show_classifiers() {
#
# Display blacklist chains
#
blacklist_filter() {
awk \
'BEGIN { prnt=0; }; \
/^Members:/ { print "Dynamic:"; prnt=1; next; }; \
{ if (prnt == 1) print; };'
}
show_bl() {
[ -n "$g_blacklistipset" ] && ipset -L $g_blacklistipset | blacklist_filter && echo
$g_tool -L $g_ipt_options | \
awk 'BEGIN {prnt=0; };
/^$/ {if (prnt == 1) print ""; prnt=0; };
@@ -909,25 +930,208 @@ show_events() {
}
show_actions() {
echo "A_ACCEPT # Audit and accept the connection"
echo "A_DROP # Audit and drop the connection"
echo "A_REJECT # Audit and reject the connection "
echo "allowBcast # Silently Allow Broadcast/multicast"
echo "allowInvalid # Accept packets that are in the INVALID conntrack state."
echo "allowinUPnP # Allow UPnP inbound (to firewall) traffic"
echo "allowoutUPnP # Allow traffic from local command 'upnpd' (does not work with kernels after 2.6.13)"
echo "dropBcast # Silently Drop Broadcast/multicast"
echo "dropInvalid # Silently Drop packets that are in the INVALID conntrack state"
echo "dropNotSyn # Silently Drop Non-syn TCP packets"
echo "forwardUPnP # Allow traffic that upnpd has redirected from"
echo "rejNotSyn # Silently Reject Non-syn TCP packets"
if [ -f ${g_confdir}/actions ]; then
cat ${g_sharedir}/actions.std ${g_confdir}/actions | grep -Ev '^\#|^$'
cat ${g_sharedir}/actions.std ${g_confdir}/actions | grep -Ev '^[#?[:space:]]|^$'
else
grep -Ev '^\#|^$' ${g_sharedir}/actions.std
grep -Ev '^[#?[:space:]]|^$' ${g_sharedir}/actions.std
fi
}
show_chain() {
echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $g_hostname - $(date)"
echo
show_reset
if [ $# -gt 0 ]; then
for chain in $*; do
$g_tool -t $table -L $chain $g_ipt_options | $output_filter
echo
done
else
$g_tool -t $table -L $g_ipt_options | $output_filter
fi
}
show_chains() {
echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $g_hostname - $(date)"
echo
show_reset
for chain in $*; do
$g_tool -t $table -L $chain $g_ipt_options | $output_filter
echo
done
}
show_table() {
echo "$g_product $SHOREWALL_VERSION $table Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t $table -L $g_ipt_options | $output_filter
}
show_nat() {
echo "$g_product $SHOREWALL_VERSION NAT Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t nat -L $g_ipt_options | $output_filter
}
show_raw() {
echo "$g_product $SHOREWALL_VERSION RAW Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t raw -L $g_ipt_options | $output_filter
}
show_rawpost() {
echo "$g_product $SHOREWALL_VERSION RAWPOST Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t rawpost -L $g_ipt_options | $output_filter
}
show_mangle() {
echo "$g_product $SHOREWALL_VERSION Mangle Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t mangle -L $g_ipt_options | $output_filter
}
show_classifiers_command() {
echo "$g_product $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)"
echo
show_classifiers
}
show_ip_addresses() {
echo "$g_product $SHOREWALL_VERSION IP at $g_hostname - $(date)"
echo
ip -$g_family addr list
}
show_routing_command() {
echo "$g_product $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
echo
show_routing
}
show_policies() {
echo "$g_product $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
echo
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies
}
show_ipa() {
echo "$g_product $SHOREWALL_VERSION per-IP Accounting at $g_hostname - $(date)"
echo
perip_accounting
}
show_arptables() {
echo "$g_product $SHOREWALL_VERSION arptables at $g_hostname - $(date)"
echo
$arptables -L -n -v
}
show_log() {
echo "$g_product $SHOREWALL_VERSION Log ($LOGFILE) at $g_hostname - $(date)"
echo
show_reset
host=$(echo $g_hostname | sed 's/\..*$//')
if [ $# -eq 2 ]; then
eval search_log $2
elif [ -n "$g_pager" ]; then
packet_log 100
else
packet_log 20
fi
}
show_connections() {
if [ $g_family -eq 4 ]; then
if [ -d /proc/sys/net/netfilter/ ]; then
local count
local max
count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
echo "$g_product $SHOREWALL_VERSION Connections ($count out of $max) at $g_hostname - $(date)"
else
echo "$g_product $SHOREWALL_VERSION Connections at $g_hostname - $(date)"
fi
echo
if qt mywhich conntrack ; then
shift
conntrack -f ipv4 -L $@ | show_connections_filter
else
[ $# -gt 1 ] && usage 1
if [ -f /proc/net/ip_conntrack ]; then
cat /proc/net/ip_conntrack | show_connections_filter
else
grep -v '^ipv6' /proc/net/nf_conntrack | show_connections_filter
fi
fi
elif qt mywhich conntrack ; then
shift
echo "$g_product $SHOREWALL_VERSION Connections at $g_hostname - $(date)"
echo
conntrack -f ipv6 -L $@ | show_connections_filter
else
[ $# -gt 1 ] && usage 1
if [ -f /proc/sys/net/netfilter/nf_conntrack_count -a -f /proc/sys/net/nf_conntrack ]; then
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
echo "$g_product $SHOREWALL_VERSION Connections ($count of $max) at $g_hostname - $(date)"
echo
grep '^ipv6' /proc/net/nf_conntrack | sed -r 's/0000:/:/g; s/:::+/::/g; s/:0+/:/g' | show_connections_filter
fi
fi
}
show_nfacct_command() {
echo "$g_product $SHOREWALL_VERSION NF Accounting at $g_hostname - $(date)"
echo
show_nfacct
}
show_events_command() {
echo "$g_product $SHOREWALL_VERSION events at $g_hostname - $(date)"
echo
show_events
}
show_blacklists() {
echo "$g_product $SHOREWALL_VERSION blacklist chains at $g_hostname - $(date)"
echo
show_bl;
}
show_actions_sorted() {
show_actions | sort
}
show_macros() {
for directory in $(split $CONFIG_PATH); do
temp=
for macro in ${directory}/macro.*; do
case $macro in
*\*)
;;
*)
if [ -z "$temp" ]; then
echo
echo "Macros in $directory:"
echo
temp=Yes
fi
show_macro
;;
esac
done
done
}
#
# Show Command Executor
#
@@ -1042,108 +1246,37 @@ show_command() {
case "$1" in
connections)
if [ $g_family -eq 4 ]; then
if [ -d /proc/sys/net/netfilter/ ]; then
local count
local max
count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
echo "$g_product $SHOREWALL_VERSION Connections ($count out of $max) at $g_hostname - $(date)"
else
echo "$g_product $SHOREWALL_VERSION Connections at $g_hostname - $(date)"
fi
echo
if qt mywhich conntrack ; then
shift
conntrack -f ipv4 -L $@ | show_connections_filter
else
[ $# -gt 1 ] && usage 1
if [ -f /proc/net/ip_conntrack ]; then
cat /proc/net/ip_conntrack | show_connections_filter
else
grep -v '^ipv6' /proc/net/nf_conntrack | show_connections_filter
fi
fi
elif qt mywhich conntrack ; then
shift
echo "$g_product $SHOREWALL_VERSION Connections at $g_hostname - $(date)"
echo
conntrack -f ipv6 -L $@ | show_connections_filter
else
[ $# -gt 1 ] && usage 1
if [ -f /proc/sys/net/netfilter/nf_conntrack_count -a -f /proc/sys/net/nf_conntrack ]; then
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
echo "$g_product $SHOREWALL_VERSION Connections ($count of $max) at $g_hostname - $(date)"
echo
grep '^ipv6' /proc/net/nf_conntrack | sed -r 's/0000:/:/g; s/:::+/::/g; s/:0+/:/g' | show_connections_filter
fi
fi
eval show_connections $@ $g_pager
;;
nat)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION NAT Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t nat -L $g_ipt_options | $output_filter
eval show_nat $g_pager
;;
raw)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION RAW Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t raw -L $g_ipt_options | $output_filter
eval show_raw $g_pager
;;
rawpost)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION RAWPOST Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t rawpost -L $g_ipt_options | $output_filter
eval show_rawpost $g_pager
;;
tos|mangle)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION Mangle Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t mangle -L $g_ipt_options | $output_filter
eval show_mangle $g_pager
;;
log)
[ $# -gt 2 ] && usage 1
setup_logread
echo "$g_product $SHOREWALL_VERSION Log ($LOGFILE) at $g_hostname - $(date)"
echo
show_reset
host=$(echo $g_hostname | sed 's/\..*$//')
if [ $# -eq 2 ]; then
search_log $2
else
packet_log 20
fi
eval show_log $g_pager
;;
tc)
[ $# -gt 2 ] && usage 1
echo "$g_product $SHOREWALL_VERSION Traffic Control at $g_hostname - $(date)"
echo
shift
if [ -z "$1" ]; then
$g_tool -t mangle -L -n -v | $output_filter
echo
fi
show_tc $1
eval show_tc $@ $g_pager
;;
classifiers|filters)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)"
echo
show_classifiers
eval show_classifiers_command $g_pager
;;
zones)
[ $# -gt 1 ] && usage 1
@@ -1173,22 +1306,18 @@ show_command() {
determine_capabilities
VERBOSITY=2
if [ -n "$g_filemode" ]; then
report_capabilities1
eval report_capabilities1 $g_pager
else
report_capabilities
eval report_capabilities $g_pager
fi
;;
ip)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION IP at $g_hostname - $(date)"
echo
ip -$g_family addr list
eval show_ip_addresses $g_pager
;;
routing)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
echo
show_routing
eval show_routing_command $g_pager
;;
config)
. ${g_sharedir}/configpath
@@ -1210,33 +1339,19 @@ show_command() {
;;
chain)
shift
echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $g_hostname - $(date)"
echo
show_reset
if [ $# -gt 0 ]; then
for chain in $*; do
$g_tool -t $table -L $chain $g_ipt_options | $output_filter
echo
done
else
$g_tool -t $table -L $g_ipt_options | $output_filter
fi
eval show_chain $@ $g_pager
;;
vardir)
echo $VARDIR;
;;
policies)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
echo
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies;
eval show_policies $g_pager
;;
ipa)
[ $g_family -eq 4 ] || usage 1
echo "$g_product $SHOREWALL_VERSION per-IP Accounting at $g_hostname - $(date)"
echo
[ $# -gt 1 ] && usage 1
perip_accounting
eval show_ipa $g_pager
;;
marks)
[ $# -gt 1 ] && usage 1
@@ -1246,17 +1361,13 @@ show_command() {
;;
nfacct)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION NF Accounting at $g_hostname - $(date)"
echo
show_nfacct
eval show_nfacct_command $g_pager
;;
arptables)
[ $# -gt 1 ] && usage 1
resolve_arptables
if [ -n "$arptables" -a -x $arptables ]; then
echo "$g_product $SHOREWALL_VERSION arptables at $g_hostname - $(date)"
echo
$arptables -L -n -v
eval show_arptables $g_pager
else
error_message "Cannot locate the arptables executable"
fi
@@ -1270,15 +1381,11 @@ show_command() {
;;
events)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION events at $g_hostname - $(date)"
echo
show_events
eval show_events_command $g_pager
;;
bl|blacklists)
[ $# -gt 1 ] && usage 1
echo "$g_product $SHOREWALL_VERSION blacklist chains at $g_hostname - $(date)"
echo
show_bl;
eval show_blacklists $g_pager
;;
opens)
[ $# -gt 1 ] && usage 1
@@ -1298,7 +1405,7 @@ show_command() {
case $1 in
actions)
[ $# -gt 1 ] && usage 1
show_actions | sort
eval show_actions_sorted $g_pager
return
;;
macro)
@@ -1315,25 +1422,7 @@ show_command() {
;;
macros)
[ $# -gt 1 ] && usage 1
for directory in $(split $CONFIG_PATH); do
temp=
for macro in ${directory}/macro.*; do
case $macro in
*\*)
;;
*)
if [ -z "$temp" ]; then
echo
echo "Macros in $directory:"
echo
temp=Yes
fi
show_macro
;;
esac
done
done
eval show_macros $g_pager
return
;;
esac
@@ -1353,20 +1442,11 @@ show_command() {
error_message "ERROR: Chain '$chain' is not recognized by $g_tool."
exit 1
fi
done
done
echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $g_hostname - $(date)"
echo
show_reset
for chain in $*; do
$g_tool -t $table -L $chain $g_ipt_options | $output_filter
echo
done
eval show_chains $@ $g_pager
else
echo "$g_product $SHOREWALL_VERSION $table Table at $g_hostname - $(date)"
echo
show_reset
$g_tool -t $table -L $g_ipt_options | $output_filter
eval show_table $g_pager
fi
;;
esac
@@ -1417,12 +1497,16 @@ dump_filter() {
;;
esac
$command $filter
eval $command $filter $g_pager
else
cat -
fi
}
dump_filter_wrapper() {
eval dump_filter $g_pager
}
#
# Dump Command Executor
#
@@ -1633,14 +1717,14 @@ do_dump_command() {
if [ -n "$TC_ENABLED" ]; then
heading "Traffic Control"
show_tc
show_tc1
heading "TC Filters"
show_classifiers
fi
}
dump_command() {
do_dump_command $@ | dump_filter
do_dump_command $@ | dump_filter_wrapper
}
#
@@ -3368,6 +3452,29 @@ reject_command() {
fi
}
blacklist_command() {
local family
[ $# -gt 0 ] || fatal_error "Missing address"
[ -z "$g_blacklistipset" ] && fatal_error "The blacklist command is not supported in the current $g_product configuration"
case ${IPSET:=ipset} in
*/*)
if [ ! -x "$IPSET" ]; then
fatal_error "IPSET=$IPSET does not exist or is not executable"
fi
;;
*)
IPSET="$(mywhich $IPSET)"
[ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located"
;;
esac
$IPSET -A $g_blacklistipset $@ || { error_message "ERROR: Address $1 not blacklisted"; return 1; }
return 0
}
save_command() {
local finished
finished=0
@@ -3700,6 +3807,55 @@ get_config() {
g_loopback=$(find_loopback_interfaces)
if [ -n "$PAGER" -a -t 1 ]; then
case $PAGER in
/*)
g_pager="$PAGER"
[ -f "$g_pager" ] || fatal_error "PAGER=$PAGER does not exist"
;;
*)
g_pager=$(mywhich pager 2> /dev/null)
[ -n "$g_pager" ] || fatal_error "PAGER=$PAGER does not exist"
;;
esac
[ -x "$g_pager" ] || fatal_error "PAGER $g_pager is not executable"
g_pager="| $g_pager"
fi
if [ -n "$DYNAMIC_BLACKLIST" ]; then
case $DYNAMIC_BLACKLIST in
[Nn]o)
DYNAMIC_BLACKLIST='';
;;
[Yy]es)
;;
ipset|ipset::*|ipset-only|ipset-only::*|ipset,src-dst|ipset-only,src-dst::*)
g_blacklistipset=SW_DBL$g_family
;;
ipset:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
ipset,src-dst:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset,src-dst:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
ipset-only:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
ipset-only,src-dst:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only,src-dst:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
*)
fatal_error "Invalid value ($DYNAMIC_BLACKLIST) for DYNAMIC_BLACKLIST"
;;
esac
fi
lib=$(find_file lib.cli-user)
[ -f $lib ] && . $lib
@@ -3726,7 +3882,7 @@ start_command() {
rc=$?
else
error_message "${VARDIR}/firewall is missing or is not executable"
logger -p kern.err "ERROR:$g_product start failed"
mylogger kern.err "ERROR:$g_product start failed"
rc=6
fi
@@ -3859,7 +4015,7 @@ restart_command() {
rc=$?
else
error_message "${VARDIR}/firewall is missing or is not executable"
logger -p kern.err "ERROR:$g_product $COMMAND failed"
mylogger kern.err "ERROR:$g_product $COMMAND failed"
rc=6
fi
@@ -3890,6 +4046,7 @@ usage() # $1 = exit status
echo "where <command> is one of:"
echo " add <interface>[:<host-list>] ... <zone>"
echo " allow <address> ..."
echo " blacklist <address> [ <option> ... ]"
ecko " [ check | ck ] [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ -i ] [ <directory> ]"
echo " clear"
ecko " [ compile | co ] [ -e ] [ -p ] [ -t ] [ -c ] [ -d ] [ -T ] [ -i ] [ <directory name> ] [ <path name> ]"
@@ -4040,6 +4197,8 @@ shorewall_cli() {
g_counters=
g_loopback=
g_compiled=
g_pager=
g_blacklistipset=
VERBOSE=
VERBOSITY=1
@@ -4231,6 +4390,13 @@ shorewall_cli() {
fatal_error "$g_product is not running"
fi
;;
blacklist)
get_config Yes
shift
[ -n "$g_nolock" ] || mutex_on
blacklist_command $@
[ -n "$g_nolock" ] || mutex_off
;;
run)
[ $# -gt 1 ] || fatal_error "Missing function name"
get_config Yes

View File

@@ -25,6 +25,22 @@
# scripts rather than loaded at run-time.
#
#########################################################################################
#
# Wrapper around logger that sets the tag according to $SW_LOGGERTAG
#
mylogger() {
local level
level=$1
shift
if [ -n "$SW_LOGGERTAG" ]; then
logger -p $level -t "$SW_LOGGERTAG" $*
else
logger -p $level $*
fi
}
#
# Issue a message and stop
#
@@ -33,24 +49,24 @@ startup_error() # $* = Error Message
echo " ERROR: $@: Firewall state not changed" >&2
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%b %d %T') "
timestamp="$(date +'%b %e %T') "
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
fi
case $COMMAND in
start)
logger -p kern.err "ERROR:$g_product start failed:Firewall state not changed"
mylogger kern.err "ERROR:$g_product start failed:Firewall state not changed"
;;
restart)
logger -p kern.err "ERROR:$g_product restart failed:Firewall state not changed"
mylogger kern.err "ERROR:$g_product restart failed:Firewall state not changed"
;;
restore)
logger -p kern.err "ERROR:$g_product restore failed:Firewall state not changed"
mylogger kern.err "ERROR:$g_product restore failed:Firewall state not changed"
;;
esac
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%b %d %T') "
timestamp="$(date +'%b %e %T') "
case $COMMAND in
start)

View File

@@ -2,7 +2,7 @@
#
# Script to back uninstall Shoreline Firewall
#
# (c) 2000-2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://www.shorewall.net
#
@@ -117,6 +117,7 @@ fi
echo "Uninstalling Shorewall Core $VERSION"
rm -rf ${SHAREDIR}/shorewall
rm -f ~/.shorewallrc
echo "Shorewall Core Uninstalled"

View File

@@ -1 +0,0 @@
This is the Shorewall-init stable 4.4 branch of Git.

View File

@@ -2,7 +2,7 @@
#
# Script to install Shoreline Firewall Init
#
# (c) 2000-20114 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
# (c) 2010 - Roberto C. Sanchez (roberto@connexer.com)
#
# Shorewall documentation is available at http://shorewall.net
@@ -572,9 +572,9 @@ if [ -z "$DESTDIR" ]; then
cant_autostart
fi
elif [ $HOST = openwrt -a -f ${CONFDIR}/rc.common ]; then
/etc/init.d/shorewall-inir enable
/etc/init.d/$PRODUCT enable
if /etc/init.d/shorewall-init enabled; then
echo "Shorrewall Init will start automatically at boot"
echo "$Product will start automatically at boot"
else
cant_autostart
fi

View File

@@ -2,7 +2,7 @@
#
# Script to back uninstall Shoreline Firewall
#
# (c) 2000-2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.sourceforge.net
#

View File

@@ -1 +0,0 @@
This is the Shorewall-lite stable 4.4 branch of Git.

View File

@@ -2,7 +2,7 @@
#
# Script to install Shoreline Firewall Lite
#
# (c) 2000-2011,2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.net
#
@@ -495,7 +495,7 @@ done
# Install the Man Pages
#
if [ -d manpages ]; then
if [ -d manpages -a -n "$MANDIR" ]; then
cd manpages
mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/

View File

@@ -47,6 +47,19 @@
<arg choice="plain"><replaceable>address</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall-lite</command>
<arg
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>blacklist</option></arg>
<arg choice="plain"><replaceable>address</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall-lite</command>
@@ -693,6 +706,25 @@
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">blacklist</emphasis>
<replaceable>address</replaceable> [ <replaceable>option</replaceable>
... ]</term>
<listitem>
<para>Added in Shorewall 5.0.8 and requires
DYNAMIC_BLACKLIST=ipset.. in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).
Causes packets from the given host or network
<replaceable>address</replaceable> to be dropped, based on the
setting of BLACKLIST in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5). The
<replaceable>address</replaceable> along with any
<replaceable>option</replaceable>s are passed to the <command>ipset
add</command> command.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">call <replaceable>function</replaceable> [
<replaceable>parameter</replaceable> ... ]</emphasis></term>
@@ -1553,6 +1585,34 @@
started.</para>
</refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>Two environmental variables are recognized by Shorewall-lite:</para>
<variablelist>
<varlistentry>
<term>SHOREWALL_INIT_SCRIPT</term>
<listitem>
<para>When set to 1, causes Std out to be redirected to the file
specified in the STARTUP_LOG option in <ulink
url="shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SW_LOGGERTAG</term>
<listitem>
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
value is passed to the logger utility in its -t (--tag)
option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>FILES</title>

View File

@@ -2,7 +2,7 @@
#
# Script to back uninstall Shoreline Firewall
#
# (c) 2000-2011,2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.sourceforge.net
#

View File

@@ -0,0 +1,9 @@
#
# Shorewall -- /usr/share/shorewall/macro.RedisCluster
#
# This macro handles Redis Cluster traffic.
#
###############################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
PARAM - - tcp 16379

View File

@@ -0,0 +1,9 @@
#
# Shorewall -- /usr/share/shorewall/macro.RedisSentinel
#
# This macro handles Redis Sentinel traffic.
#
###############################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
PARAM - - tcp 26379

View File

@@ -0,0 +1,9 @@
#
# Shorewall - /usr/share/shorewall/macro.SNMPtrap
#
# This macro deprecated by SNMPtrap.
#
###############################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
SNMPtrap

View File

@@ -59,21 +59,21 @@ our $acctable;
#
use constant {
LEGACY => 0,
PREROUTING => 1,
INPUT => 2,
OUTPUT => 3,
FORWARD => 4,
POSTROUTING => 5
LEGACY_SECTION => 0,
PREROUTING_SECTION => 1,
INPUT_SECTION => 2,
OUTPUT_SECTION => 3,
FORWARD_SECTION => 4,
POSTROUTING_SECTION => 5
};
#
# Map names to values
#
our %asections = ( PREROUTING => PREROUTING,
INPUT => INPUT,
FORWARD => FORWARD,
OUTPUT => OUTPUT,
POSTROUTING => POSTROUTING
our %asections = ( PREROUTING => PREROUTING_SECTION,
INPUT => INPUT_SECTION,
FORWARD => FORWARD_SECTION,
OUTPUT => OUTPUT_SECTION,
POSTROUTING => POSTROUTING_SECTION
);
#
@@ -157,7 +157,7 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
$jumpchainref = 0;
$asection = LEGACY if $asection < 0;
$asection = LEGACY_SECTION if $asection < 0;
our $disposition = '';

File diff suppressed because it is too large Load Diff

View File

@@ -95,7 +95,7 @@ sub generate_script_1( $ ) {
emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#";
copy $globals{SHAREDIRPL} . '/lib.core', 0;
copy2 $globals{SHAREDIRPL} . '/lib.common', 0;
copy2 $globals{SHAREDIRPL} . '/lib.common', $debug;
}
}
@@ -261,7 +261,15 @@ sub generate_script_2() {
'# The library requires that ${VARDIR} exist',
'#',
'[ -d ${VARDIR} ] || mkdir -p ${VARDIR}'
);
);
if ( $config{DOCKER} ) {
emit( '',
'chain_exists DOCKER nat && chain_exists DOCKER && g_docker=Yes',
);
emit( 'chain_exists DOCKER-ISOLATION && g_dockernetwork=Yes]' );
emit( '' );
}
pop_indent;
@@ -360,6 +368,7 @@ sub generate_script_3($) {
create_arptables_load( $test ) if $have_arptables;
create_chainlist_reload( $_[0] );
create_save_ipsets;
create_load_ipsets;
emit "#\n# Start/Reload the Firewall\n#";
@@ -398,7 +407,9 @@ sub generate_script_3($) {
'fi',
'' );
load_ipsets;
emit( 'load_ipsets' ,
'' );
create_nfobjects;
verify_address_variables;
save_dynamic_chains;
@@ -565,16 +576,16 @@ date > ${VARDIR}/restarted
case $COMMAND in
start)
logger -p kern.info "$g_product started"
mylogger kern.info "$g_product started"
;;
reloaded)
logger -p kern.info "$g_product reloaded"
reload)
mylogger kern.info "$g_product reloaded"
;;
refresh)
logger -p kern.info "$g_product refreshed"
mylogger kern.info "$g_product refreshed"
;;
restore)
logger -p kern.info "$g_product restored"
mylogger kern.info "$g_product restored"
;;
esac
EOF
@@ -859,10 +870,6 @@ sub compiler {
#
complete_policy_chains;
#
# Reject Action
#
process_reject_action if $config{REJECT_ACTION};
#
# Accounting.
#
setup_accounting if $config{ACCOUNTING};

View File

@@ -139,6 +139,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
push_action_params
pop_action_params
default_action_params
setup_audit_action
read_a_line
which
qt
@@ -160,6 +161,8 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
set_section_function
clear_section_function
directive_callback
add_ipset
all_ipsets
$product
$Product
@@ -185,7 +188,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
%helpers_enabled
%helpers_aliases
%actparms
%actparams
PARMSMODIFIED
USEDCALLER
@@ -343,7 +346,7 @@ our %capdesc = ( NAT_ENABLED => 'NAT',
=> 'Ipset Match nomatch',
IPSET_MATCH_COUNTERS
=> 'Ipset Match counters',
IPSET_V5 => 'Version 5 ipsets',
IPSET_V5 => 'Version 5 or later ipset',
CONNMARK => 'CONNMARK Target',
XCONNMARK => 'Extended CONNMARK Target',
CONNMARK_MATCH => 'Connmark Match',
@@ -552,7 +555,7 @@ our %compiler_params;
#
# Action parameters
#
our %actparms;
our %actparams;
our $parmsmodified;
our $usedcaller;
our $inline_matches;
@@ -670,6 +673,14 @@ our %variables; # Symbol table for expanding shell variables
our $section_function; #Function Reference for handling ?section
our $evals = 0; # Number of times eval() called out of evaluate_expression() or embedded_perl().
our %ipsets; # All required IPsets
#
# Files located via find_file()
#
our %filecache;
sub process_shorewallrc($$);
sub add_variables( \% );
#
@@ -736,6 +747,7 @@ sub initialize( $;$$) {
RPFILTER_LOG_TAG => '',
INVALID_LOG_TAG => '',
UNTRACKED_LOG_TAG => '',
POSTROUTING => 'POSTROUTING',
);
#
# From shorewall.conf file
@@ -874,6 +886,9 @@ sub initialize( $;$$) {
WORKAROUNDS => undef ,
LEGACY_RESTART => undef ,
RESTART => undef ,
DOCKER => undef ,
PAGER => undef ,
MINIUPNPD => undef ,
#
# Packet Disposition
#
@@ -1058,9 +1073,10 @@ sub initialize( $;$$) {
%compiler_params = ();
%actparms = ( 0 => 0, loglevel => '', logtag => '', chain => '', disposition => '', caller => '' );
%actparams = ( 0 => 0, loglevel => '', logtag => '', chain => '', disposition => '', caller => '' );
$parmsmodified = 0;
$usedcaller = 0;
%ipsets = ();
%helpers_enabled = (
amanda => 1,
@@ -1159,6 +1175,14 @@ sub initialize( $;$$) {
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
sub add_ipset( $ ) {
$ipsets{$_[0]} = 1;
}
sub all_ipsets() {
sort keys %ipsets;
}
#
# Create 'currentlineinfo'
#
@@ -1232,6 +1256,34 @@ sub shortlineinfo( $ ) {
sub handle_first_entry();
#
# Issue a Information Message
#
sub info_message
{
my $currentlineinfo = currentlineinfo;
our @localtime;
handle_first_entry if $first_entry;
$| = 1; #Reset output buffering (flush any partially filled buffers).
if ( $log ) {
@localtime = localtime;
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
}
if ( $confess ) {
print STDERR longmess( " INFO: @_$currentlineinfo" );
print $log longmess( " INFO: @_$currentlineinfo\n" ) if $log;
} else {
print STDERR " INFO: @_$currentlineinfo\n";
print $log " INFO: @_$currentlineinfo\n" if $log;
}
$| = 0; #Re-allow output buffering
}
#
# Issue a Warning Message
#
@@ -1466,9 +1518,9 @@ sub hex_value( $ ) {
# Strip off superfluous leading zeros from a hex number
#
sub normalize_hex( $ ) {
my $val = lc shift;
my $val = lc $_[0];
$val =~ s/^0// while $val =~ /^0/ && length $val > 1;
$val =~ s/^0+/0/;
$val;
}
@@ -1661,7 +1713,7 @@ sub progress_message {
@localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "${leading}${line}\n";
}
}
@@ -1680,7 +1732,7 @@ sub progress_message_nocompress {
@localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n";
}
}
@@ -1701,7 +1753,7 @@ sub progress_message2 {
@localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n";
}
}
@@ -1722,7 +1774,7 @@ sub progress_message3 {
@localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n";
}
}
@@ -1897,6 +1949,10 @@ sub find_file($)
return $filename if $filename =~ '/';
my $file = $filecache{$filename};
return $file if $file;
for my $directory ( @config_path ) {
my $file = "$directory$filename";
return $file if -f $file;
@@ -2147,6 +2203,12 @@ sub supplied( $ ) {
defined $val && $val ne '';
}
sub passed( $ ) {
my $val = shift;
defined $val && $val ne '' && $val ne '-';
}
#
# Pre-process a line from a configuration file.
@@ -2488,6 +2550,13 @@ sub directive_warning( $$$ ) {
( $currentfilename, $currentlinenumber ) = ( $savefilename, $savelineno );
}
sub directive_info( $$$ ) {
my ( $savefilename, $savelineno ) = ( $currentfilename, $currentlinenumber );
( my $info, $currentfilename, $currentlinenumber ) = @_;
info_message $info;
( $currentfilename, $currentlinenumber ) = ( $savefilename, $savelineno );
}
#
# Add quotes to the passed value if the passed 'first part' has an odd number of quotes
# Return an expression that concatenates $first, $val and $rest
@@ -2503,20 +2572,49 @@ sub join_parts( $$$ ) {
}
#
# Evaluate an expression in an ?IF, ?ELSIF or ?SET directive
# Declare passed() in Shorewall::User
#
sub evaluate_expression( $$$ ) {
my ( $expression , $filename , $linenumber ) = @_;
sub declare_passed() {
my $result = ( eval q(package Shorewall::User;
use strict;
sub passed( $ ) {
my $val = shift;
defined $val && $val ne '' && $val ne '-';
}
1;) );
assert( $result, $@ );
}
#
# Evaluate an expression in an ?IF, ?ELSIF, ?SET or ?ERROR directive
#
sub evaluate_expression( $$$$ ) {
my ( $expression , $filename , $linenumber, $just_expand ) = @_;
my $val;
my $count = 0;
my $chain = $actparms{chain};
my $chain = $actparams{chain};
# $1 $2
if ( $expression =~ /^(!)?\s*passed\([\$@](\d+)\)$/ ) {
my $val = passed($actparams{$2});
return $1 ? ! $val : $val unless $debug;
$val = $1 ? ! $val : $val;
print "EXPR=> '$val'\n" if $debug;
return $val;
}
# $1 $2 $3 - $4
while ( $expression =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) {
my ( $first, $var, $rest ) = ( $1, $3, $4);
if ( $var =~ /^\d+$/ ) {
fatal_error "Action parameters (\$$var) may only be referenced within the body of an action" unless $chain;
$val = $var ? $actparms{$var} : $actparms{0}->{name};
$val = $var ? $actparams{$var} : $actparams{0}->{name};
} else {
$val = ( exists $variables{$var} ? $variables{$var} :
exists $capdesc{$var} ? have_capability( $var ) : '' );
@@ -2531,7 +2629,7 @@ sub evaluate_expression( $$$ ) {
while ( $expression =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) {
my ( $first, $var, $rest ) = ( $1, $3, $4);
$var = numeric_value( $var ) if $var =~ /^\d/;
$val = $var ? $actparms{$var} : $chain;
$val = $var ? $actparams{$var} : $chain;
$usedcaller = USEDCALLER if $var eq 'caller';
$expression = join_parts( $first, $val, $rest );
directive_error( "Variable Expansion Loop" , $filename, $linenumber ) if ++$count > 100;
@@ -2562,13 +2660,19 @@ sub evaluate_expression( $$$ ) {
print "EXPR=> $expression\n" if $debug;
if ( $expression =~ /^\d+$/ ) {
if ( $just_expand || $expression =~ /^\d+$/ ) {
$val = $expression
} else {
#
# Not a simple one-term expression -- compile it
#
$val = eval qq(package Shorewall::User;\nuse strict;\n# line $linenumber "$filename"\n$expression);
declare_passed unless $evals++;
$val = eval qq(package Shorewall::User;
use strict;
# line $linenumber "$filename"
$expression);
unless ( $val ) {
directive_error( "Couldn't parse expression ($expression): $@" , $filename, $linenumber ) if $@;
@@ -2599,7 +2703,7 @@ sub process_compiler_directive( $$$$ ) {
print "CD===> $line\n" if $debug;
directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber ) unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*)(.*)$/i;
directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber ) unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*|ERROR\s+|WARNING\s+|INFO\s+)(.*)$/i;
my ($keyword, $expression) = ( uc $1, $2 );
@@ -2617,7 +2721,7 @@ sub process_compiler_directive( $$$$ ) {
my %directives =
( IF => sub() {
directive_error( "Missing IF expression" , $filename, $linenumber ) unless supplied $expression;
my $nextomitting = $omitting || ! evaluate_expression( $expression , $filename, $linenumber );
my $nextomitting = $omitting || ! evaluate_expression( $expression , $filename, $linenumber , 0 );
push @ifstack, [ 'IF', $omitting, ! $nextomitting, $linenumber ];
$omitting = $nextomitting;
} ,
@@ -2629,7 +2733,7 @@ sub process_compiler_directive( $$$$ ) {
#
# We can only change to including if we were previously omitting
#
$omitting = $prioromit || ! evaluate_expression( $expression , $filename, $linenumber );
$omitting = $prioromit || ! evaluate_expression( $expression , $filename, $linenumber, 0 );
$included = ! $omitting;
} else {
#
@@ -2665,15 +2769,17 @@ sub process_compiler_directive( $$$$ ) {
$var = $2;
$var = numeric_value( $var ) if $var =~ /^\d/;
$var = $2 || 'chain';
directive_error( "Shorewall variables may only be SET in the body of an action", $filename, $linenumber ) unless $actparms{0};
my $val = $actparms{$var} = evaluate_expression ( $expression,
directive_error( "Shorewall variables may only be SET in the body of an action", $filename, $linenumber ) unless $actparams{0};
my $val = $actparams{$var} = evaluate_expression ( $expression,
$filename,
$linenumber );
$linenumber,
0 );
$parmsmodified = PARMSMODIFIED;
} else {
$variables{$2} = evaluate_expression( $expression,
$filename,
$linenumber );
$linenumber,
0 );
}
}
} ,
@@ -2697,12 +2803,12 @@ sub process_compiler_directive( $$$$ ) {
if ( ( $1 || '' ) eq '@' ) {
$var = numeric_value( $var ) if $var =~ /^\d/;
$var = $2 || 'chain';
directive_error( "Shorewall variables may only be RESET in the body of an action", $filename, $linenumber ) unless $actparms{0};
if ( exists $actparms{$var} ) {
directive_error( "Shorewall variables may only be RESET in the body of an action", $filename, $linenumber ) unless $actparams{0};
if ( exists $actparams{$var} ) {
if ( $var =~ /^loglevel|logtag|chain|disposition|caller$/ ) {
$actparms{$var} = '';
$actparams{$var} = '';
} else {
delete $actparms{$var}
delete $actparams{$var}
}
} else {
directive_warning( "Shorewall variable $2 does not exist", $filename, $linenumber );
@@ -2733,7 +2839,34 @@ sub process_compiler_directive( $$$$ ) {
directive_error ( "?COMMENT is not allowed in this file", $filename, $linenumber );
}
}
}
} ,
ERROR => sub() {
directive_error( evaluate_expression( $expression ,
$filename ,
$linenumber ,
1 ) ,
$filename ,
$linenumber ) unless $omitting;
} ,
WARNING => sub() {
directive_warning( evaluate_expression( $expression ,
$filename ,
$linenumber ,
1 ),
$filename ,
$linenumber ) unless $omitting;
} ,
INFO => sub() {
directive_info( evaluate_expression( $expression ,
$filename ,
$linenumber ,
1 ),
$filename ,
$linenumber ) unless $omitting;
} ,
);
@@ -2790,6 +2923,11 @@ sub copy( $ ) {
print $script $_;
print $script "\n";
$lastlineblank = 0;
if ( $debug ) {
s/\n/\nGS-----> /g;
print "GS-----> $_\n";
}
}
}
@@ -3117,7 +3255,7 @@ sub embedded_shell( $ ) {
sub embedded_perl( $ ) {
my $multiline = shift;
my ( $command , $linenumber ) = ( qq(package Shorewall::User;\nno strict;\nuse Shorewall::Config (qw/shorewall/);\n# line $currentlinenumber "$currentfilename"\n$currentline), $currentlinenumber );
my ( $command , $linenumber ) = ( qq(package Shorewall::User;\nno strict;\n# line $currentlinenumber "$currentfilename"\n$currentline), $currentlinenumber );
$directive_callback->( 'PERL', $currentline ) if $directive_callback;
@@ -3144,6 +3282,8 @@ sub embedded_perl( $ ) {
$embedded++;
declare_passed unless $evals++;
unless (my $return = eval $command ) {
#
# Perl found the script offensive or the script itself died
@@ -3204,32 +3344,32 @@ sub push_action_params( $$$$$$ ) {
my ( $action, $chainref, $parms, $loglevel, $logtag, $caller ) = @_;
my @parms = ( undef , split_list3( $parms , 'parameter' ) );
$actparms{modified} = $parmsmodified;
$actparms{usedcaller} = $usedcaller;
$actparams{modified} = $parmsmodified;
$actparams{usedcaller} = $usedcaller;
my %oldparms = %actparms;
my %oldparms = %actparams;
$parmsmodified = 0;
$usedcaller = 0;
%actparms = ();
%actparams = ();
for ( my $i = 1; $i < @parms; $i++ ) {
my $val = $parms[$i];
$actparms{$i} = $val eq '-' ? '' : $val eq '--' ? '-' : $val;
$actparams{$i} = $val eq '-' ? '' : $val eq '--' ? '-' : $val;
}
$actparms{0} = $chainref;
$actparms{action} = $action;
$actparms{loglevel} = $loglevel;
$actparms{logtag} = $logtag;
$actparms{caller} = $caller;
$actparms{disposition} = '' if $chainref->{action};
$actparams{0} = $chainref;
$actparams{action} = $action;
$actparams{loglevel} = $loglevel;
$actparams{logtag} = $logtag;
$actparams{caller} = $caller;
$actparams{disposition} = '' if $chainref->{action};
#
# The Shorewall variable '@chain' has the non-word charaters removed
# The Shorewall variable '@chain' has non-word characters other than hyphen removed
#
( $actparms{chain} = $chainref->{name} ) =~ s/[^\w]//g;
( $actparams{chain} = $chainref->{name} ) =~ s/[^\w-]//g;
\%oldparms;
}
@@ -3242,10 +3382,10 @@ sub push_action_params( $$$$$$ ) {
#
sub pop_action_params( $ ) {
my $oldparms = shift;
%actparms = %$oldparms;
%actparams = %$oldparms;
my $return = $parmsmodified | $usedcaller;
( $parmsmodified ) = delete $actparms{modified} || 0;
( $usedcaller ) = delete $actparms{usedcaller} || 0;
( $parmsmodified ) = delete $actparams{modified} || 0;
( $usedcaller ) = delete $actparams{usedcaller} || 0;
$return;
}
@@ -3255,11 +3395,11 @@ sub default_action_params {
for ( $i = 1; 1; $i++ ) {
last unless defined ( $val = shift );
my $curval = $actparms{$i};
$actparms{$i} = $val unless supplied( $curval );
my $curval = $actparams{$i};
$actparams{$i} = $val unless supplied( $curval );
}
fatal_error "Too Many arguments to action $action" if defined $actparms{$i};
fatal_error "Too Many arguments to action $action" if defined $actparams{$i};
}
sub get_action_params( $ ) {
@@ -3270,53 +3410,65 @@ sub get_action_params( $ ) {
my @return;
for ( my $i = 1; $i <= $num; $i++ ) {
my $val = $actparms{$i};
my $val = $actparams{$i};
push @return, defined $val ? $val eq '-' ? '' : $val eq '--' ? '-' : $val : $val;
}
@return;
}
sub setup_audit_action( $ ) {
my ( $action ) = @_;
my ( $target, $audit ) = get_action_params( 2 );
if ( supplied $audit ) {
fatal_error "Invalid parameter ($audit) to action $action" if $audit ne 'audit';
fatal_error "Only ACCEPT, DROP and REJECT may be audited" unless $target =~ /^(?:A_)?(?:ACCEPT|DROP|REJECT)\b/;
$actparams{1} = "A_$target" unless $target =~ /^A_/;
}
}
#
# Returns the Level and Tag for the current action chain
#
sub get_action_logging() {
@actparms{ 'loglevel', 'logtag' };
@actparams{ 'loglevel', 'logtag' };
}
sub get_action_chain() {
$actparms{0};
$actparams{0};
}
sub get_action_chain_name() {
$actparms{chain};
$actparams{chain};
}
sub set_action_name_to_caller() {
$actparms{chain} = $actparms{caller};
$actparams{chain} = $actparams{caller};
}
sub get_action_disposition() {
$actparms{disposition};
$actparams{disposition};
}
sub set_action_disposition($) {
$actparms{disposition} = $_[0];
$actparams{disposition} = $_[0];
}
sub set_action_param( $$ ) {
my $i = shift;
fatal_error "Parameter numbers must be numeric" unless $i =~ /^\d+$/ && $i > 0;
$actparms{$i} = shift;
$actparams{$i} = shift;
}
#
# Expand Shell Variables in the passed buffer using %actparms, %params, %shorewallrc1 and %config,
# Expand Shell Variables in the passed buffer using %actparams, %params, %shorewallrc1 and %config,
#
sub expand_variables( \$ ) {
my ( $lineref, $count ) = ( $_[0], 0 );
my $chain = $actparms{chain};
my $chain = $actparams{chain};
# $1 $2 $3 - $4
while ( $$lineref =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) {
@@ -3330,16 +3482,16 @@ sub expand_variables( \$ ) {
if ( $config{IGNOREUNKNOWNVARIABLES} ) {
fatal_error "Invalid action parameter (\$$var)" if ( length( $var ) > 1 && $var =~ /^0/ );
} else {
fatal_error "Undefined parameter (\$$var)" unless ( defined $actparms{$var} &&
fatal_error "Undefined parameter (\$$var)" unless ( defined $actparams{$var} &&
( length( $var ) == 1 ||
$var !~ /^0/ ) );
}
$val = $var ? $actparms{$var} : $actparms{0}->{name};
$val = $var ? $actparams{$var} : $actparams{0}->{name};
} elsif ( exists $variables{$var} ) {
$val = $variables{$var};
} elsif ( exists $actparms{$var} ) {
$val = $actparms{$var};
} elsif ( exists $actparams{$var} ) {
$val = $actparams{$var};
$usedcaller = USEDCALLER if $var eq 'caller';
} else {
fatal_error "Undefined shell variable (\$$var)" unless $config{IGNOREUNKNOWNVARIABLES} || exists $config{$var};
@@ -3358,7 +3510,7 @@ sub expand_variables( \$ ) {
# $1 $2 $3 - $4
while ( $$lineref =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) {
my ( $first, $var, $rest ) = ( $1, $3, $4);
my $val = $var ? $actparms{$var} : $actparms{chain};
my $val = $var ? $actparams{$var} : $actparams{chain};
$usedcaller = USEDCALLER if $var eq 'caller';
$val = '' unless defined $val;
$$lineref = join( '', $first , $val , $rest );
@@ -3418,17 +3570,17 @@ sub handle_first_entry() {
sub read_a_line($) {
my $options = $_[0];
LINE:
while ( $currentfile ) {
$currentline = '';
$currentlinenumber = 0;
while ( <$currentfile> ) {
chomp;
#
# Handle conditionals
# Handle directives
#
if ( /^\s*\?(?:IF|ELSE|ELSIF|ENDIF|SET|RESET|FORMAT|COMMENT)/i ) {
if ( /^\s*\?(?:IF|ELSE|ELSIF|ENDIF|SET|RESET|FORMAT|COMMENT|ERROR|WARNING|INFO)/i ) {
$omitting = process_compiler_directive( $omitting, $_, $currentfilename, $. );
next;
}
@@ -3442,7 +3594,7 @@ sub read_a_line($) {
#
# Suppress leading whitespace in certain continuation lines
#
s/^\s*// if $currentline =~ /[,:]$/ && $options & CONFIG_CONTINUATION;
s/^\s*// if $currentline && $options & CONFIG_CONTINUATION && $currentline =~ /[,:]$/;
#
# If this is a continued line with a trailing comment, remove comment. Note that
# the result will now end in '\'.
@@ -3453,19 +3605,20 @@ sub read_a_line($) {
#
chop $currentline, next if ($currentline .= $_) =~ /\\$/;
#
# We now have a (possibly concatenated) line
# Must check for shell/perl before doing variable expansion
#
if ( $options & EMBEDDED_ENABLED ) {
if ( $currentline =~ s/^\s*\??(BEGIN\s+)SHELL\s*;?//i || $currentline =~ s/^\s*\?SHELL\s*//i || $currentline =~ s/^\s*SHELL\s+// ) {
handle_first_entry if $first_entry;
embedded_shell( $1 );
next;
}
if ( $currentline =~ s/^\s*\??(BEGIN\s+)PERL\s*;?//i || $currentline =~ s/^\s*\??PERL\s*//i ) {
handle_first_entry if $first_entry;
embedded_perl( $1 );
next;
next LINE;
}
if ( $currentline =~ s/^\s*\??(BEGIN\s+)SHELL\s*;?//i || $currentline =~ s/^\s*\?SHELL\s*//i || $currentline =~ s/^\s*SHELL\s+// ) {
handle_first_entry if $first_entry;
embedded_shell( $1 );
next LINE;
}
}
#
@@ -3477,7 +3630,7 @@ sub read_a_line($) {
#
# Ignore (concatinated) blank lines
#
$currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/;
next LINE if $currentline =~ /^\s*$/;
#
# Eliminate trailing whitespace
#
@@ -3488,7 +3641,7 @@ sub read_a_line($) {
#
handle_first_entry if $first_entry;
#
# Expand Shell Variables using %params and %actparms
# Expand Shell Variables using %params and %actparams
#
expand_variables( $currentline ) if $options & EXPAND_VARIABLES;
@@ -3508,18 +3661,16 @@ sub read_a_line($) {
push_include;
$currentfile = undef;
do_open_file $filename;
} else {
$currentlinenumber = 0;
}
$currentline = '';
} elsif ( ( $options & DO_SECTION ) && $currentline =~ /^\s*\?SECTION\s+(.*)/i ) {
my $sectionname = $1;
fatal_error "Invalid SECTION name ($sectionname)" unless $sectionname =~ /^[-_\da-zA-Z]+$/;
fatal_error "This file does not allow ?SECTION" unless $section_function;
$section_function->($sectionname);
$directive_callback->( 'SECTION', $currentline ) if $directive_callback;
$currentline = '';
next LINE;
} elsif ( ( $options & DO_SECTION ) && $currentline =~ /^\s*\?SECTION\s+(.*)/i ) {
my $sectionname = $1;
fatal_error "Invalid SECTION name ($sectionname)" unless $sectionname =~ /^[-_\da-zA-Z]+$/;
fatal_error "This file does not allow ?SECTION" unless $section_function;
$section_function->($sectionname);
$directive_callback->( 'SECTION', $currentline ) if $directive_callback;
next LINE;
} else {
fatal_error "Non-ASCII gunk in file" if ( $options && CHECK_GUNK ) && $currentline =~ /[^\s[:print:]]/;
print "IN===> $currentline\n" if $debug;
@@ -4809,8 +4960,16 @@ sub ensure_config_path() {
@config_path = split /:/, $config{CONFIG_PATH};
#
# To accomodate Cygwin-based compilation, we have separate directories for files whose names
# clash on a case-insensitive filesystem.
#
push @config_path, $globals{SHAREDIR} . "/deprecated";
push @config_path, $shorewallrc{SHAREDIR}. '/shorewall/deprecated' unless $globals{PRODUCT} eq 'shorewall';
for ( @config_path ) {
$_ .= '/' unless m|/$|;
s|//|/|g;
}
if ( $shorewall_dir ) {
@@ -4910,6 +5069,7 @@ sub update_config_file( $ ) {
update_default( 'USE_DEFAULT_RT', 'No' );
update_default( 'EXPORTMODULES', 'No' );
update_default( 'RESTART', 'reload' );
update_default( 'PAGER', '' );
my $fn;
@@ -5325,7 +5485,7 @@ sub get_params( $ ) {
#
delete $params{$_};
} else {
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' ) {
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' || $_ eq 'SW_LOGGERTAG' ) {
fatal_error "The variable name $_ is reserved and may not be set in the params file"
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_};
}
@@ -5765,16 +5925,21 @@ sub get_configuration( $$$$ ) {
unsupported_yes_no 'BRIDGING';
unsupported_yes_no_warning 'RFC1918_STRICT';
$val = $config{SAVE_IPSETS};
unless (default_yes_no 'SAVE_IPSETS', '', '*' ) {
$val = $config{SAVE_IPSETS};
unless ( $val eq 'ipv4' ) {
if ( $val eq 'ipv4' ) {
fatal_error 'SAVE_IPSETS=ipv4 is invalid in shorewall6.conf' if $family == F_IPV6;
} else {
my @sets = split_list( $val , 'ipset' );
$globals{SAVED_IPSETS} = \@sets;
require_capability 'IPSET_V5', 'A saved ipset list', 's';
$config{SAVE_IPSETS} = '';
}
require_capability( 'IPSET_V5', "SAVE_IPSETS=$val", 's' ) if $config{SAVE_IPSETS};
}
default_yes_no 'SAVE_ARPTABLES' , '';
default_yes_no 'STARTUP_ENABLED' , 'Yes';
default_yes_no 'DELAYBLACKLISTLOAD' , '';
@@ -5857,6 +6022,13 @@ sub get_configuration( $$$$ ) {
default_yes_no 'INLINE_MATCHES' , '';
default_yes_no 'BASIC_FILTERS' , '';
default_yes_no 'WORKAROUNDS' , 'Yes';
default_yes_no 'DOCKER' , '';
if ( $config{DOCKER} ) {
fatal_error "DOCKER=Yes is not allowed in Shorewall6" if $family == F_IPV6;
require_capability( 'IPTABLES_S', 'DOCKER=Yes', 's' );
require_capability( 'ADDRTYPE', ' DOCKER=Yes', 's' );
}
if ( supplied( $val = $config{RESTART} ) ) {
fatal_error "Invalid value for RESTART ($val)" unless $val =~ /^(restart|reload)$/;
@@ -5898,7 +6070,33 @@ sub get_configuration( $$$$ ) {
$config{ACCOUNTING_TABLE} = 'filter';
}
default_yes_no 'DYNAMIC_BLACKLIST' , 'Yes';
if ( supplied( $val = $config{DYNAMIC_BLACKLIST} ) ) {
if ( $val =~ /^ipset/ ) {
my ( $key, $set, $level, $tag, $rest ) = split( ':', $val , 5 );
fatal_error "Invalid DYNAMIC_BLACKLIST setting ( $val )" if $key !~ /^ipset(?:-only)?(?:,src-dst)?$/ || defined $rest;
if ( supplied( $set ) ) {
fatal_error "Invalid DYNAMIC_BLACKLIST ipset name" unless $set =~ /^[A-Za-z][\w-]*/;
} else {
$set = 'SW_DBL' . $family;
}
add_ipset( $set );
$level = validate_level( $level );
$tag = '' unless defined $tag;
$config{DYNAMIC_BLACKLIST} = join( ':', $key, $set, $level, $tag );
require_capability( 'IPSET_V5', 'DYNAMIC_BLACKLIST=ipset...', 's' );
} else {
default_yes_no( 'DYNAMIC_BLACKLIST' , 'Yes' );
}
}
default_yes_no 'REQUIRE_INTERFACE' , '';
default_yes_no 'FORWARD_CLEAR_MARK' , have_capability( 'MARK' ) ? 'Yes' : '';
default_yes_no 'COMPLETE' , '';
@@ -5910,8 +6108,9 @@ sub get_configuration( $$$$ ) {
default_yes_no 'IGNOREUNKNOWNVARIABLES' , 'Yes';
default_yes_no 'WARNOLDCAPVERSION' , 'Yes';
default_yes_no 'DEFER_DNS_RESOLUTION' , 'Yes';
default_yes_no 'MINIUPNPD' , '';
$config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset';
$config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset';
require_capability 'MARK' , 'FORWARD_CLEAR_MARK=Yes', 's', if $config{FORWARD_CLEAR_MARK};
@@ -6014,7 +6213,7 @@ sub get_configuration( $$$$ ) {
default_log_level 'SFILTER_LOG_LEVEL', 'info';
if ( $val = $config{SFILTER_DISPOSITION} ) {
if ( supplied( $val = $config{SFILTER_DISPOSITION} ) ) {
fatal_error "Invalid SFILTER_DISPOSITION setting ($val)" unless $val =~ /^(A_)?(DROP|REJECT)$/;
require_capability 'AUDIT_TARGET' , "SFILTER_DISPOSITION=$val", 's' if $1;
} else {
@@ -6023,14 +6222,14 @@ sub get_configuration( $$$$ ) {
default_log_level 'RPFILTER_LOG_LEVEL', 'info';
if ( $val = $config{RPFILTER_DISPOSITION} ) {
if ( supplied ( $val = $config{RPFILTER_DISPOSITION} ) ) {
fatal_error "Invalid RPFILTER_DISPOSITION setting ($val)" unless $val =~ /^(A_)?(DROP|REJECT)$/;
require_capability 'AUDIT_TARGET' , "RPFILTER_DISPOSITION=$val", 's' if $1;
} else {
$config{RPFILTER_DISPOSITION} = 'DROP';
}
if ( $val = $config{MACLIST_DISPOSITION} ) {
if ( supplied( $val = $config{MACLIST_DISPOSITION} ) ) {
if ( $val =~ /^(?:A_)?DROP$/ ) {
$globals{MACLIST_TARGET} = $val;
} elsif ( $val eq 'REJECT' ) {
@@ -6049,7 +6248,7 @@ sub get_configuration( $$$$ ) {
$globals{MACLIST_TARGET} = 'reject';
}
if ( $val = $config{RELATED_DISPOSITION} ) {
if ( supplied( $val = $config{RELATED_DISPOSITION} ) ) {
if ( $val =~ /^(?:A_)?(?:DROP|ACCEPT)$/ ) {
$globals{RELATED_TARGET} = $val;
} elsif ( $val eq 'REJECT' ) {
@@ -6068,7 +6267,7 @@ sub get_configuration( $$$$ ) {
$globals{RELATED_TARGET} = 'ACCEPT';
}
if ( $val = $config{INVALID_DISPOSITION} ) {
if ( supplied( $val = $config{INVALID_DISPOSITION} ) ) {
if ( $val =~ /^(?:A_)?DROP$/ ) {
$globals{INVALID_TARGET} = $val;
} elsif ( $val eq 'REJECT' ) {
@@ -6087,7 +6286,7 @@ sub get_configuration( $$$$ ) {
$globals{INVALID_TARGET} = '';
}
if ( $val = $config{UNTRACKED_DISPOSITION} ) {
if ( supplied( $val = $config{UNTRACKED_DISPOSITION} ) ) {
if ( $val =~ /^(?:A_)?(?:DROP|ACCEPT)$/ ) {
$globals{UNTRACKED_TARGET} = $val;
} elsif ( $val eq 'REJECT' ) {
@@ -6106,7 +6305,7 @@ sub get_configuration( $$$$ ) {
$globals{UNTRACKED_TARGET} = '';
}
if ( $val = $config{MACLIST_TABLE} ) {
if ( supplied( $val = $config{MACLIST_TABLE} ) ) {
if ( $val eq 'mangle' ) {
fatal_error 'MACLIST_DISPOSITION=$1 is not allowed with MACLIST_TABLE=mangle' if $config{MACLIST_DISPOSITION} =~ /^((?:A)?REJECT)$/;
} else {
@@ -6116,7 +6315,7 @@ sub get_configuration( $$$$ ) {
default 'MACLIST_TABLE' , 'filter';
}
if ( $val = $config{TCP_FLAGS_DISPOSITION} ) {
if ( supplied( $val = $config{TCP_FLAGS_DISPOSITION} ) ) {
fatal_error "Invalid value ($config{TCP_FLAGS_DISPOSITION}) for TCP_FLAGS_DISPOSITION" unless $val =~ /^(?:(A_)?(?:REJECT|DROP))|ACCEPT$/;
require_capability 'AUDIT_TARGET' , "TCP_FLAGS_DISPOSITION=$val", 's' if $1;
} else {
@@ -6147,7 +6346,7 @@ sub get_configuration( $$$$ ) {
require_capability 'MANGLE_ENABLED', "TC_ENABLED=$config{TC_ENABLED}", 's';
}
if ( $val = $config{TC_PRIOMAP} ) {
if ( supplied( $val = $config{TC_PRIOMAP} ) ) {
my @priomap = split ' ',$val;
fatal_error "Invalid TC_PRIOMAP ($val)" unless @priomap == 16;
for ( @priomap ) {
@@ -6166,12 +6365,13 @@ sub get_configuration( $$$$ ) {
default 'QUEUE_DEFAULT' , 'none';
default 'NFQUEUE_DEFAULT' , 'none';
default 'ACCEPT_DEFAULT' , 'none';
default 'OPTIMIZE' , 0;
for my $default ( qw/DROP_DEFAULT REJECT_DEFAULT QUEUE_DEFAULT NFQUEUE_DEFAULT ACCEPT_DEFAULT/ ) {
$config{$default} = 'none' if "\L$config{$default}" eq 'none';
}
default 'OPTIMIZE' , 0;
if ( ( $val = $config{OPTIMIZE} ) =~ /^all$/i ) {
$config{OPTIMIZE} = $val = OPTIMIZE_ALL;
} elsif ( $val =~ /^none$/i ) {
@@ -6408,7 +6608,7 @@ sub generate_aux_config() {
emit "#\n# Shorewall auxiliary configuration file created by Shorewall version $globals{VERSION} - $date\n#";
for my $option ( qw(VERBOSITY LOGFILE LOGFORMAT ARPTABLES IPTABLES IP6TABLES IP TC IPSET PATH SHOREWALL_SHELL SUBSYSLOCK LOCKFILE RESTOREFILE WORKAROUNDS RESTART) ) {
for my $option ( qw(VERBOSITY LOGFILE LOGFORMAT ARPTABLES IPTABLES IP6TABLES IP TC IPSET PATH SHOREWALL_SHELL SUBSYSLOCK LOCKFILE RESTOREFILE WORKAROUNDS RESTART DYNAMIC_BLACKLIST) ) {
conditionally_add_option $option;
}
@@ -6429,7 +6629,7 @@ sub generate_aux_config() {
if ( -f $fn ) {
emit( '',
'dump_filter() {' );
'dump_filter1() {' );
push_indent;
append_file( $fn,1 ) or emit 'cat -';
pop_indent;
@@ -6506,6 +6706,7 @@ sub report_used_capabilities() {
}
END {
print "eval() called $evals times\n" if $debug;
cleanup;
}

View File

@@ -89,6 +89,7 @@ sub setup_ecn()
{
my %interfaces;
my @hosts;
my $interfaceref;
if ( my $fn = open_file 'ecn' ) {
@@ -105,7 +106,13 @@ sub setup_ecn()
2 );
fatal_error 'INTERFACE must be specified' if $interface eq '-';
fatal_error "Unknown interface ($interface)" unless known_interface $interface;
fatal_error "Unknown interface ($interface)" unless $interfaceref = known_interface( $interface );
if ( $interfaceref->{root} ) {
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
} else {
$interface = $interfaceref->{name};
}
my $lineinfo = shortlineinfo( '' );
@@ -132,7 +139,7 @@ sub setup_ecn()
}
for my $host ( @hosts ) {
add_ijump_extended( $mangle_table->{ecn_chain $host->[0]}, j => 'ECN', $host=>[1], targetopts => '--ecn-tcp-remove', p => 'tcp', imatch_dest_net( $host->[2] ) );
add_ijump_extended( $mangle_table->{ecn_chain $host->[0]}, j => 'ECN', $host->[1], targetopts => '--ecn-tcp-remove', p => 'tcp', imatch_dest_net( $host->[2] ) );
}
}
}
@@ -628,6 +635,28 @@ sub process_stoppedrules() {
$result;
}
sub create_docker_rules() {
add_commands( $nat_table->{PREROUTING} , '[ -n "$g_docker" ] && echo "-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER" >&3' );
my $chainref = $filter_table->{FORWARD};
add_commands( $chainref, '[ -n "$g_dockernetwork" ] && echo "-A FORWARD -j DOCKER-ISOLATION" >&3', );
if ( my $dockerref = known_interface('docker0') ) {
add_commands( $chainref, 'if [ -n "$g_docker" ]; then' );
incr_cmd_level( $chainref );
add_ijump( $chainref, j => 'DOCKER', o => 'docker0' );
add_ijump( $chainref, j => 'ACCEPT', o => 'docker0', state_imatch 'ESTABLISHED,RELATED' );
add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => '! docker0' );
add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => 'docker0' ) if $dockerref->{options}{routeback};
add_ijump( $filter_table->{OUTPUT}, j => 'DOCKER' );
decr_cmd_level( $chainref );
add_commands( $chainref, 'fi' );
}
add_commands( $chainref, '[ -f ${VARDIR}/.filter_FORWARD ] && cat $VARDIR/.filter_FORWARD >&3', );
}
sub setup_mss();
sub add_common_rules ( $ ) {
@@ -646,12 +675,88 @@ sub add_common_rules ( $ ) {
my $level = $config{BLACKLIST_LOG_LEVEL};
my $tag = $globals{BLACKLIST_LOG_TAG};
my $rejectref = $filter_table->{reject};
my $dbl_type;
my $dbl_ipset;
my $dbl_level;
my $dbl_tag;
my $dbl_target;
if ( $config{DYNAMIC_BLACKLIST} ) {
add_rule_pair( set_optflags( new_standard_chain( 'logdrop' ) , DONT_OPTIMIZE | DONT_DELETE ), '' , 'DROP' , $level , $tag);
add_rule_pair( set_optflags( new_standard_chain( 'logreject' ), DONT_OPTIMIZE | DONT_DELETE ), '' , 'reject' , $level , $tag);
$dynamicref = set_optflags( new_standard_chain( 'dynamic' ) , DONT_OPTIMIZE );
add_commands( $dynamicref, '[ -f ${VARDIR}/.dynamic ] && cat ${VARDIR}/.dynamic >&3' );
if ( $config{REJECT_ACTION} ) {
process_reject_action;
fatal_eror( "The REJECT_ACTION ($config{REJECT_ACTION}) is not terminating" ) unless terminating( $rejectref );
} else {
if ( have_capability( 'ADDRTYPE' ) ) {
add_ijump $rejectref , j => 'DROP' , addrtype => '--src-type BROADCAST';
} else {
if ( $family == F_IPV4 ) {
add_commands $rejectref, 'for address in $ALL_BCASTS; do';
} else {
add_commands $rejectref, 'for address in $ALL_ACASTS; do';
}
incr_cmd_level $rejectref;
add_ijump $rejectref, j => 'DROP', d => '$address';
decr_cmd_level $rejectref;
add_commands $rejectref, 'done';
}
if ( $family == F_IPV4 ) {
add_ijump $rejectref , j => 'DROP', s => '224.0.0.0/4';
} else {
add_ijump $rejectref , j => 'DROP', s => IPv6_MULTICAST;
}
add_ijump $rejectref , j => 'DROP', p => 2;
add_ijump $rejectref , j => 'REJECT', targetopts => '--reject-with tcp-reset', p => 6;
if ( have_capability( 'ENHANCED_REJECT' ) ) {
add_ijump $rejectref , j => 'REJECT', p => 17;
if ( $family == F_IPV4 ) {
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-unreachable', p => 1;
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-prohibited';
} else {
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-addr-unreachable', p => 58;
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-adm-prohibited';
}
} else {
add_ijump $rejectref , j => 'REJECT';
}
}
#
# Insure that Docker jumps are early in the builtin chains
#
create_docker_rules if $config{DOCKER};
if ( my $val = $config{DYNAMIC_BLACKLIST} ) {
( $dbl_type, $dbl_ipset, $dbl_level, $dbl_tag ) = split( ':', $val );
unless ( $dbl_type =~ /^ipset-only/ ) {
add_rule_pair( set_optflags( new_standard_chain( 'logdrop' ) , DONT_OPTIMIZE | DONT_DELETE ), '' , 'DROP' , $level , $tag);
add_rule_pair( set_optflags( new_standard_chain( 'logreject' ), DONT_OPTIMIZE | DONT_DELETE ), '' , 'reject' , $level , $tag);
$dynamicref = set_optflags( new_standard_chain( 'dynamic' ) , DONT_OPTIMIZE );
add_commands( $dynamicref, '[ -f ${VARDIR}/.dynamic ] && cat ${VARDIR}/.dynamic >&3' );
}
if ( $dbl_ipset ) {
if ( $dbl_level ) {
my $chainref = set_optflags( new_standard_chain( $dbl_target = 'dbl_log' ) , DONT_OPTIMIZE | DONT_DELETE );
log_rule_limit( $dbl_level,
$chainref,
'dbl_log',
'DROP',
$globals{LOGLIMIT},
$dbl_tag,
'add',
'',
$origin{DYNAMIC_BLACKLIST} );
add_ijump_extended( $chainref, j => 'DROP', $origin{DYNAMIC_BLACKLIST} );
} else {
$dbl_target = 'DROP';
}
}
}
setup_mss;
@@ -755,8 +860,13 @@ sub add_common_rules ( $ ) {
}
}
if ( $dbl_ipset && ! get_interface_option( $interface, 'nodbl' ) ) {
add_ijump_extended( $filter_table->{input_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset src" );
add_ijump_extended( $filter_table->{output_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset dst" ) if $dbl_type =~ /,src-dst$/;
}
for ( option_chains( $interface ) ) {
add_ijump_extended( $filter_table->{$_}, j => $dynamicref, $origin{DYNAMIC_BLACKLIST}, @state ) if $dynamicref;
add_ijump_extended( $filter_table->{$_}, j => $dynamicref, $origin{DYNAMIC_BLACKLIST}, @state ) if $dynamicref && ! get_interface_option( $interface, 'nodbl' );
add_ijump_extended( $filter_table->{$_}, j => 'ACCEPT', $origin{FASTACCEPT}, state_imatch $faststate )->{comment} = '' if $config{FASTACCEPT};
}
}
@@ -915,46 +1025,6 @@ sub add_common_rules ( $ ) {
}
}
unless ( $config{REJECT_ACTION} ) {
if ( have_capability( 'ADDRTYPE' ) ) {
add_ijump $rejectref , j => 'DROP' , addrtype => '--src-type BROADCAST';
} else {
if ( $family == F_IPV4 ) {
add_commands $rejectref, 'for address in $ALL_BCASTS; do';
} else {
add_commands $rejectref, 'for address in $ALL_ACASTS; do';
}
incr_cmd_level $rejectref;
add_ijump $rejectref, j => 'DROP', d => '$address';
decr_cmd_level $rejectref;
add_commands $rejectref, 'done';
}
if ( $family == F_IPV4 ) {
add_ijump $rejectref , j => 'DROP', s => '224.0.0.0/4';
} else {
add_ijump $rejectref , j => 'DROP', s => IPv6_MULTICAST;
}
add_ijump $rejectref , j => 'DROP', p => 2;
add_ijump $rejectref , j => 'REJECT', targetopts => '--reject-with tcp-reset', p => 6;
if ( have_capability( 'ENHANCED_REJECT' ) ) {
add_ijump $rejectref , j => 'REJECT', p => 17;
if ( $family == F_IPV4 ) {
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-unreachable', p => 1;
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-prohibited';
} else {
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-addr-unreachable', p => 58;
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-adm-prohibited';
}
} else {
add_ijump $rejectref , j => 'REJECT';
}
}
$list = find_interfaces_by_option 'dhcp';
if ( @$list ) {
@@ -1070,10 +1140,18 @@ sub add_common_rules ( $ ) {
add_commands( $chainref, '[ -s /${VARDIR}/.UPnP ] && cat ${VARDIR}/.UPnP >&3' );
my $chainref1;
if ( $config{MINIUPNPD} ) {
$chainref1 = set_optflags( new_nat_chain( 'MINIUPNPD-POSTROUTING' ), DONT_OPTIMIZE );
add_commands( $chainref, '[ -s /${VARDIR}/.MINIUPNPD-POSTROUTING ] && cat ${VARDIR}/.MINIUPNPD-POSTROUTING >&3' );
}
$announced = 1;
for $interface ( @$list ) {
add_ijump_extended $nat_table->{PREROUTING} , j => 'UPnP', get_interface_origin($interface), imatch_source_dev ( $interface );
add_ijump_extended $nat_table->{PREROUTING} , j => 'UPnP', get_interface_origin($interface), imatch_source_dev ( $interface );
add_ijump_extended $nat_table->{$globals{POSTROUTING}} , j => 'MINIUPNPD-POSTROUTING' , $origin{MINIUPNPD} , imatch_dest_dev ( $interface ) if $chainref1;
}
}
@@ -1508,13 +1586,15 @@ sub add_interface_jumps {
# Add Nat jumps
#
for my $interface ( @_ ) {
addnatjump 'POSTROUTING' , snat_chain( $interface ), imatch_dest_dev( $interface );
addnatjump $globals{POSTROUTING} , snat_chain( $interface ), imatch_dest_dev( $interface );
}
addnatjump( 'POSTROUTING', 'SHOREWALL' ) if $config{DOCKER};
for my $interface ( @interfaces ) {
addnatjump 'PREROUTING' , input_chain( $interface ) , imatch_source_dev( $interface );
addnatjump 'POSTROUTING' , output_chain( $interface ) , imatch_dest_dev( $interface );
addnatjump 'POSTROUTING' , masq_chain( $interface ) , imatch_dest_dev( $interface );
addnatjump $globals{POSTROUTING} , output_chain( $interface ) , imatch_dest_dev( $interface );
addnatjump $globals{POSTROUTING} , masq_chain( $interface ) , imatch_dest_dev( $interface );
if ( have_capability 'RAWPOST_TABLE' ) {
insert_ijump ( $rawpost_table->{POSTROUTING}, j => postrouting_chain( $interface ), 0, imatch_dest_dev( $interface) ) if $rawpost_table->{postrouting_chain $interface};
@@ -1759,12 +1839,14 @@ sub add_output_jumps( $$$$$$$$ ) {
my $use_output = 0;
my @dest = imatch_dest_net $net;
my @ipsec_out_match = match_ipsec_out $zone , $hostref;
my @zone_interfaces = keys %{zone_interfaces( $zone )};
if ( @vservers || use_output_chain( $interface, $interfacechainref ) || ( @{$interfacechainref->{rules}} && ! $chain1ref ) ) {
if ( @vservers || use_output_chain( $interface, $interfacechainref ) || ( @{$interfacechainref->{rules}} && ! $chain1ref ) || @zone_interfaces > 1 ) {
#
# - There are vserver zones (so OUTPUT will have multiple source; or
# - We must use the interface output chain; or
# - There are rules in the interface chain and none in the rules chain
# - The zone has multiple interfaces
#
# In any of these cases use the inteface output chain
#
@@ -1781,7 +1863,7 @@ sub add_output_jumps( $$$$$$$$ ) {
unless $output_jump_added{$interface}++;
} else {
#
# Not a bridge -- match the input interface
# Not a bridge -- match the output interface
#
add_ijump_extended $filter_table->{OUTPUT}, j => $outputref, $origin, imatch_dest_dev( $interface ) unless $output_jump_added{$interface}++;
}
@@ -2246,8 +2328,8 @@ sub generate_matrix() {
#
# Make sure that the 1:1 NAT jumps are last in PREROUTING
#
addnatjump 'PREROUTING' , 'nat_in';
addnatjump 'POSTROUTING' , 'nat_out';
addnatjump 'PREROUTING' , 'nat_in';
addnatjump $globals{POSTROUTING} , 'nat_out';
add_interface_jumps @interfaces unless $interface_jumps_added;
@@ -2391,16 +2473,16 @@ EOF
emit <<'EOF';
case $COMMAND in
start)
logger -p kern.err "ERROR:$g_product start failed"
mylogger kern.err "ERROR:$g_product start failed"
;;
reload)
logger -p kern.err "ERROR:$g_product reload failed"
mylogger kern.err "ERROR:$g_product reload failed"
;;
refresh)
logger -p kern.err "ERROR:$g_product refresh failed"
mylogger kern.err "ERROR:$g_product refresh failed"
;;
enable)
logger -p kern.err "ERROR:$g_product 'enable $g_interface' failed"
mylogger kern.err "ERROR:$g_product 'enable $g_interface' failed"
;;
esac
@@ -2452,9 +2534,18 @@ EOF
if [ $COMMAND = clear -a -f /proc/sys/net/netfilter/nf_conntrack_helper ]; then
echo 1 > /proc/sys/net/netfilter/nf_conntrack_helper
fi
EOF
if ( $config{DOCKER} ) {
push_indent;
emit( 'if [ $COMMAND = stop ]; then' );
push_indent;
save_docker_rules( $family == F_IPV4 ? '${IPTABLES}' : '${IP6TABLES}');
pop_indent;
emit( "fi\n");
pop_indent;
}
if ( have_capability( 'NAT_ENABLED' ) ) {
emit<<'EOF';
if [ -f ${VARDIR}/nat ]; then
@@ -2504,6 +2595,10 @@ EOF
emit( 'undo_routing',
"restore_default_route $config{USE_DEFAULT_RT}"
);
#
# Insure that Docker jumps are early in the builtin chains
#
create_docker_rules if $config{DOCKER};
if ( $config{ADMINISABSENTMINDED} ) {
add_ijump $filter_table ->{$_}, j => 'ACCEPT', state_imatch 'ESTABLISHED,RELATED' for qw/INPUT FORWARD/;
@@ -2596,7 +2691,7 @@ EOF
emit '
set_state "Stopped"
logger -p kern.info "$g_product Stopped"
mylogger kern.info "$g_product Stopped"
case $COMMAND in
stop|clear)

View File

@@ -69,6 +69,7 @@ sub process_one_masq1( $$$$$$$$$$$ )
my $destnets = '';
my $baserule = '';
my $inlinematches = '';
my $prerule = '';
#
# Leading '+'
#
@@ -83,6 +84,13 @@ sub process_one_masq1( $$$$$$$$$$$ )
$inlinematches = get_inline_matches(0);
}
#
# Handle early matches
#
if ( $inlinematches =~ s/s*\+// ) {
$prerule = $inlinematches;
$inlinematches = '';
}
#
# Parse the remaining part of the INTERFACE column
#
if ( $family == F_IPV4 ) {
@@ -165,7 +173,9 @@ sub process_one_masq1( $$$$$$$$$$$ )
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
unless ( $interfaceref->{root} ) {
if ( $interfaceref->{root} ) {
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
} else {
$rule .= match_dest_dev( $interface );
$interface = $interfaceref->{name};
}
@@ -336,7 +346,7 @@ sub process_one_masq1( $$$$$$$$$$$ )
#
expand_rule( $chainref ,
POSTROUTE_RESTRICT ,
'' ,
$prerule ,
$baserule . $inlinematches . $rule ,
$networks ,
$destnets ,
@@ -449,7 +459,9 @@ sub do_one_nat( $$$$$ )
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
unless ( $interfaceref->{root} ) {
if ( $interfaceref->{root} ) {
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
} else {
$rulein = match_source_dev $interface;
$ruleout = match_dest_dev $interface;
$interface = $interfaceref->{name};
@@ -551,7 +563,9 @@ sub setup_netmap() {
$net1 = validate_net $net1, 0;
$net2 = validate_net $net2, 0;
unless ( $interfaceref->{root} ) {
if ( $interfaceref->{root} ) {
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
} else {
@rulein = imatch_source_dev( $interface );
@ruleout = imatch_dest_dev( $interface );
$interface = $interfaceref->{name};

View File

@@ -392,7 +392,7 @@ sub start_provider( $$$$$ ) {
}
#
# Look up a provider and return it's number. If unknown provider, 0 is returned
# Look up a provider and return a reference to its table entry. If unknown provider, undef is returned
#
sub lookup_provider( $ ) {
my $provider = $_[0];
@@ -408,7 +408,7 @@ sub lookup_provider( $ ) {
}
}
$providerref ? $providerref->{number} : 0;
$providerref;
}
#
@@ -481,17 +481,22 @@ sub process_a_provider( $ ) {
$interface = $interfaceref->{name} unless $interfaceref->{wildcard};
}
my $gatewaycase = '';
if ( $physical =~ /\+$/ ) {
return 0 if $pseudo;
fatal_error "Wildcard interfaces ($physical) may not be used as provider interfaces";
}
if ( $gateway eq 'detect' ) {
my $gatewaycase = '';
my $gw;
if ( ( $gw = lc $gateway ) eq 'detect' ) {
fatal_error "Configuring multiple providers through one interface requires an explicit gateway" if $shared;
$gateway = get_interface_gateway $interface;
$gatewaycase = 'detect';
} elsif ( $gw eq 'none' ) {
fatal_error "Configuring multiple providers through one interface requires a gateway" if $shared;
$gatewaycase = 'none';
$gateway = '';
} elsif ( $gateway && $gateway ne '-' ) {
( $gateway, $mac ) = split_host_list( $gateway, 0 );
validate_address $gateway, 0;
@@ -506,7 +511,7 @@ sub process_a_provider( $ ) {
$gatewaycase = 'specified';
} else {
$gatewaycase = 'none';
$gatewaycase = 'omitted';
fatal_error "Configuring multiple providers through one interface requires a gateway" if $shared;
$gateway = '';
}
@@ -529,10 +534,12 @@ sub process_a_provider( $ ) {
} elsif ( $option eq 'notrack' ) {
$track = 0;
} elsif ( $option =~ /^balance=(\d+)$/ ) {
fatal_error q('balance' may not be spacified when GATEWAY is 'none') if $gatewaycase eq 'none';
fatal_error q('balance=<weight>' is not available in IPv6) if $family == F_IPV6;
fatal_error 'The balance setting must be non-zero' unless $1;
$balance = $1;
} elsif ( $option eq 'balance' || $option eq 'primary') {
fatal_error qq('$option' may not be spacified when GATEWAY is 'none') if $gatewaycase eq 'none';
$balance = 1;
} elsif ( $option eq 'loose' ) {
$loose = 1;
@@ -550,11 +557,13 @@ sub process_a_provider( $ ) {
} elsif ( $option =~ /^mtu=(\d+)$/ ) {
$mtu = "mtu $1 ";
} elsif ( $option =~ /^fallback=(\d+)$/ ) {
fatal_error q('fallback' may not be spacified when GATEWAY is 'none') if $gatewaycase eq 'none';
fatal_error q('fallback=<weight>' is not available in IPv6) if $family == F_IPV6;
$default = $1;
$default_balance = 0;
fatal_error 'fallback must be non-zero' unless $default;
} elsif ( $option eq 'fallback' ) {
fatal_error q('fallback' may not be spacified when GATEWAY is 'none') if $gatewaycase eq 'none';
$default = -1;
$default_balance = 0;
} elsif ( $option eq 'local' ) {
@@ -567,6 +576,7 @@ sub process_a_provider( $ ) {
$track = 0 if $config{TRACK_PROVIDERS};
$default_balance = 0 if $config{USE_DEFAULT_RT};
} elsif ( $option =~ /^load=(0?\.\d{1,8})/ ) {
fatal_error q('fallback' may not be spacified when GATEWAY is 'none') if $gatewaycase eq 'none';
$load = sprintf "%1.8f", $1;
require_capability 'STATISTIC_MATCH', "load=$1", 's';
} elsif ( $option eq 'autosrc' ) {
@@ -596,13 +606,13 @@ sub process_a_provider( $ ) {
fatal_error "A provider interface must have at least one associated zone" unless $tproxy || %{interface_zones($interface)};
if ( $local ) {
fatal_error "GATEWAY not valid with 'local' provider" unless $gatewaycase eq 'none';
fatal_error "GATEWAY not valid with 'local' provider" unless $gatewaycase eq 'omitted';
fatal_error "'track' not valid with 'local'" if $track;
fatal_error "DUPLICATE not valid with 'local'" if $duplicate ne '-';
fatal_error "'persistent' is not valid with 'local" if $persistent;
} elsif ( $tproxy ) {
fatal_error "Only one 'tproxy' provider is allowed" if $tproxies++;
fatal_error "GATEWAY not valid with 'tproxy' provider" unless $gatewaycase eq 'none';
fatal_error "GATEWAY not valid with 'tproxy' provider" unless $gatewaycase eq 'omitted';
fatal_error "'track' not valid with 'tproxy'" if $track;
fatal_error "DUPLICATE not valid with 'tproxy'" if $duplicate ne '-';
fatal_error "MARK not allowed with 'tproxy'" if $mark ne '-';
@@ -649,14 +659,16 @@ sub process_a_provider( $ ) {
warning_message q(The 'proxyndp' option is dangerous when specified on a Provider interface) if get_interface_option( $interface, 'proxyndp' );
}
$balance = $default_balance unless $balance;
$balance = $default_balance unless $balance || $gatewaycase eq 'none';
fatal_error "Interface $interface is already associated with non-shared provider $provider_interfaces{$interface}" if $provider_interfaces{$interface};
if ( $duplicate ne '-' ) {
fatal_error "The DUPLICATE column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT};
my $p = lookup_provider( $duplicate );
warning_message "Unknown routing table ($duplicate)" unless $p && ( $p == MAIN_TABLE || $p < BALANCE_TABLE );
my $n = $p ? $p->{number} : 0;
warning_message "Unknown routing table ($duplicate)" unless $n && ( $n == MAIN_TABLE || $n < BALANCE_TABLE );
warning_message "An optional provider ($duplicate) is listed in the DUPLICATE column - enable and disable will not work correctly on that provider" if $p && $p->{optional};
} elsif ( $copy ne '-' ) {
fatal_error "The COPY column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT};
fatal_error 'A non-empty COPY column requires that a routing table be specified in the DUPLICATE column' unless $copy eq 'none';
@@ -789,7 +801,7 @@ sub add_a_provider( $$ ) {
push_indent;
if ( $gatewaycase eq 'none' ) {
if ( $gatewaycase eq 'omitted' ) {
if ( $tproxy ) {
emit 'run_ip route add local ' . ALLIP . " dev $physical table $id";
} else {
@@ -818,12 +830,12 @@ sub add_a_provider( $$ ) {
if ( ! $noautosrc ) {
if ( $shared ) {
emit "qt \$IP -$family rule del from $address" if $config{DELETE_THEN_ADD};
emit "qt \$IP -$family rule del from $address";
emit( "run_ip rule add from $address pref 20000 table $id" ,
"echo \"\$IP -$family rule del from $address pref 20000> /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing" );
} else {
emit ( "find_interface_addresses $physical | while read address; do" );
emit ( " qt \$IP -$family rule del from \$address" ) if $config{DELETE_THEN_ADD};
emit ( " qt \$IP -$family rule del from \$address" );
emit ( " run_ip rule add from \$address pref 20000 table $id",
" echo \"\$IP -$family rule del from \$address pref 20000 > /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing",
' rulenum=$(($rulenum + 1))',
@@ -867,7 +879,7 @@ sub add_a_provider( $$ ) {
}
$provider_interfaces{$interface} = $table;
if ( $gatewaycase eq 'none' ) {
if ( $gatewaycase eq 'omitted' ) {
if ( $tproxy ) {
emit 'run_ip route add local ' . ALLIP . " dev $physical table $id";
} else {
@@ -907,7 +919,7 @@ CEOF
emit ( "run_ip rule add fwmark ${hexmark}${mask} pref $pref table $id",
"echo \"\$IP -$family rule del fwmark ${hexmark}${mask} > /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing"
);
);
}
if ( $duplicate ne '-' ) {
@@ -983,12 +995,19 @@ CEOF
}
} elsif ( ! $noautosrc ) {
if ( $shared ) {
emit "qt \$IP -$family rule del from $address" if $config{DELETE_THEN_ADD};
emit( "run_ip rule add from $address pref 20000 table $id" ,
"echo \"\$IP -$family rule del from $address pref 20000> /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing" );
if ( $persistent ) {
emit( qq(if ! egrep -q "^2000:[[:space:]]+from $address lookup $id"; then),
qq( run_ip rule add from $address pref 20000 table $id),
qq( echo "\$IP -$family rule del from $address pref 20000> /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing ),
qq(fi) );
} else {
emit "qt \$IP -$family rule del from $address" if $config{DELETE_THEN_ADD};
emit( "run_ip rule add from $address pref 20000 table $id" ,
"echo \"\$IP -$family rule del from $address pref 20000> /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing" );
}
} elsif ( ! $pseudo ) {
emit ( "find_interface_addresses $physical | while read address; do" );
emit ( " qt \$IP -$family rule del from \$address" ) if $config{DELETE_THEN_ADD};
emit ( " qt \$IP -$family rule del from \$address" ) if $persistent || $config{DELETE_THEN_ADD};
emit ( " run_ip rule add from \$address pref 20000 table $id",
" echo \"\$IP -$family rule del from \$address pref 20000 > /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing",
' rulenum=$(($rulenum + 1))',
@@ -1077,7 +1096,7 @@ CEOF
if ( $optional ) {
if ( $persistent ) {
emit( "persistent_${what}_${table}\n" );
emit( "do_persistent_${what}_${table}\n" );
}
if ( $shared ) {
@@ -1273,7 +1292,7 @@ sub add_an_rtrule1( $$$$$ ) {
push @{$providerref->{rules}}, "run_ip rule add $source ${dest}${mark} $priority table $id";
if ( $persistent ) {
push @{$providerref->{persistent_rules}}, "qt \$IP -$family rule del $source ${dest}${mark} $priority" if $config{DELETE_THEN_ADD};
push @{$providerref->{persistent_rules}}, "qt \$IP -$family rule del $source ${dest}${mark} $priority";
push @{$providerref->{persistent_rules}}, "run_ip rule add $source ${dest}${mark} $priority table $id";
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -82,6 +82,7 @@ our @EXPORT = ( qw( NOTHING
find_interface
known_interface
get_physical
get_logical
physical_name
have_bridges
port_to_bridge
@@ -102,7 +103,6 @@ our @EXPORT = ( qw( NOTHING
find_hosts_by_option
find_zone_hosts_by_option
find_zones_by_option
all_ipsets
have_ipsec
),
);
@@ -209,8 +209,6 @@ our @interfaces;
our %interfaces;
our %roots;
our @bport_zones;
our %ipsets;
our %physical;
our %basemap;
our %basemap1;
our %mapbase;
@@ -326,8 +324,6 @@ sub initialize( $$ ) {
%roots = ();
%interfaces = ();
@bport_zones = ();
%ipsets = ();
%physical = ();
%basemap = ();
%basemap1 = ();
%mapbase = ();
@@ -349,6 +345,7 @@ sub initialize( $$ ) {
logmartians => BINARY_IF_OPTION,
loopback => BINARY_IF_OPTION,
nets => IPLIST_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_VSERVER,
nodbl => SIMPLE_IF_OPTION,
norfc1918 => OBSOLETE_IF_OPTION,
nosmurfs => SIMPLE_IF_OPTION + IF_OPTION_HOST,
optional => SIMPLE_IF_OPTION,
@@ -396,6 +393,7 @@ sub initialize( $$ ) {
loopback => BINARY_IF_OPTION,
maclist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
nets => IPLIST_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_VSERVER,
nodbl => SIMPLE_IF_OPTION,
nosmurfs => SIMPLE_IF_OPTION + IF_OPTION_HOST,
optional => SIMPLE_IF_OPTION,
optional => SIMPLE_IF_OPTION,
@@ -1281,7 +1279,7 @@ sub process_interface( $$ ) {
fatal_error q("nets=" may not be specified for a multi-zone interface) unless $zone;
fatal_error "Duplicate $option option" if $netsref;
if ( $value eq 'dynamic' ) {
require_capability( 'IPSET_MATCH', 'Dynamic nets', '');
require_capability( 'IPSET_V5', 'Dynamic nets', '');
$hostoptions{dynamic} = 1;
#
# Defer remaining processing until we have the final physical interface name
@@ -1311,7 +1309,7 @@ sub process_interface( $$ ) {
fatal_error "Invalid Physical interface name ($value)" unless $value && $value !~ /%/;
fatal_error "Virtual interfaces ($value) are not supported" if $value =~ /:\d+$/;
fatal_error "Duplicate physical interface name ($value)" if ( $physical{$value} && ! $port );
fatal_error "Duplicate physical interface name ($value)" if ( $interfaces{$value} && ! $port );
fatal_error "The type of 'physical' name ($value) doesn't match the type of interface name ($interface)" if $wildcard && ! $value =~ /\+$/;
$physical = $value;
@@ -1345,7 +1343,7 @@ sub process_interface( $$ ) {
my $ipset = $family == F_IPV4 ? "${zone}" : "6_${zone}";
$ipset = join( '_', $ipset, var_base1( $physical ) ) unless $zoneref->{options}{in_out}{dynamic_shared};
$netsref = [ "+$ipset" ];
$ipsets{$ipset} = 1;
add_ipset($ipset);
}
if ( $options{bridge} ) {
@@ -1385,21 +1383,23 @@ sub process_interface( $$ ) {
$options{tcpflags} = $hostoptionsref->{tcpflags} = 1 unless exists $options{tcpflags};
}
$physical{$physical} = $interfaces{$interface} = { name => $interface ,
bridge => $bridge ,
filter => $filterref ,
nets => 0 ,
number => $nextinum ,
root => $root ,
broadcasts => $broadcasts ,
options => \%options ,
zone => '',
physical => $physical ,
base => var_base( $physical ),
zones => {},
origin => shortlineinfo( '' ),
wildcard => $wildcard,
};
my $interfaceref = $interfaces{$interface} = { name => $interface ,
bridge => $bridge ,
filter => $filterref ,
nets => 0 ,
number => $nextinum ,
root => $root ,
broadcasts => $broadcasts ,
options => \%options ,
zone => '',
physical => $physical ,
base => var_base( $physical ),
zones => {},
origin => shortlineinfo( '' ),
wildcard => $wildcard,
};
$interfaces{$physical} = $interfaceref if $physical ne $interface;
if ( $zone ) {
fatal_error "Unmanaged interfaces may not be associated with a zone" if $options{unmanaged};
@@ -1570,20 +1570,23 @@ sub known_interface($)
my $physical = map_physical( $interface, $interfaceref );
return $interfaces{$interface} = { options => $interfaceref->{options} ,
bridge => $interfaceref->{bridge} ,
name => $i ,
number => $interfaceref->{number} ,
physical => $physical ,
base => var_base( $physical ) ,
wildcard => $interfaceref->{wildcard} ,
zones => $interfaceref->{zones} ,
};
$interfaceref =
$interfaces{$interface} =
$interfaces{$physical} = { options => $interfaceref->{options} ,
bridge => $interfaceref->{bridge} ,
name => $i ,
number => $interfaceref->{number} ,
physical => $physical ,
base => var_base( $physical ) ,
wildcard => $interfaceref->{wildcard} ,
zones => $interfaceref->{zones} ,
};
return $interfaceref;
}
}
}
$physical{$interface} || 0;
0;
}
#
@@ -1655,12 +1658,19 @@ sub find_interface( $ ) {
}
#
# Returns the physical interface associated with the passed logical name
# Returns the physical interface associated with the passed interface name
#
sub get_physical( $ ) {
$interfaces{ $_[0] }->{physical};
}
#
# Returns the logical interface associated with the passed interface name
#
sub get_logical( $ ) {
$interfaces{ $_[0] }->{name};
}
#
# This one doesn't insist that the passed name be the name of a configured interface
#
@@ -2040,6 +2050,7 @@ sub process_host( ) {
$interface = $1;
$hosts = $2;
fatal_error "Unknown interface ($interface)" unless ($interfaceref = $interfaces{$interface}) && $interfaceref->{root};
$interface = $interfaceref->{name};
} else {
fatal_error "Invalid HOST(S) column contents: $hosts";
}
@@ -2053,7 +2064,7 @@ sub process_host( ) {
fatal_error "Unknown interface ($interface)" unless ($interfaceref = $interfaces{$interface}) && $interfaceref->{root};
fatal_error "Unmanaged interfaces may not be associated with a zone" if $interfaceref->{unmanaged};
$interface = $interfaceref->{name};
if ( $interfaceref->{physical} eq $loopback_interface ) {
fatal_error "Only a loopback zone may be associated with the loopback interface ($loopback_interface)" if $type != LOOPBACK;
} else {
@@ -2141,7 +2152,7 @@ sub process_host( ) {
$hosts = "+$set";
$optionsref->{dynamic} = 1;
$ipsets{$set} = 1;
add_ipset($set);
}
#
@@ -2261,8 +2272,4 @@ sub find_zones_by_option( $$ ) {
\@zns;
}
sub all_ipsets() {
sort keys %ipsets;
}
1;

View File

@@ -1,4 +1,4 @@
# (c) 1999-2015 - Tom Eastep (teastep@shorewall.net)
# (c) 1999-2016 - Tom Eastep (teastep@shorewall.net)
#
# This program is part of Shorewall.
#
@@ -1110,7 +1110,7 @@ interface_is_usable() # $1 = interface
#
find_interface_addresses() # $1 = interface
{
$IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 2' | sed 's/\s*inet6 //;s/\/.*//;s/ peer.*//'
$IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 2' | sed 's/\s*inet6 //;s/\/.*//;s/ peer [0-9a-f:]*//'
}
#
@@ -1119,7 +1119,7 @@ find_interface_addresses() # $1 = interface
find_interface_full_addresses() # $1 = interface
{
$IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 ' | sed 's/\s*inet6 //;s/ scope.*//;s/ peer.*//'
$IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 ' | sed 's/\s*inet6 //;s/ scope.*//;s/ peer [0-9a-f:]*//'
}
#

View File

@@ -125,6 +125,8 @@ g_sha1sum2=
g_counters=
g_compiled=
g_file=
g_docker=
g_dockernetwork=
initialize

View File

@@ -1 +0,0 @@
This is the Shorewall 4.4 stable branch of Git.

View File

@@ -17,6 +17,12 @@ STARTUP_ENABLED=Yes
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################
@@ -146,6 +152,8 @@ DEFER_DNS_RESOLUTION=Yes
DISABLE_IPV6=No
DOCKER=No
DELETE_THEN_ADD=Yes
DETECT_DNAT_IPADDRS=No
@@ -184,6 +192,8 @@ MANGLE_ENABLED=Yes
MAPOLDACTIONS=No
MINIUPNPD=No
MARK_IN_FORWARD_CHAIN=No
MODULE_SUFFIX="ko ko.xz"

View File

@@ -28,6 +28,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################
@@ -157,6 +163,8 @@ DEFER_DNS_RESOLUTION=Yes
DISABLE_IPV6=No
DOCKER=No
DELETE_THEN_ADD=Yes
DETECT_DNAT_IPADDRS=No
@@ -195,6 +203,8 @@ MANGLE_ENABLED=Yes
MAPOLDACTIONS=No
MINIUPNPD=No
MARK_IN_FORWARD_CHAIN=No
MODULE_SUFFIX="ko ko.xz"

View File

@@ -25,6 +25,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################
@@ -154,6 +160,8 @@ DEFER_DNS_RESOLUTION=Yes
DISABLE_IPV6=No
DOCKER=No
DELETE_THEN_ADD=Yes
DETECT_DNAT_IPADDRS=No
@@ -192,6 +200,8 @@ MANGLE_ENABLED=Yes
MAPOLDACTIONS=No
MINIUPNPD=No
MARK_IN_FORWARD_CHAIN=No
MODULE_SUFFIX="ko ko.xz"

View File

@@ -28,6 +28,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################
@@ -157,6 +163,8 @@ DEFER_DNS_RESOLUTION=Yes
DISABLE_IPV6=No
DOCKER=No
DELETE_THEN_ADD=Yes
DETECT_DNAT_IPADDRS=No
@@ -195,6 +203,8 @@ MANGLE_ENABLED=Yes
MAPOLDACTIONS=No
MINIUPNPD=No
MARK_IN_FORWARD_CHAIN=No
MODULE_SUFFIX="ko ko.xz"

View File

@@ -1,41 +1,39 @@
#
# Shorewall version 5 - Drop Action
# Shorewall -- /usr/share/shorewall/action.A_Drop
#
# /usr/share/shorewall/action.A_Drop
# The audited default DROP common rules
#
# The audited default DROP common rules
# This action is invoked before a DROP policy is enforced. The purpose
# of the action is:
#
# This action is invoked before a DROP policy is enforced. The purpose
# of the action is:
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that 'auth' requests are rejected, even if the policy is
# DROP. Otherwise, you may experience problems establishing
# connections with servers that use auth.
# c) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
#
###############################################################################
#TARGET SOURCE DEST PROTO DPORT SPORT
#ACTION SOURCE DEST PROTO DPORT SPORT
#
# Count packets that come through here
#
COUNT
#
# Silently DROP 'auth'
# Special Handling for Auth
#
Auth(A_DROP)
#
# ACCEPT critical ICMP types
#
# For IPv6 connectivity ipv6-icmp broadcasting is required so
# AllowICMPs must be before broadcast Drop.
#
A_AllowICMPs - - icmp
#
# Don't log broadcasts
#
dropBcast(audit)
#
# ACCEPT critical ICMP types
#
A_AllowICMPs - - icmp
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log.
#

41
Shorewall/action.A_REJECT Normal file
View File

@@ -0,0 +1,41 @@
#
# Shorewall -- /usr/share/shorewall/action.A_REJECTWITH
#
# A_REJECT Action.
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2012-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# A_REJECTWITH[([<option>])] where <option> is a valid REJECT option.#
###############################################################################
DEFAULTS -
AUDIT(reject)
?if passed @1
?if @1 =~ /tcp-reset$/
?set reject_proto 6
?else
?set reject_proto ''
?endif
REJECT(@1) - - $reject_proto
?else
REJECT
?endif

View File

@@ -0,0 +1,30 @@
#
# Shorewall -- /usr/share/shorewall/action.A_REJECT!
#
# A_REJECT! Action.
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2012-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# A_REJECTWITH[([<option>])] where <option> is a valid REJECT option.#
###############################################################################
DEFAULTS -
A_REJECT(@1)

View File

@@ -1,34 +1,35 @@
#
# Shorewall version 5 - Reject Action
# Shorewall -- /usr/share/shorewall/action.A_Reject
#
# /usr/share/shorewall/action.A_Reject
# The audited default REJECT action common rules
#
# The audited default REJECT action common rules
# This action is invoked before a REJECT policy is enforced. The purpose
# of the action is:
#
# This action is invoked before a REJECT policy is enforced. The purpose
# of the action is:
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
###############################################################################
#TARGET SOURCE DEST PROTO
#ACTION SOURCE DEST PROTO
#
# Count packets that come through here
#
COUNT
#
# ACCEPT critical ICMP types
#
# For IPv6 connectivity ipv6-icmp broadcasting is required so
# AllowICMPs must be before broadcast Drop.
#
A_AllowICMPs - - icmp
#
# Drop Broadcasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
dropBcast(audit)
#
# ACCEPT critical ICMP types
#
A_AllowICMPs - - icmp
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log (these ICMPs cannot be
# rejected).

View File

@@ -1,22 +1,24 @@
#
# Shorewall version 5 - Auto Blacklist Action
# Shorewall -- /usr/share/shorewall/action.AutoBL
#
# Auto Blacklist Action
#
# Parameters are:
#
# Event - Name of the event to associate with this blacklist
# Interval
# Count - Interval and number of Packets to trigger blacklisting
# Default is 60 seconds and 5 packets.
# Successive - If a matching packet arrives within this many
# seconds of the preceding one, it should be logged
# and dealt with according to the Disposition and
# Log Level parameters below. Default is 2 seconds.
# Blacklist time - Number of seconds to blacklist
# Default is 300 (5 minutes)
# Disposition - Disposition of blacklisted packets
# Default is DROP
# Log Level - Level to Log Rejects
# Default is info (6)
# Event - Name of the event to associate with this blacklist
# Interval
# Count - Interval and number of Packets to trigger blacklisting
# Default is 60 seconds and 5 packets.
# Successive - If a matching packet arrives within this many
# seconds of the preceding one, it should be logged
# and dealt with according to the Disposition and
# Log Level parameters below. Default is 2 seconds.
# Blacklist time - Number of seconds to blacklist
# Default is 300 (5 minutes)
# Disposition - Disposition of blacklisted packets
# Default is DROP
# Log Level - Level to Log Rejects
# Default is info (6)
#
###############################################################################
@@ -37,7 +39,7 @@ validate_level( $level );
1;
?end perl
###############################################################################
#TARGET SOURCE DEST PROTO DPORT SPORT
#ACTION SOURCE DEST PROTO DPORT SPORT
#
# Silently reject the client if blacklisted
#

View File

@@ -1,13 +1,16 @@
#
# Shorewall version 5 - Auto Blacklisting Logger Action
# Shorewall -- /usr/share/shorewall/action.AutoBLL
#
# Auto Blacklisting Logger Action
#
# Arguments are
#
# Event: Name of the blacklisted event
# Disposition: What to do with packets
# Level: Log level and optional tag for logging.
# Event - Name of the blacklisted event
# Disposition - What to do with packets
# Level - Log level and optional tag for logging
#
###############################################################################
#TARGET SOURCE DEST PROTO DPORT SPORT
#ACTION SOURCE DEST PROTO DPORT SPORT
#
# Log the Reject
#

View File

@@ -1,73 +1,59 @@
#
# Shorewall 4 - Broadcast Action
# Shorewall -- /usr/share/shorewall/action.Broadcast
#
# /usr/share/shorewall/action.Broadcast
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
# Complete documentation is available at http://shorewall.net
#
# Complete documentation is available at http://shorewall.net
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Broadcast[([<action>|-[,{audit|-}])]
#
# Broadcast[([<action>|-[,{audit|-}])]
# Default action is DROP
#
# Default action is DROP
#
##########################################################################################
###############################################################################
DEFAULTS DROP,-
?if __ADDRTYPE
@1 - - - ;; -m addrtype --dst-type BROADCAST
@1 - - - ;; -m addrtype --dst-type MULTICAST
@1 - - - ;; -m addrtype --dst-type ANYCAST
?else
?begin perl;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
my ( $action, $audit ) = get_action_params( 2 );
fatal_error "Invalid parameter ($audit) to action Broadcast" if supplied $audit && $audit ne 'audit';
fatal_error "Invalid parameter ($action) to action Broadcast" unless $action =~ /^(?:ACCEPT|DROP|REJECT)$/;
my ( $action ) = get_action_params( 1 );
my $chainref = get_action_chain;
my ( $level, $tag ) = get_action_logging;
my $target = require_audit ( $action , $audit );
if ( have_capability( 'ADDRTYPE' ) ) {
if ( $level ne '' ) {
log_rule_limit $level, $chainref, 'dropBcast' , $action, '', $tag, 'add', ' -m addrtype --dst-type BROADCAST ';
log_rule_limit $level, $chainref, 'dropBcast' , $action, '', $tag, 'add', ' -m addrtype --dst-type MULTICAST ';
log_rule_limit $level, $chainref, 'dropBcast' , $action, '', $tag, 'add', ' -m addrtype --dst-type ANYCAST ';
}
add_commands $chainref, 'for address in $ALL_BCASTS; do';
incr_cmd_level $chainref;
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d $address ' if $level ne '';
add_jump $chainref, $action, 0, "-d \$address ";
decr_cmd_level $chainref;
add_commands $chainref, 'done';
add_jump $chainref, $target, 0, '-m addrtype --dst-type BROADCAST ';
add_jump $chainref, $target, 0, '-m addrtype --dst-type MULTICAST ';
add_jump $chainref, $target, 0, '-m addrtype --dst-type ANYCAST ';
} else {
add_commands $chainref, 'for address in $ALL_BCASTS; do';
incr_cmd_level $chainref;
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d $address ' if $level ne '';
add_jump $chainref, $target, 0, "-d \$address ";
decr_cmd_level $chainref;
add_commands $chainref, 'done';
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d 224.0.0.0/4 ' if $level ne '';
add_jump $chainref, $target, 0, '-d 224.0.0.0/4 ';
}
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d 224.0.0.0/4 ' if $level ne '';
add_jump $chainref, $action, 0, '-d 224.0.0.0/4 ';
1;
?end perl;
?endif

View File

@@ -1,33 +1,34 @@
#
# Shorewall 5 - DNS Amplification Action
# Shorewall -- /usr/share/shorewall/action.DNSAmp
#
# /usr/share/shorewall/action.DNSAmp
# DNS Amplification Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# DNSAmp[([<action>])]
# DNSAmp[([<action>])]
#
# Default action is DROP
# Default action is DROP
#
##########################################################################################
###############################################################################
#ACTION SOURCE DEST PROTO DPORT
DEFAULTS DROP
IPTABLES(@1) - - udp 53 ; -m u32 --u32 "0>>22&0x3C\@8&0xffff=0x0100 && 0>>22&0x3C\@12&0xffff0000=0x00010000"
@1 - - udp 53 ;; -m u32 --u32 "0>>22&0x3C\@8&0xffff=0x0100 && 0>>22&0x3C\@12&0xffff0000=0x00010000"

View File

@@ -1,59 +1,45 @@
#
# Shorewall version 5 - Drop Action
# Shorewall -- /usr/share/shorewall/action.Drop
#
# /usr/share/shorewall/action.Drop
# The default DROP common rules
#
# The default DROP common rules
# This action is invoked before a DROP policy is enforced. The purpose
# of the action is:
#
# This action is invoked before a DROP policy is enforced. The purpose
# of the action is:
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
# The action accepts six optional parameters:
#
# The action accepts five optional parameters:
#
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
# actions.
# 2 - Action to take with Auth requests. Default is to do nothing special
# with them.
# 3 - Action to take with SMB requests. Default is DROP or A_DROP,
# depending on the setting of the first parameter.
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
# A_ACCEPT depending on the first parameter.
# 5 - Action to take with late UDP replies (UDP source port 53). Default
# is DROP or A_DROP depending on the first parameter.
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
# actions.
# 2 - Action to take with Auth requests. Default is to do nothing special
# with them.
# 3 - Action to take with SMB requests. Default is DROP or A_DROP,
# depending on the setting of the first parameter.
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
# A_ACCEPT depending on the first parameter.
# 5 - Action to take with late UDP replies (UDP source port 53). Default
# is DROP or A_DROP depending on the first parameter.
# 6 - Action to take with UPnP packets. Default is DROP or A_DROP
# depending on the first parameter.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
#
###############################################################################
#
# The following magic provides different defaults for @2 thru @5, when @1 is
# 'audit'.
#
?begin perl;
use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
?if passed(@1)
?if @1 eq 'audit'
DEFAULTS -,-,A_DROP,A_ACCEPT,A_DROP,A_DROP
?else
?error The first parameter to Drop must be 'audit' or '-'
?endif
?else
DEFAULTS -,-,DROP,ACCEPT,DROP,DROP
?endif
if ( defined $p1 ) {
if ( $p1 eq 'audit' ) {
set_action_param( 3, 'A_DROP') unless supplied $p3;
set_action_param( 4, 'A_ACCEPT' ) unless supplied $p4;
set_action_param( 5, 'A_DROP' ) unless supplied $p5;
} else {
fatal_error "Invalid value ($p1) for first Drop parameter" if supplied $p1;
}
}
1;
?end perl;
DEFAULTS -,-,DROP,ACCEPT,DROP
#TARGET SOURCE DEST PROTO DPORT SPORT
#ACTION SOURCE DEST PROTO DPORT SPORT
#
# Count packets that come through here
#
@@ -61,18 +47,21 @@ COUNT
#
# Special Handling for Auth
#
?if @2 ne '-'
?if passed(@2)
Auth(@2)
?endif
#
# ACCEPT critical ICMP types
#
# For IPv6 connectivity ipv6-icmp broadcasting is required so
# AllowICMPs must be before silent broadcast Drop.
#
AllowICMPs(@4) - - icmp
#
# Don't log broadcasts
#
Broadcast(DROP,@1)
#
# ACCEPT critical ICMP types
#
AllowICMPs(@4) - - icmp
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log.
#
@@ -81,7 +70,7 @@ Invalid(DROP,@1)
# Drop Microsoft noise so that it doesn't clutter up the log.
#
SMB(@3)
DropUPnP(@5)
DropUPnP(@6)
#
# Drop 'newnotsyn' traffic so that it doesn't get logged.
#

View File

@@ -1,14 +1,14 @@
#
# Shorewall version 5 - Drop Smurfs Action
# Shorewall -- /usr/share/shorewall/action.DropSmurfs
#
# /usr/share/shorewall/action.DropSmurfs
# Drop Smurfs Action
#
# Accepts a single optional parameter:
# Accepts a single optional parameter:
#
# - = Do not Audit
# audit = Audit dropped packets.
# - = Do not Audit
# audit = Audit dropped packets.
#
#################################################################################
###############################################################################
DEFAULTS -
@@ -79,8 +79,3 @@ if ( $family == F_IPV4 ) {
}
?end perl;

View File

@@ -1,48 +1,35 @@
#
# Shorewall 5 - Established Action
# Shorewall -- /usr/share/shorewall/action.Established
#
# /usr/share/shorewall/action.Established
# Established Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Established[([<action>])]
# Established[([<action>])]
#
# Default action is ACCEPT
# Default action is ACCEPT
#
##########################################################################################
###############################################################################
DEFAULTS ACCEPT
?begin perl;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my ( $action ) = get_action_params( 1 );
if ( my $check = check_state( 'ESTABLISHED' ) ) {
perl_action_helper( $action, $check == 1 ? state_match('ESTABLISHED') : '', 'ESTABLISHED' );
}
1;
?end perl;
#
# All logic for this action is supplied by the 'state' option in actions.std
#

View File

@@ -1,33 +1,25 @@
#
# Shorewall version 5 - GlusterFS Handler for GlusterFS 3.4 and Later
# Shorewall -- /usr/share/shorewall/action.GlusterFS
#
# /etc/shorewall/action.GlusterFS
# GlusterFS Handler for GlusterFS 3.4 and Later
#
# Parameters:
# Bricks: Number of bricks
# IB: 0 or 1, indicating whether Infiniband is used or not
#
#########################################################################################
# Bricks - Number of bricks
# IB - 0 or 1, indicating whether Infiniband is used or not
#
###############################################################################
DEFAULTS 2,0
?begin perl
?if @1 !~ /^\d+/ || ! @1 || @1 > 1024
?error Invalid value for Bricks (@1)
?elsif @2 !~ /^[01]$/
?error Invalid value for IB (@2)
?endif
use Shorewall::Config qw(:DEFAULT :internal);
use Shorewall::Chains;
use Shorewall::Rules;
use strict;
#ACTION SOURCE DEST PROTO DPORT
my ( $bricks, $ib ) = get_action_params( 2 );
fatal_error "Invalid value for Bricks ( $bricks )" unless $bricks =~ /^\d+$/ && $bricks > 1 && $bricks < 1024;
fatal_error "Invalid value for IB ( $ib )" unless $ib =~ /^[01]$/;
?end perl
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
# PORT PORT(S) DEST LIMIT GROUP
ACCEPT - - udp 111,2049
ACCEPT - - tcp 38465:38467
@@ -40,4 +32,3 @@ ACCEPT - - tcp 24007
?set last_port 49150 + @{1}
ACCEPT - - tcp 49151:$last_port

View File

@@ -1,34 +1,38 @@
#
# Shorewall version 5 - Perform an Action based on a Event
# Shorewall -- /usr/share/shorewall/action.IfEvent
#
# /etc/shorewall/action.IfEvent
# Perform an Action based on a Event
#
# Parameters:
# Event: Must start with a letter and be composed of letters, digits, '-', and '_'.
# Action: Anything that can appear in the ACTION column of a rule.
# Duration: Duration in seconds over which the event is to be tested.
# Hit Count: Number of packets seen within the duration -- default is 1
# Src or Dest: 'src' (default) or 'dst'. Determines if the event is associated with the source
# address (src) or destination address (dst)
# Command: 'check' (default) 'reset', or 'update'. If 'reset', the event will be reset before
# the Action is taken. If 'update', the timestamp associated with the event will
# be updated and the action taken if the time limit/hitcount are matched.
# If '-', the action will be taken if the limit/hitcount are matched but the
# event's timestamp will not be updated.
#
# If a duration is specified, then 'checkreap' and 'updatereap' may also
# be used. These are like 'check' and 'update' respectively, but they also
# remove any event entries for the IP address that are older than <duration>
# seconds.
# Disposition: Disposition for any event generated.
# Event - Must start with a letter and be composed of letters, digits,
# '-', and '_'.
# Action - Anything that can appear in the ACTION column of a rule.
# Duration - Duration in seconds over which the event is to be tested.
# Hit Count - Number of packets seen within the duration -- default is 1
# Src or Dest - 'src' (default) or 'dst'. Determines if the event is
# associated with the source address (src) or destination
# address (dst)
# Command - 'check' (default) 'reset', or 'update'. If 'reset',
# the event will be reset before the Action is taken.
# If 'update', the timestamp associated with the event will
# be updated and the action taken if the time limit/hitcount
# are matched.
# If '-', the action will be taken if the limit/hitcount are
# matched but the event's timestamp will not be updated.
#
# If a duration is specified, then 'checkreap' and 'updatereap'
# may also be used. These are like 'check' and 'update'
# respectively, but they also remove any event entries for
# the IP address that are older than <duration> seconds.
# Disposition - Disposition for any event generated.
#
# For additional information, see http://www.shorewall.net/Events.html
#
#######################################################################################################
###############################################################################
# DO NOT REMOVE THE FOLLOWING LINE
#################################################################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
# PORT PORT(S) DEST LIMIT GROUP
###############################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT
DEFAULTS -,ACCEPT,-,1,src,check,-

View File

@@ -1,53 +1,35 @@
#
# Shorewall 4 - Invalid Action
# Shorewall -- /usr/share/shorewall/action.Invalid
#
# /usr/share/shorewall/action.Invalid
# Invalid Action
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
# Complete documentation is available at http://shorewall.net
#
# Complete documentation is available at http://shorewall.net
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Invalid[([<action>])]
#
# Invalid[([<action>])]
# Default action is DROP
#
# Default action is DROP
#
##########################################################################################
###############################################################################
DEFAULTS DROP,-
?begin perl;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my ( $action, $audit ) = get_action_params( 2 );
if ( supplied $audit ) {
fatal_error "Invalid parameter ($audit) to action Invalid" if $audit ne 'audit';
$action = "A_$action";
}
if ( my $check = check_state( 'INVALID' ) ) {
perl_action_helper( $action, $check == 1 ? state_match( 'INVALID' ) : '' , 'INVALID' );
}
1;
?end perl;
#
# All logic for this action is triggered by the 'audit' and 'state' options
# in actions.std
#

View File

@@ -1,48 +1,35 @@
#
# Shorewall 4 - New Action
# Shorewall -- /usr/share/shorewall/action.New
#
# /usr/share/shorewall/action.New
# New Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Untracked[([<action>])]
# New[([<action>])]
#
# Default action is ACCEPT
# Default action is ACCEPT
#
##########################################################################################
###############################################################################
DEFAULTS ACCEPT
?begin perl;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my ( $action ) = get_action_params( 1 );
if ( my $check = check_state( 'NEW' ) ) {
perl_action_helper( $action, $check == 1 ? state_match( 'NEW' ) : '' , 'NEW' );
}
1;
?end perl;
#
# All logic for this action is supplied by the 'state' option in actions.std
#

View File

@@ -1,52 +1,33 @@
#
# Shorewall 4 - NotSyn Action
# Shorewall -- /usr/share/shorewall/action.NotSyn
#
# /usr/share/shorewall/action.NotSyn
# NotSyn Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# NotSyn[([<action>])]
# NotSyn[([<action>])]
#
# Default action is DROP
# Default action is DROP
#
##########################################################################################
###############################################################################
DEFAULTS DROP,-
?begin perl;
use strict;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my ( $action, $audit ) = get_action_params( 2 );
if ( supplied $audit ) {
fatal_error "Invalid parameter ($audit) to action NotSyn" if $audit ne 'audit';
$action = "A_$action";
}
perl_action_tcp_helper( $action, '-p 6 ! --syn' );
1;
?end perl;
@1 - - ;;+ -p 6 ! --syn

View File

@@ -1,50 +1,33 @@
#
# Shorewall 4 - RST Action
# Shorewall -- /usr/share/shorewall/action.RST
#
# /usr/share/shorewall/action.RST
# RST Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2012 - Tom Eastep (teastep@shorewall.net)
# (c) 2012-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# RST[([<action>])]
# RST[([<action>])]
#
# Default action is DROP
# Default action is DROP
#
##########################################################################################
###############################################################################
DEFAULTS DROP,-
?begin perl;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my ( $action, $audit ) = get_action_params( 2 );
if ( supplied $audit ) {
fatal_error "Invalid parameter ($audit) to action RST" if $audit ne 'audit';
$action = "A_$action";
}
perl_action_tcp_helper( $action, '-p 6 --tcp-flags RST RST' );
1;
?end perl;
@1 - - ;;+ -p 6 --tcp-flags RST RST

View File

@@ -1,58 +1,44 @@
#
# Shorewall version 5 - Reject Action
# Shorewall -- /usr/share/shorewall/action.Reject
#
# /usr/share/shorewall/action.Reject
# The default REJECT action common rules
#
# The default REJECT action common rules
# This action is invoked before a REJECT policy is enforced. The purpose
# of the action is:
#
# This action is invoked before a REJECT policy is enforced. The purpose
# of the action is:
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
# The action accepts six optional parameters:
#
# The action accepts five optional parameters:
#
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
# actions.
# 2 - Action to take with Auth requests. Default is to do nothing
# special with them.
# 3 - Action to take with SMB requests. Default is REJECT or A_REJECT,
# depending on the setting of the first parameter.
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
# A_ACCEPT depending on the first parameter.
# 5 - Action to take with late UDP replies (UDP source port 53). Default
# is DROP or A_DROP depending on the first parameter.
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
# actions.
# 2 - Action to take with Auth requests. Default is to do nothing
# special with them.
# 3 - Action to take with SMB requests. Default is REJECT or A_REJECT,
# depending on the setting of the first parameter.
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
# A_ACCEPT depending on the first parameter.
# 5 - Action to take with late UDP replies (UDP source port 53). Default
# is DROP or A_DROP depending on the first parameter.
# 6 - Action to take with UPnP packets. Default is DROP or A_DROP
# depending on the first parameter.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
###############################################################################
#
# The following magic provides different defaults for @2 thru @5, when @1 is
# 'audit'.
#
?begin perl;
use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
?if passed(@1)
?if @1 eq 'audit'
DEFAULTS -,-,A_REJECT,A_ACCEPT,A_DROP,A_DROP
?else
?error The first parameter to Reject must be 'audit' or '-'
?endif
?else
DEFAULTS -,-,REJECT,ACCEPT,DROP,DROP
?endif
if ( defined $p1 ) {
if ( $p1 eq 'audit' ) {
set_action_param( 3, 'A_REJECT') unless supplied $p3;
set_action_param( 4, 'A_ACCEPT' ) unless supplied $p4;
set_action_param( 5, 'A_DROP' ) unless supplied $p5;
} else {
fatal_error "Invalid value ($p1) for first Reject parameter" if supplied $p1;
}
}
1;
?end perl;
DEFAULTS -,-,REJECT,ACCEPT,DROP
#TARGET SOURCE DEST PROTO
#ACTION SOURCE DEST PROTO
#
# Count packets that come through here
#
@@ -60,19 +46,22 @@ COUNT
#
# Special handling for Auth
#
?if @2 ne '-'
?if passed(@2)
Auth(@2)
?endif
#
# ACCEPT critical ICMP types
#
# For IPv6 connectivity ipv6-icmp broadcasting is required so
# AllowICMPs must be before silent broadcast Drop.
#
AllowICMPs(@4) - - icmp
#
# Drop Broadcasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
Broadcast(DROP,@1)
#
# ACCEPT critical ICMP types
#
AllowICMPs(@4) - - icmp
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log (these ICMPs cannot be
# rejected).
@@ -82,7 +71,7 @@ Invalid(DROP,@1)
# Reject Microsoft noise so that it doesn't clutter up the log.
#
SMB(@3)
DropUPnP(@5)
DropUPnP(@6)
#
# Drop 'newnotsyn' traffic so that it doesn't get logged.
#

View File

@@ -1,49 +1,35 @@
#
# Shorewall 4 - Related Action
# Shorewall -- /usr/share/shorewall/action.Related
#
# /usr/share/shorewall/action.Related
# Related Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Related[([<action>])]
# Related[([<action>])]
#
# Default action is DROP
# Default action is DROP
#
##########################################################################################
###############################################################################
DEFAULTS DROP
?begin perl;
use strict;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my ( $action ) = get_action_params( 1 );
if ( my $check = check_state( 'RELATED' ) ) {
perl_action_helper( $action, $check == 1 ? state_match( 'RELATED' ) : '', 'RELATED' );
}
1;
?end perl;
#
# All logic for this action is supplied by the 'state' option in actions.std
#

View File

@@ -1,22 +1,24 @@
#
# Shorewall version 5 - Reset an Event
# Shorewall -- /etc/shorewall/action.ResetEvent
#
# /etc/shorewall/action.ResetEvent
# Reset an Event
#
# Parameters:
# Event: Must start with a letter and be composed of letters, digits, '-', and '_'.
# Action: Action to perform after setting the event. Default is ACCEPT
# Src or Dest: 'src' (default) or 'dst'. Determines if the event is associated with the source
# address (src) or destination address (dst)
# Disposition: Disposition for any rule generated.
#
# Event - Must start with a letter and be composed of letters, digits,
# '-', and '_'.
# Action - Action to perform after setting the event. Default is ACCEPT
# Src or Dest - 'src' (default) or 'dst'. Determines if the event is
# associated with the source address (src) or destination
# address (dst)
# Disposition - Disposition for any rule generated.
#
# For additional information, see http://www.shorewall.net/Events.html
#
#######################################################################################################
# DO NOT REMOVE THE FOLLOWING LINE
#################################################################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
# PORT PORT(S) DEST LIMIT GROUP
###############################################################################
# DO NOT REMOVE THE FOLLOWING LINE
##############################################################################################################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER MARK CONNLIMIT TIME HEADERS SWITCH HELPER
DEFAULTS -,ACCEPT,src,-

View File

@@ -1,22 +1,20 @@
#
# Shorewall version 5 - Set an Event
# Shorewall -- /usr/share/shorewall/action.SetEvent
#
# /etc/shorewall/action.SetEvent
# Set an Event
#
# Parameters:
# Event: Must start with a letter and be composed of letters, digits, '-', and '_'.
# Action: Action to perform after setting the event. Default is ACCEPT
# Src or Dest: 'src' (default) or 'dst'. Determines if the event is associated with the source
# address (src) or destination address (dst)
# Disposition: Disposition for any event generated.
#
# Event - Must start with a letter and be composed of letters, digits,
# '-', and '_'.
# Action - Action to perform after setting the event. Default is ACCEPT
# Src or Dest - 'src' (default) or 'dst'. Determines if the event is
# associated with the source address (src) or destination
# address (dst)
# Disposition - Disposition for any event generated.
#
# For additional information, see http://www.shorewall.net/Events.html
#
#######################################################################################################
# DO NOT REMOVE THE FOLLOWING LINE
#################################################################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
# PORT PORT(S) DEST LIMIT GROUP
DEFAULTS -,ACCEPT,src

View File

@@ -1,41 +1,29 @@
#
# Shorewall version 5 - Drop TCPFlags Action
# Shorewall -- /usr/share/shorewall/action.TCPFlags
#
# /usr/share/shorewall/action.TCPFlags
# Drop TCPFlags Action
#
# Accepts a single optional parameter:
# Accepts a single optional parameter:
#
# - = Do not Audit
# audit = Audit dropped packets.
# - = Do not Audit
# audit = Audit dropped packets.
#
#################################################################################
###############################################################################
DEFAULTS -
?begin perl;
use strict;
use Shorewall::Config qw(:DEFAULT F_IPV4 F_IPV6);
use Shorewall::Chains;
use Shorewall::Rules;
my $action = 'DROP';
my ( $audit ) = get_action_params( 1 );
if ( supplied $audit ) {
fatal_error "Invalid parameter ($audit) to action TCPFlags" if $audit ne 'audit';
$action = "A_DROP";
}
perl_action_tcp_helper( $action, '-p tcp --tcp-flags ALL FIN,URG,PSH' );
perl_action_tcp_helper( $action, '-p tcp --tcp-flags ALL NONE' );
perl_action_tcp_helper( $action, '-p tcp --tcp-flags SYN,RST SYN,RST' );
perl_action_tcp_helper( $action, '-p tcp --tcp-flags SYN,FIN SYN,FIN' );
perl_action_tcp_helper( $action, '-p tcp --syn --sport 0' );
?end perl;
?if passed(@1)
?if @1 eq 'audit'
?set tcpflags_action 'A_DROP'
?else
?error The parameter to TCPFlags must be 'audit' or '-'
?endif
?else
?set tcpflags_action 'DROP'
?endif
$tcpflags_action - - ;;+ -p 6 --tcp-flags ALL FIN,URG,PSH
$tcpflags_action - - ;;+ -p 6 --tcp-flags ALL NONE
$tcpflags_action - - ;;+ -p 6 --tcp-flags SYN,RST SYN,RST
$tcpflags_action - - ;;+ -p 6 --tcp-flags SYN,FIN SYN,FIN
$tcpflags_action - - ;;+ -p tcp --syn --sport 0

View File

@@ -1,47 +1,35 @@
#
# Shorewall 4 - Untracked Action
# Shorewall --/usr/share/shorewall/action.Untracked
#
# /usr/share/shorewall/action.Untracked
# Untracked Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Untracked[([<action>])]
# Untracked[([<action>])]
#
# Default action is DROP
# Default action is DROP
#
##########################################################################################
###############################################################################
DEFAULTS DROP
?begin perl;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my ( $action ) = get_action_params( 1 );
if ( my $check = check_state( 'UNTRACKED' ) ) {
perl_action_helper( $action, $check == 1 ? state_match( 'UNTRACKED' ) : '' , 'UNTRACKED' );
}
1;
?end perl;
#
# All logic for this action is supplied by the 'state' option in actions.std
#

View File

@@ -1,52 +1,37 @@
\#
# Shorewall 4 - allowInvalid Action
#
# /usr/share/shorewall/action.allowInvalid
# Shorewall -- /usr/share/shorewall/action.allowInvalid
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# allowInvalid[([audit])]
# allowInvalid[([audit])]
#
##########################################################################################
###############################################################################
DEFAULTS -
?begin perl;
use strict;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my $action = 'ACCEPT';
my ( $audit ) = get_action_params( 1 );
if ( supplied $audit ) {
fatal_error "Invalid parameter ($audit) to action allowInvalid" if $audit ne 'audit';
$action = "A_ACCEPT";
}
perl_action_helper( "Invalid($action)", '' );
1;
?end perl;
?if passed(@1)
?if @1 eq 'audit'
Invalid(A_ACCEPT)
?else
?error The first parameter to allowInvalid must be 'audit' or '-'
?endif
?else
Invalid(ACCEPT)
?endif

View File

@@ -1,52 +1,39 @@
#
# Shorewall 5 - dropInvalid Action
# Shorewall -- /usr/share/shorewall/action.dropInvalid
#
# /usr/share/shorewall/action.dropInvalid
# dropInvalid Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# dropInvalid[([audit])]
# dropInvalid[([audit])]
#
##########################################################################################
###############################################################################
DEFAULTS -
?begin perl;
use strict;
use Shorewall::IPAddrs;
use Shorewall::Config;
use Shorewall::Chains;
use Shorewall::Rules;
my $action = 'DROP';
my ( $audit ) = get_action_params( 1 );
if ( supplied $audit ) {
fatal_error "Invalid parameter ($audit) to action dropInvalid" if $audit ne 'audit';
$action = "A_DROP";
}
perl_action_helper( "Invalid($action)", '' );
1;
?end perl;
?if passed(@1)
?if @1 eq 'audit'
Invalid(A_DROP)
?else
?error The first parameter to dropInvalid must be 'audit' or '-'
?endif
?else
Invalid(DROP)
?endif

View File

@@ -0,0 +1,22 @@
#
# Shorewall -- /etc/shorewall/action.mangletemplate
#
# Mangle Action Template
#
# This file is a template for files with names of the form
# /etc/shorewall/action.<action-name> where <action> is an
# ACTION defined with the mangle option in /etc/shorewall/actions.
#
# To define a new action:
#
# 1. Add the <action name> to /etc/shorewall/actions with the mangle option
# 2. Copy this file to /etc/shorewall/action.<action name>
# 3. Add the desired rules to that file.
#
# Please see http://shorewall.net/Actions.html for additional
# information.
#
# Columns are the same as in /etc/shorewall/mangle.
#
####################################################################################################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT USER TEST LENGTH TOS CONNBYTES HELPER PROBABILITY DSCP

View File

@@ -1,20 +1,20 @@
#
# Shorewall version 5 - Action Template
# Shorewall -- /usr/share/shorewall/action.template
#
# /etc/shorewall/action.template
# Action Template
#
# This file is a template for files with names of the form
# /etc/shorewall/action.<action-name> where <action> is an
# ACTION defined in /etc/shorewall/actions.
# This file is a template for files with names of the form
# /etc/shorewall/action.<action-name> where <action> is an
# ACTION defined in /etc/shorewall/actions.
#
# To define a new action:
# To define a new action:
#
# 1. Add the <action name> to /etc/shorewall/actions
# 2. Copy this file to /etc/shorewall/action.<action name>
# 3. Add the desired rules to that file.
# 1. Add the <action name> to /etc/shorewall/actions
# 2. Copy this file to /etc/shorewall/action.<action name>
# 3. Add the desired rules to that file.
#
# Please see http://shorewall.net/Actions.html for additional
# information.
# Please see http://shorewall.net/Actions.html for additional
# information.
#
# Columns are the same as in /etc/shorewall/rules.
#

View File

@@ -8,43 +8,45 @@
#
# Builtin Actions are:
#
# A_ACCEPT # Audits then accepts a connection request
# A_DROP # Audits then drops a connection request
# A_REJECT # Audits then drops a connection request
# allowBcast # Silently Allow Broadcast/multicast
# dropBcast # Silently Drop Broadcast/multicast
# dropNotSyn # Silently Drop Non-syn TCP packets
# rejNotSyn # Silently Reject Non-syn TCP packets
# allowoutUPnP # Allow traffic from local command 'upnpd' (does not
# # work with kernel 2.6.14 and later).
# allowinUPnP # Allow UPnP inbound (to firewall) traffic
# forwardUPnP # Allow traffic that upnpd has redirected from
# # 'upnp' interfaces.
# Limit # Limit the rate of connections from each individual
# # IP address
#
?if 0
A_ACCEPT # Audits then accepts a connection request
A_DROP # Audits then drops a connection request
allowBcast # Silently Allow Broadcast/multicast
dropBcast # Silently Drop Broadcast/multicast
dropNotSyn # Silently Drop Non-syn TCP packets
rejNotSyn # Silently Reject Non-syn TCP packets
allowinUPnP # Allow UPnP inbound (to firewall) traffic
forwardUPnP # Allow traffic that upnpd has redirected from 'upnp' interfaces.
Limit # Limit the rate of connections from each individual IP address
?endif
###############################################################################
#ACTION
A_Drop # Audited Default Action for DROP policy
A_REJECT noinline,logjump # Audits then rejects a connection request
A_REJECT! inline # Audits then rejects a connection request
A_Reject # Audited Default action for REJECT policy
allowInvalid inline # Accepts packets in the INVALID conntrack state
AutoBL noinline # Auto-blacklist IPs that exceed thesholds
AutoBLL noinline # Helper for AutoBL
Broadcast noinline # Handles Broadcast/Multicast/Anycast
Broadcast noinline,audit # Handles Broadcast/Multicast/Anycast
DNSAmp # Matches one-question recursive DNS queries
Drop # Default Action for DROP policy
dropInvalid inline # Drops packets in the INVALID conntrack state
DropSmurfs noinline # Drop smurf packets
Established inline # Handles packets in the ESTABLISHED state
Established inline,\ # Handles packets in the ESTABLISHED state
state=ESTABLISHED #
GlusterFS inline # Handles GlusterFS
IfEvent noinline # Perform an action based on an event
Invalid inline # Handles packets in the INVALID conntrack state
New inline # Handles packets in the NEW conntrack state
NotSyn inline # Handles TCP packets which do not have SYN=1 and ACK=0
Invalid inline,audit,\ # Handles packets in the INVALID conntrack state
state=INVALID #
New inline,state=NEW # Handles packets in the NEW conntrack state
NotSyn inline,audit # Handles TCP packets which do not have SYN=1 and ACK=0
Reject # Default Action for REJECT policy
Related inline # Handles packets in the RELATED conntrack state
Related inline,\ # Handles packets in the RELATED conntrack state
state=RELATED #
ResetEvent inline # Reset an Event
RST inline # Handle packets with RST set
RST inline,audit # Handle packets with RST set
SetEvent inline # Initialize an event
TCPFlags # Handle bad flag combinations.
Untracked inline # Handles packets in the UNTRACKED conntrack state
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
state=UNTRACKED #

View File

@@ -17,6 +17,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################
@@ -150,6 +156,8 @@ DETECT_DNAT_IPADDRS=No
DISABLE_IPV6=No
DOCKER=No
DONT_LOAD=
DYNAMIC_BLACKLIST=Yes
@@ -186,6 +194,8 @@ MAPOLDACTIONS=No
MARK_IN_FORWARD_CHAIN=No
MINIUPNPD=No
MODULE_SUFFIX=ko
MULTICAST=No

View File

@@ -2,7 +2,7 @@
#
# Script to install Shoreline Firewall
#
# (c) 2000-201,2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.net
#
@@ -419,11 +419,13 @@ mkdir -p ${DESTDIR}${CONFDIR}/$PRODUCT
mkdir -p ${DESTDIR}${LIBEXECDIR}/$PRODUCT
mkdir -p ${DESTDIR}${PERLLIBDIR}/Shorewall
mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated
mkdir -p ${DESTDIR}${VARDIR}
chmod 755 ${DESTDIR}${CONFDIR}/$PRODUCT
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated
if [ -n "$DESTDIR" ]; then
mkdir -p ${DESTDIR}${CONFDIR}/logrotate.d
@@ -512,7 +514,7 @@ echo "Default config path file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/confi
# Install the Standard Actions file
#
install_file actions.std ${DESTDIR}${SHAREDIR}/$PRODUCT/actions.std 0644
echo "Standard actions file installed as ${DESTDIR}${SHAREDIR}d/$PRODUCT/actions.std"
echo "Standard actions file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/actions.std"
cd configfiles
@@ -1060,15 +1062,31 @@ fi
# Install the Action files
#
for f in action.* ; do
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
case $f in
*.deprecated)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*} 0644
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*}"
;;
*)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
;;
esac
done
cd Macros
for f in macro.* ; do
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
case $f in
*.deprecated)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*} 0644
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*}"
;;
*)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
;;
esac
done
cd ..
@@ -1159,6 +1177,8 @@ fi
# Install the Man Pages
#
if [ -n "$MANDIR" ]; then
cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
@@ -1178,6 +1198,7 @@ done
cd ..
echo "Man Pages Installed"
fi
if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then
run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT

View File

@@ -316,6 +316,55 @@ get_config() {
g_loopback=$(find_loopback_interfaces)
if [ -n "$PAGER" -a -t 1 ]; then
case $PAGER in
/*)
g_pager="$PAGER"
[ -f "$g_pager" ] || fatal_error "PAGER $PAGER does not exist"
;;
*)
g_pager=$(mywhich pager 2> /dev/null)
[ -n "$g_pager" ] || fatal_error "PAGER $PAGER not found"
;;
esac
[ -x "$g_pager" ] || fatal_error "PAGER $g_pager is not executable"
g_pager="| $g_pager"
fi
if [ -n "$DYNAMIC_BLACKLIST" ]; then
case $DYNAMIC_BLACKLIST in
[Nn]o)
DYNAMIC_BLACKLIST='';
;;
[Yy]es)
;;
ipset|ipset::*|ipset-only|ipset-only::*|ipset,src-dst|ipset-only,src-dst::*)
g_blacklistipset=SW_DBL$g_family
;;
ipset:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
ipset,src-dst:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset,src-dst:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
ipset-only:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
ipset-only,src-dst:[a-zA-Z]*)
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only,src-dst:}
g_blacklistipset=${g_blacklistipset%%:*}
;;
*)
fatal_error "Invalid value ($DYNAMIC_BLACKLIST) for DYNAMIC_BLACKLIST"
;;
esac
fi
lib=$(find_file lib.cli-user)
[ -f $lib ] && . $lib
@@ -386,7 +435,7 @@ compiler() {
get_config Yes
case $COMMAND in
*start|try|refresh)
*start|try|refresh|reload|restart|safe-*)
;;
*)
STARTUP_LOG=
@@ -453,11 +502,15 @@ compiler() {
[ -n "$g_doing" ] && progress_message3 "$g_doing using $g_product $SHOREWALL_VERSION..."
;;
esac
#
# Only use the pager if 'trace' or -r was specified and -d was not
#
[ "$g_debugging" != trace -a -z "$g_preview" ] || [ -n "$g_debug" ] && g_pager=
if [ ${PERLLIBDIR} = ${LIBEXECDIR}/shorewall ]; then
$PERL $debugflags $pc $options $@
eval $PERL $debugflags $pc $options $@ $g_pager
else
PERL5LIB=${PERLLIBDIR} $PERL $debugflags $pc $options $@
eval PERL5LIB=${PERLLIBDIR} $PERL $debugflags $pc $options $@ $g_pager
fi
status=$?
@@ -477,7 +530,6 @@ compiler() {
start_command() {
local finished
finished=0
local object
local rc
rc=0
@@ -496,7 +548,7 @@ start_command() {
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:$g_product start failed"
mylogger kern.err "ERROR:$g_product start failed"
fi
fi
@@ -587,7 +639,7 @@ start_command() {
esac
if [ -n "${g_fast}${AUTOMAKE}" ]; then
if ! uptodate ${VARDIR}/$object; then
if ! uptodate ${VARDIR}/firewall; then
g_fast=
AUTOMAKE=
fi
@@ -976,7 +1028,7 @@ restart_command() {
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:$g_product ${COMMAND} failed"
mylogger kern.err "ERROR:$g_product ${COMMAND} failed"
fi
else
[ -x ${VARDIR}/firewall ] || fatal_error "No ${VARDIR}/firewall file found"

View File

@@ -53,7 +53,19 @@
<variablelist>
<varlistentry>
<term>builtin</term>
<term><option>audit</option></term>
<listitem>
<para>Added in Shorewall 5.0.7. When this option is specified,
the action is expected to have at least two parameters; the
first is a target and the second is either 'audit' or omitted.
If the second is 'audit', then the first must be an auditable
target (ACCEPT, DROP or REJECT).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>builtin</option></term>
<listitem>
<para>Added in Shorewall 4.5.16. Defines the action as a rule
@@ -86,7 +98,7 @@
</varlistentry>
<varlistentry>
<term>inline</term>
<term><option>inline</option></term>
<listitem>
<para>Causes the action body (defined in
@@ -102,10 +114,10 @@
way:</para>
<simplelist>
<member>Broadcast</member>
<member>DropSmurfs</member>
<member>IfEvent</member>
<member>Invalid (Prior to Shorewall 4.5.13)</member>
<member>NotSyn (Prior to Shorewall 4.5.13)</member>
@@ -119,7 +131,31 @@
</varlistentry>
<varlistentry>
<term>noinline</term>
<term><option>logjump</option></term>
<listitem>
<para>Added in Shorewall 5.0.8. Performs the same function as
<option>nolog</option> (below), with the addition that the
jump to the actions chain is logged if a log level is
specified on the action invocation. For inline actions, this
option is identical to <option>nolog</option>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>mangle</option></term>
<listitem>
<para>Added in Shorewall 5.0.7. Specifies that this action is
to be used in <ulink
url="shorewall-mangle.html">shorewall-mangle(5)</ulink> rather
than <ulink
url="shorewall-rules.html">shorewall-rules(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>noinline</option></term>
<listitem>
<para>Causes any later <option>inline</option> option for the
@@ -128,7 +164,7 @@
</varlistentry>
<varlistentry>
<term>nolog</term>
<term><option>nolog</option></term>
<listitem>
<para>Added in Shorewall 4.5.11. When this option is
@@ -142,7 +178,16 @@
</varlistentry>
<varlistentry>
<term>terminating</term>
<term><option>state</option>={<option>UNTRACKED</option>|<option>NEW</option>|<option>ESTABLISHED</option>|<option>RELATED</option>|<option>INVALID</option>}</term>
<listitem>
<para>Added in Shorewall 5.0.7. Reserved for use by Shorewall
in <filename>actions.std</filename>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>terminating</option></term>
<listitem>
<para>Added in Shorewall 4.6.4. When used with

View File

@@ -488,6 +488,15 @@ loc eth2 -</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">nodbl</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.8. When specified, dynamic
blacklisting is disabled on the interface.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">nosmurfs</emphasis></term>

View File

@@ -68,8 +68,9 @@
<replaceable>command</replaceable>[(<replaceable>parameters</replaceable>)][:<replaceable>chain-designator</replaceable>]</term>
<listitem>
<para>The chain-specifier indicates the Netfilter chain that the
entry applies to and may be one of the following:</para>
<para>The <replaceable>chain-designator </replaceable>indicates the
Netfilter chain that the entry applies to and may be one of the
following:</para>
<variablelist>
<varlistentry>
@@ -111,10 +112,14 @@
url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink>, and
FORWARD when MARK_IN_FORWARD_CHAIN=Yes.</para>
<para>A chain-designator may not be specified if the SOURCE or DEST
columns begin with '$FW'. When the SOURCE is $FW, the generated rule
is always placed in the OUTPUT chain. If DEST is '$FW', then the
rule is placed in the INPUT chain.</para>
<para>A <replaceable>chain-designator</replaceable> may not be
specified if the SOURCE or DEST columns begin with '$FW'. When the
SOURCE is $FW, the generated rule is always placed in the OUTPUT
chain. If DEST is '$FW', then the rule is placed in the INPUT chain.
Additionally, a <replaceable>chain-designator</replaceable> may not
be specified in an action body unless the action is declared as
<option>inline</option> in <ulink
url="shorewall6-actions.html">shorewall-actions</ulink>(5).</para>
<para>Where a command takes parameters, those parameters are
enclosed in parentheses ("(....)") and separated by commas.</para>
@@ -123,6 +128,21 @@
following.</para>
<variablelist>
<varlistentry>
<term><emphasis
role="bold"><replaceable>action</replaceable>[([<replaceable>param</replaceable>[,...])]</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.7.
<replaceable>action</replaceable> must be an action declared
with the <option>mangle</option> option in <ulink
url="manpages/shorewall-actions.html">shorewall-actions(5)</ulink>.
If the action accepts paramaters, they are specified as a
comma-separated list within parentheses following the
<replaceable>action</replaceable> name.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">ADD(<replaceable>ipset</replaceable>:<replaceable>flags</replaceable>)</emphasis></term>
@@ -339,6 +359,18 @@ DIVERTHA - - tcp</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">ECN</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.6 as an alternative to entries in
<ulink url="shorewall-ecn.html">shorewall-ecn(5)</ulink>. If a
PROTO is specified, it must be 'tcp' (6). If no PROTO is
supplied, TCP is assumed. This action causes all ECN bits in
the TCP header to be cleared.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">IMQ</emphasis>(<replaceable>number</replaceable>)</term>
@@ -358,7 +390,7 @@ DIVERTHA - - tcp</programlisting>
<para>Allows you to place your own ip[6]tables matches at the
end of the line following a semicolon (";"). If an
<replaceable>action</replaceable> is specified, the compiler
procedes as if that <replaceable>action</replaceable> had been
proceeds as if that <replaceable>action</replaceable> had been
specified in this column. If no action is specified, then you
may include your own jump ("-j
<replaceable>target</replaceable>
@@ -472,7 +504,7 @@ INLINE eth0 - ; -p tcp -j MARK --set
<member>0xc0a80403 LAND 0xFF = 0x03</member>
<member>0x03 LOR 0x0x10100 = 0x10103 or class ID
<member>0x03 LOR 0x10100 = 0x10103 or class ID
1:103</member>
</simplelist>
</blockquote>
@@ -708,33 +740,6 @@ Normal-Service =&gt; 0x00</programlisting>
</listitem>
</varlistentry>
</variablelist>
<orderedlist numeration="arabic">
<listitem>
<para><emphasis role="bold">TTL</emphasis>([<emphasis
role="bold">-</emphasis>|<emphasis
role="bold">+</emphasis>]<replaceable>number</replaceable>)</para>
<para>Added in Shorewall 4.4.24.</para>
<para>Prior to Shorewall 4.5.7.2, may be optionally followed by
<emphasis role="bold">:F</emphasis> but the resulting rule is
always added to the FORWARD chain. Beginning with Shorewall
4.5.7.s, it may be optionally followed by <emphasis
role="bold">:P</emphasis>, in which case the rule is added to
the PREROUTING chain.</para>
<para>If <emphasis role="bold">+</emphasis> is included, packets
matching the rule will have their TTL incremented by
<replaceable>number</replaceable>. Similarly, if <emphasis
role="bold">-</emphasis> is included, matching packets have
their TTL decremented by <replaceable>number</replaceable>. If
neither <emphasis role="bold">+</emphasis> nor <emphasis
role="bold">-</emphasis> is given, the TTL of matching packets
is set to <replaceable>number</replaceable>. The valid range of
values for <replaceable>number</replaceable> is 1-255.</para>
</listitem>
</orderedlist>
</listitem>
</varlistentry>

View File

@@ -130,7 +130,7 @@
<varlistentry>
<term><emphasis role="bold">GATEWAY</emphasis> - {<emphasis
role="bold">-</emphasis>|<emphasis>address</emphasis>[,<emphasis>mac</emphasis>]|<emphasis
role="bold">detect</emphasis>}</term>
role="bold">detect|none</emphasis>}</term>
<listitem>
<para>The IP address of the provider's gateway router. Beginning
@@ -139,8 +139,12 @@
interface. When the MAC is not specified, Shorewall will detect the
MAC during firewall start or restart.</para>
<para>You can enter "detect" here and Shorewall will attempt to
detect the gateway automatically.</para>
<para>You can enter <emphasis role="bold">detect</emphasis> here and
Shorewall will attempt to detect the gateway automatically.</para>
<para>Beginning with Shorewall 5.0.6, you may also enter <emphasis
role="bold">none</emphasis>. This causes creation of a routing table
with no default route in it.</para>
<para>For PPP devices, you may omit this column.</para>
</listitem>

View File

@@ -328,6 +328,18 @@
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">CONMARK({<replaceable>mark</replaceable>})</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.7, CONNMARK is identical to MARK
with the exception that the mark is assigned to connection to
which the packet belongs is marked rather than to the packet
itself.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">CONTINUE</emphasis></term>
@@ -546,6 +558,35 @@
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">MARK({<replaceable>mark</replaceable>})</emphasis></term>
<listitem>
<para>where <replaceable>mark</replaceable> is a packet mark
value.</para>
<para>Added in Shorewall 5.0.7, MARK requires "Mark in filter
table" support in your kernel and iptables.</para>
<para>Normally will set the mark value of the current packet.
If preceded by a vertical bar ("|"), the mark value will be
logically ORed with the current mark value to produce a new
mark value. If preceded by an ampersand ("&amp;"), will be
logically ANDed with the current mark value to produce a new
mark value.</para>
<para>Both "|" and "&amp;" require Extended MARK Target
support in your kernel and iptables.</para>
<para>The mark value may be optionally followed by "/" and a
mask value (used to determine those bits of the connection
mark to actually be set). When a mask is specified, the result
of logically ANDing the mark value with the mask must be the
same as the mark value.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">NFLOG</emphasis>[(<replaceable>nflog-parameters</replaceable>)]</term>
@@ -631,11 +672,37 @@
</varlistentry>
<varlistentry>
<term><emphasis role="bold">REJECT</emphasis></term>
<term><emphasis
role="bold">REJECT[(<replaceable>option</replaceable>)]</emphasis></term>
<listitem>
<para>disallow the request and return an icmp-unreachable or
an RST packet.</para>
an RST packet. If no option is passed, Shorewall selects the
appropriate option based on the protocol of the packet.</para>
<para>Beginning with Shorewall 5.0.8, the type of reject may
be specified in the <replaceable>option</replaceable>
paramater. Valid <replaceable>option</replaceable> values
are:</para>
<simplelist>
<member><option>icmp-net-unreachable</option></member>
<member><option>icmp-host-unreachable</option></member>
<member><option>i</option><option>cmp-port-unreachable</option></member>
<member><option>icmp-proto-unreachable</option></member>
<member><option>icmp-net-prohibited</option></member>
<member><option>icmp-host-prohibited</option></member>
<member><option>icmp-admin-prohibited</option></member>
<member><option>icmp-tcp-reset</option> (the PROTO column
must specify TCP)</member>
</simplelist>
</listitem>
</varlistentry>
@@ -1400,7 +1467,7 @@
<para>When <option>s:</option> or <option>d:</option> is specified,
the rate applies per source IP address or per destination IP address
respectively. The <replaceable>name</replaceable>s may be chosen by
the user and specifiy a hash table to be used to count matching
the user and specify a hash table to be used to count matching
connections. If not given, the name <emphasis
role="bold">shorewallN</emphasis> (where N is a unique integer) is
assumed. Where more than one rule or POLICY specifies the same name,

View File

@@ -156,20 +156,23 @@
<varlistentry>
<term><emphasis role="bold">MARK</emphasis> -
{-|<emphasis>value</emphasis>}</term>
{-|<replaceable>value</replaceable>[:<replaceable>priority</replaceable>]}</term>
<listitem>
<para>The mark <emphasis>value</emphasis> which is an integer in the
range 1-255. You set mark values in the <ulink
url="/manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5)
file, marking the traffic you want to fit in the classes defined in
here. Must be specified as '-' if the <emphasis
role="bold">classify</emphasis> option is given for the interface in
<ulink
url="/manpages/shorewall-tcdevices.html">shorewall-tcdevices</ulink>(5)
and you are running Shorewall 4.5.5 or earlier.</para>
here. You can use the same marks for different interfaces.</para>
<para>You can use the same marks for different interfaces.</para>
<para>The <replaceable>priority</replaceable>, if specified, is an
integer in the range 1-65535 and determines the relative order in
which the tc mark classification filter for this class is to be
applied to packets being sent on the
<replaceable>interface</replaceable>. Filters are applied in
ascending numerical order. If not supplied, the value is derived
from the class priority (PRIORITY column value below):
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 20.</para>
</listitem>
</varlistentry>
@@ -293,7 +296,7 @@
<para>This is the default class for that interface where all
traffic should go, that is not classified otherwise.</para>
<para></para>
<para/>
<note>
<para>You must define <emphasis
@@ -320,7 +323,7 @@
priority determines the order in which filter rules are
processed during packet classification. If not specified, the
value (<replaceable>class priority</replaceable> &lt;&lt; 8) |
10) is used.</para>
15) is used.</para>
</listitem>
</varlistentry>
@@ -339,7 +342,7 @@
(":") and a <replaceable>priority</replaceable>. This priority
determines the order in which filter rules are processed
during packet classification. If not specified, the value
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 10)
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 15)
is used.</para>
<programlisting> <emphasis role="bold">tos-minimize-delay</emphasis> 0x10/0x10
@@ -372,7 +375,7 @@
(":") and a <replaceable>priority</replaceable>. This priority
determines the order in which filter rules are processed
during packet classification. If not specified, the value
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 20)
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 10)
is used.</para>
<note>

View File

@@ -733,6 +733,23 @@
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">DOCKER=</emphasis>[<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>Added in Shorewall 5.0.6. When set to <option>Yes</option>,
the generated script will save Docker-generated rules before and
restore them after executing the <command>start</command>,
<command>stop</command>, <command>reload</command> and
<command>restart</command> commands. If set to <option>No</option>
(the default), the generated script will delete any Docker-generated
rules when executing those commands. See<ulink url="/Docker.html">
http://www.shorewall.net/Docker.html</ulink> for additional
information.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">DONT_LOAD=</emphasis>[<emphasis>module</emphasis>[,<emphasis>module</emphasis>]...]</term>
@@ -744,15 +761,38 @@
<varlistentry>
<term><emphasis role="bold">DYNAMIC_BLACKLIST=</emphasis>{<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
role="bold">Yes</emphasis>|<emphasis
role="bold">No</emphasis>||<emphasis
role="bold">ipset</emphasis>[<emphasis
role="bold">-only</emphasis>][,<emphasis
role="bold">src-dst</emphasis>][:[<replaceable>setname</replaceable>][:<replaceable>log_level</replaceable>|:l<replaceable>og_tag</replaceable>]]]}</term>
<listitem>
<para>Added in Shorewall 4.4.7. When set to <emphasis
role="bold">No</emphasis> or <emphasis role="bold">no</emphasis>,
dynamic blacklisting using the <command>shorewall drop</command>,
<command>shorewall reject</command>, <command>shorewall
logdrop</command> and <command>shorewall logreject</command> is
disabled. Default is <emphasis role="bold">Yes</emphasis>.</para>
chain-based dynamic blacklisting using the <command>shorewall6
drop</command>, <command>shorewall6 reject</command>,
<command>shorewall6 logdrop</command> and <command>shorewall6
logreject</command> is disabled. Default is <emphasis
role="bold">Yes</emphasis>. Beginning with Shorewall 5.0.8,
ipset-based dynamic blacklisting is also supported. The name of the
set (<replaceable>setname</replaceable>) and the level
(<replaceable>log_level</replaceable>), if any, at which blacklisted
traffic is to be logged may also be specified. The default set name
is SW_DBL4 and the default log level is <option>none</option> (no
logging). if <option>ipset-only</option> is given, then chain-based
dynamic blacklisting is disabled just as if DYNAMIC_BLACKLISTING=No
had been specified. Normally, only packets whose source address
matches an entry in the ipsec are dropped. If
<option>src-dst</option> is included, then packets whose destination
address matches an entry in the ipset are also dropped.</para>
<para>When ipset-based dynamic blacklisting is enabled, the contents
of the blacklist will be preserved over
<command>stop</command>/<command>reboot</command>/<command>start</command>
sequences if SAVE_IPSETS=Yes, SAVE_IPSETS=ipv4 or if
<replaceable>setname</replaceable> is included in the list of sets
to be saved in SAVE_IPSETS.</para>
</listitem>
</varlistentry>
@@ -763,8 +803,8 @@
<listitem>
<para>Normally, when the SOURCE or DEST columns in
shorewall-policy(5) contains 'all', a single policy chain is created
and the policy is enforced in that chain. For example, if the policy
entry is<programlisting>#SOURCE DEST POLICY LOG
and thes policy is enforced in that chain. For example, if the
policy entry is<programlisting>#SOURCE DEST POLICY LOG
# LEVEL
net all DROP info</programlisting>then the chain name is 'net-all'
('net2all if ZONE2ZONE=2) which is also the chain named in Shorewall
@@ -807,7 +847,8 @@ net all DROP info</programlisting>then the chain name is 'net-all'
packets until these packets reach the chain in which the original
connection was accepted. So for packets going from the 'loc' zone to
the 'net' zone, ESTABLISHED/RELATED packets are ACCEPTED in the
'loc2net' chain.</para>
'loc-net' or 'loc2net' chain, depending on the setting of ZONE2ZONE
(see below).</para>
<para>If you set FASTACCEPT=Yes, then ESTABLISHED/RELATED packets
are accepted early in the INPUT, FORWARD and OUTPUT chains. If you
@@ -981,7 +1022,7 @@ net all DROP info</programlisting>then the chain name is 'net-all'
iptables text in a rule. You may simply preface that text with a
pair of semicolons (";;"). If alternate input is also specified in
the rule, it should appear before the semicolons and may be
seperated from normal column input by a single semicolon.</para>
separated from normal column input by a single semicolon.</para>
</listitem>
</varlistentry>
@@ -1531,6 +1572,18 @@ LOG:info:,bar net fw</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">MINIUPNPD=</emphasis>[<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>Added in Shorewall 5.0.8. If set to Yes, Shorewall will create
a chain in the nat table named MINIUPNPD-POSTROUTING and will add
jumps from POSTROUTING to that chain for each interface with the
<option>upnpd</option> option specified. Default is No.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">MARK_IN_FORWARD_CHAIN=</emphasis>[<emphasis
@@ -1619,7 +1672,7 @@ LOG:info:,bar net fw</programlisting>
<varlistentry>
<term><emphasis
role="bold">MODULESDIR=</emphasis>[<emphasis>pathname</emphasis>[<emphasis
role="bold">MODULESDIR=</emphasis>[[+]<emphasis>pathname</emphasis>[<emphasis
role="bold">:</emphasis><emphasis>pathname</emphasis>]...]</term>
<listitem>
@@ -1630,6 +1683,10 @@ LOG:info:,bar net fw</programlisting>
where <emphasis role="bold">uname</emphasis> holds the output of
'<command>uname -r</command>' and <emphasis
role="bold">g_family</emphasis> holds '4'.</para>
<para>The option plus sign ('+') was added in Shorewall 5.0.3 and
causes the listed pathnames to be appended to the default list
above.</para>
</listitem>
</varlistentry>
@@ -1935,6 +1992,19 @@ LOG:info:,bar net fw</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">PAGER=</emphasis><emphasis>pathname</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.6. Specifies a path name of a pager
program like <command>less</command> or <command>more</command>.
When PAGER is given, the output of verbose <command>status</command>
commands and the <command>dump</command> command are piped through
the named program when the output file is a terminal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">PATH=</emphasis><emphasis>pathname</emphasis>[<emphasis
@@ -2434,9 +2504,11 @@ INLINE - - - ; -j REJECT
<para>If specified, determines where Shorewall will log the details
of each <emphasis role="bold">start</emphasis>, <emphasis
role="bold">reload</emphasis>, <emphasis
role="bold">restart</emphasis> and <emphasis
role="bold">refresh</emphasis> command. Logging verbosity is
determined by the setting of LOG_VERBOSITY above.</para>
role="bold">restart</emphasis>, <emphasis
role="bold">refresh</emphasis>, <emphasis
role="bold">try</emphasis>, and <emphasis
role="bold">safe-</emphasis>* command. Logging verbosity is
determined by the setting of LOG_VERBOSITY above. </para>
</listitem>
</varlistentry>
@@ -2735,6 +2807,12 @@ INLINE - - - ; -j REJECT
it was set to the empty string then USE_DEFAULT_RT=No was assumed.
Beginning with Shorewall 4.6.0, the default is USE_DEFAULT_RT=Yes
and use of USE_DEFAULT_RT=No is deprecated.</para>
<warning>
<para>The <command>enable</command>, <command>disable</command>
and <command>reenable</command> commands do not work correctly
when USE_DEFAULT_RT=No.</para>
</warning>
</listitem>
</varlistentry>

View File

@@ -49,6 +49,19 @@
<arg choice="plain"><replaceable>address</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall</command>
<arg
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>blacklist</option></arg>
<arg choice="plain"><replaceable>address</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall</command>
@@ -955,6 +968,25 @@
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">blacklist</emphasis>
<replaceable>address</replaceable> [ <replaceable>option</replaceable>
... ]</term>
<listitem>
<para>Added in Shorewall 5.0.8 and requires
DYNAMIC_BLACKLIST=ipset.. in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).
Causes packets from the given host or network
<replaceable>address</replaceable> to be dropped, based on the
setting of BLACKLIST in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5). The
<replaceable>address</replaceable> along with any
<replaceable>option</replaceable>s are passed to the <command>ipset
add</command> command.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">call <replaceable>function</replaceable> [
<replaceable>parameter</replaceable> ... ]</emphasis></term>
@@ -2593,6 +2625,34 @@
started.</para>
</refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>Two environmental variables are recognized by Shorewall:</para>
<variablelist>
<varlistentry>
<term>SHOREWALL_INIT_SCRIPT</term>
<listitem>
<para>When set to 1, causes Std out to be redirected to the file
specified in the STARTUP_LOG option in <ulink
url="shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SW_LOGGERTAG</term>
<listitem>
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
value is passed to the logger utility in its -t (--tag)
option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>FILES</title>

View File

@@ -1,16 +1,16 @@
#
# Shorewall version 5 - Essential Modules File
# Shorewall -- /usr/share/shorewall/modules.essential
#
# /usr/share/shorewall/modules.essential
# Essential Modules File
#
# This file loads the modules that may be needed by the firewall.
# This file loads the modules that may be needed by the firewall.
#
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
#
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
#
###############################################################################
#

View File

@@ -1,16 +1,16 @@
#
# Shorewall version 5 - Extensions Modules File
# Shorewall -- /usr/share/shorewall/modules.extensions
#
# /usr/share/shorewall/modules.extensions
# Extensions Modules File
#
# This file loads the modules that may be needed by the firewall.
# This file loads the modules that may be needed by the firewall.
#
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
#
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
#
###############################################################################
loadmodule ipt_addrtype

View File

@@ -1,16 +1,16 @@
#
# Shorewall version 5 - IP Set Modules File
# Shorewall -- /usr/share/shorewall/modules.ipset
#
# /usr/share/shorewall/modules.ipset
# IP Set Modules File
#
# This file loads the modules that may be needed by the firewall.
# This file loads the modules that may be needed by the firewall.
#
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
#
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
#
###############################################################################
loadmodule xt_set

View File

@@ -1,16 +1,16 @@
#
# Shorewall version 5 - Traffic Shaping Modules File
# Shorewall -- /usr/share/shorewall/modules.tc
#
# /usr/share/shorewall/modules.tc
# Traffic Shaping Modules File
#
# This file loads the modules that may be needed by the firewall.
# This file loads the modules that may be needed by the firewall.
#
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
#
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
#
###############################################################################
loadmodule sch_sfq

View File

@@ -1,16 +1,16 @@
#
# Shorewall version 5 - Xtables Modules File
# Shorewall -- /usr/share/shorewall/modules.xtables
#
# /usr/share/shorewall/modules.xtables
# Xtables Modules File
#
# This file loads the modules that may be needed by the firewall.
# This file loads the modules that may be needed by the firewall.
#
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
#
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
#
###############################################################################
loadmodule xt_AUDIT

View File

@@ -2,7 +2,7 @@
#
# Script to back uninstall Shoreline Firewall
#
# (c) 2000-2011,2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://www.shorewall.net
#

View File

@@ -1 +0,0 @@
This is the Shorewall6-lite stable 4.4 branch of Git.

View File

@@ -47,6 +47,19 @@
<arg choice="plain"><replaceable>address</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall6-lite</command>
<arg
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>blacklist</option></arg>
<arg choice="plain"><replaceable>address</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall6-lite</command>
@@ -670,6 +683,25 @@
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">blacklist</emphasis>
<replaceable>address</replaceable> [ <replaceable>option</replaceable>
... ]</term>
<listitem>
<para>Added in Shorewall 5.0.8 and requires
DYNAMIC_BLACKLIST=ipset.. in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
Causes packets from the given host or network
<replaceable>address</replaceable> to be dropped, based on the
setting of BLACKLIST in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
The <replaceable>address</replaceable> along with any
<replaceable>option</replaceable>s are passed to the <command>ipset
add</command> command.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">call <replaceable>function</replaceable> [
<replaceable>parameter</replaceable> ... ]</emphasis></term>
@@ -1515,6 +1547,35 @@
started.</para>
</refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>Two environmental variables are recognized by
Shorewall6-lite:</para>
<variablelist>
<varlistentry>
<term>SHOREWALL_INIT_SCRIPT</term>
<listitem>
<para>When set to 1, causes Std out to be redirected to the file
specified in the STARTUP_LOG option in <ulink
url="shorewall6.conf.html">shorewall6.conf(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SW_LOGGERTAG</term>
<listitem>
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
value is passed to the logger utility in its -t (--tag)
option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>See ALSO</title>

View File

@@ -2,7 +2,7 @@
#
# Script to back uninstall Shoreline Firewall 6 Lite
#
# (c) 2000-2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.sourceforge.net
#

View File

@@ -1 +0,0 @@
This is the Shorewall6 stable 4.4 branch of Git.

View File

@@ -18,6 +18,12 @@ STARTUP_ENABLED=Yes
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################

View File

@@ -19,6 +19,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################

View File

@@ -18,6 +18,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################

View File

@@ -18,6 +18,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################

View File

@@ -1,13 +1,11 @@
#
# Shorewall6 version 5 - Audited AllowICMPs Action
# Shorewall6 -- /usr/share/shorewall6/action.A_AllowICMPs
#
# /usr/share/shorewall6/action.A_AllowICMPs
#
# This action A_ACCEPTs needed ICMP types
# This action A_ACCEPTs needed ICMP types
#
###############################################################################
#TARGET SOURCE DEST PROTO DEST
# PORT(S)
#ACTION SOURCE DEST PROTO DPORT
?comment Needed ICMP types (RFC4890)
A_ACCEPT - - ipv6-icmp destination-unreachable

View File

@@ -1,52 +0,0 @@
#
# Shorewall6 version 5 - Audited Drop Action
#
# /usr/share/shorewall6/action.ADrop
#
# The Audited default DROP common rules
#
# This action is invoked before a DROP policy is enforced. The purpose
# of the action is:
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that 'auth' requests are rejected, even if the policy is
# DROP. Otherwise, you may experience problems establishing
# connections with servers that use auth.
# c) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
#
###############################################################################
#TARGET SOURCE DEST PROTO DPORT SPORT
#
# Reject 'auth'
#
Auth(A_REJECT)
#
# ACCEPT critical ICMP types
#
A_AllowICMPs - - ipv6-icmp
#
# Drop Broadcasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
dropBcast(audit)
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log.
#
dropInvalid(audit)
#
# Drop Microsoft noise so that it doesn't clutter up the log.
#
SMB(A_DROP)
#
# Drop 'newnotsyn' traffic so that it doesn't get logged.
#
dropNotSyn(audit) - - tcp
#
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
# the log.
#
A_DropDNSrep

View File

@@ -1,50 +0,0 @@
#
# Shorewall6 version 5 - Audited Reject Action
#
# /usr/share/shorewall6/action.A_Reject
#
# The audited default REJECT action common rules
#
# This action is invoked before a REJECT policy is enforced. The purpose
# of the action is:
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
###############################################################################
#TARGET SOURCE DEST PROTO
#
# Don't log 'auth' -- REJECT
#
Auth(A_REJECT)
#
# Drop Multicasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
A_AllowICMPs - - ipv6-icmp
#
# Drop Broadcasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
dropBcast(audit)
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log (these ICMPs cannot be
# rejected).
#
dropInvalid(audit)
#
# Reject Microsoft noise so that it doesn't clutter up the log.
#
SMB(A_REJECT)
#
# Drop 'newnotsyn' traffic so that it doesn't get logged.
#
dropNotSyn(audit) - - tcp
#
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
# the log.
#
A_DropDNSrep

View File

@@ -1,13 +1,10 @@
#
# Shorewall6 version 5 - AllowICMPs Action
# Shorewall6 -- /usr/share/shorewall6/action.AllowICMPs
#
# /usr/share/shorewall6/action.AllowICMPs
#
# This action ACCEPTs needed ICMP types
# This action ACCEPTs needed ICMP types
#
###############################################################################
#TARGET SOURCE DEST PROTO DEST
# PORT(S)
#ACTION SOURCE DEST PROTO DPORT
DEFAULTS ACCEPT

View File

@@ -1,32 +1,32 @@
#
# Shorewall 4 - Multicast/Anycast Action
# Shorewall6 -- /usr/share/shorewall6/action.Broadcast
#
# /usr/share/shorewall/action.Broadcast
# Multicast/Anycast IPv6 Action
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Broadcast[([<action>|-[,{audit|-}])]
# Broadcast[([<action>|-[,{audit|-}])]
#
# Default action is DROP
# Default action is DROP
#
##########################################################################################
###############################################################################
DEFAULTS DROP,-

View File

@@ -1,91 +0,0 @@
#
# Shorewall6 version 5 - Drop Action
#
# /usr/share/shorewall6/action.Drop
#
# The default DROP common rules
#
# This action is invoked before a DROP policy is enforced. The purpose
# of the action is:
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that 'auth' requests are rejected, even if the policy is
# DROP. Otherwise, you may experience problems establishing
# connections with servers that use auth.
# c) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# The action accepts five optional parameters:
#
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
# actions.
# 2 - Action to take with Auth requests. Default is REJECT or A_REJECT,
# depending on the setting of the first parameter.
# 3 - Action to take with SMB requests. Default is DROP or A_DROP,
# depending on the setting of the first parameter.
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
# A_ACCEPT depending on the first parameter.
# 5 - Action to take with late UDP replies (UDP source port 53). Default
# is DROP or A_DROP depending on the first parameter.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
#
###############################################################################
#
# The following magic provides different defaults for $2 thru $5, when $1 is
# 'audit'.
#
?begin perl;
use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
if ( defined $p1 ) {
if ( $p1 eq 'audit' ) {
set_action_param( 2, 'A_REJECT') unless supplied $p2;
set_action_param( 3, 'A_DROP') unless supplied $p3;
set_action_param( 4, 'A_ACCEPT' ) unless supplied $p4;
set_action_param( 5, 'A_DROP' ) unless supplied $p5;
} else {
fatal_error "Invalid value ($p1) for first Drop parameter" if supplied $p1;
}
}
1;
?end perl;
DEFAULTS -,REJECT,DROP,ACCEPT,DROP
#TARGET SOURCE DEST PROTO DPORT SPORT
#
# Reject 'auth'
#
Auth($2)
#
# ACCEPT critical ICMP types
#
AllowICMPs($4) - - ipv6-icmp
#
# Drop Broadcasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
Broadcast(DROP,$1)
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log.
#
Invalid(DROP,$1)
#
# Drop Microsoft noise so that it doesn't clutter up the log.
#
SMB($3)
#
# Drop 'newnotsyn' traffic so that it doesn't get logged.
#
NotSyn(DROP,$1) - - tcp
#
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
# the log.
#
DropDNSrep($5)

View File

@@ -1,89 +0,0 @@
#
# Shorewall6 version 5 - Reject Action
#
# /usr/share/shorewall6/action.Reject
#
# The default REJECT action common rules
#
# This action is invoked before a REJECT policy is enforced. The purpose
# of the action is:
#
# a) Avoid logging lots of useless cruft.
# b) Ensure that certain ICMP packets that are necessary for successful
# internet operation are always ACCEPTed.
#
# The action accepts five optional parameters:
#
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
# actions.
# 2 - Action to take with Auth requests. Default is REJECT or A_REJECT,
# depending on the setting of the first parameter.
# 3 - Action to take with SMB requests. Default is REJECT or A_REJECT,
# depending on the setting of the first parameter.
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
# A_ACCEPT depending on the first parameter.
# 5 - Action to take with late UDP replies (UDP source port 53). Default
# is DROP or A_DROP depending on the first parameter.
#
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
###############################################################################
#
# The following magic provides different defaults for $2 thru $5, when $1 is
# 'audit'.
#
?begin perl;
use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
if ( defined $p1 ) {
if ( $p1 eq 'audit' ) {
set_action_param( 2, 'A_REJECT') unless supplied $p2;
set_action_param( 3, 'A_REJECT') unless supplied $p3;
set_action_param( 4, 'A_ACCEPT' ) unless supplied $p4;
set_action_param( 5, 'A_DROP' ) unless supplied $p5;
} else {
fatal_error "Invalid value ($p1) for first Reject parameter" if supplied $p1;
}
}
1;
?end perl;
DEFAULTS -,REJECT,REJECT,ACCEPT,DROP
#TARGET SOURCE DEST PROTO
#
# Don't log 'auth' -- REJECT
#
Auth($2)
#
# Drop Multicasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
AllowICMPs($4) - - ipv6-icmp
#
# Drop Broadcasts so they don't clutter up the log
# (broadcasts must *not* be rejected).
#
Broadcast(DROP,$1)
#
# Drop packets that are in the INVALID state -- these are usually ICMP packets
# and just confuse people when they appear in the log (these ICMPs cannot be
# rejected).
#
Invalid(DROP,$1)
#
# Reject Microsoft noise so that it doesn't clutter up the log.
#
SMB($3)
#
# Drop 'newnotsyn' traffic so that it doesn't get logged.
#
NotSyn(DROP,$1) - - tcp
#
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
# the log.
#
DropDNSrep($5)

View File

@@ -0,0 +1,19 @@
#
# Shorewall6 -- /usr/share/shorewall6/action.mangletemplate
#
# This file is a template for files with names of the form
# /etc/shorewall/action.<action-name> where <action> is an
# ACTION defined with the mangle option in /etc/shorewall/actions.
#
# To define a new action:
#
# 1. Add the <action name> to /etc/shorewall6/actions with the mangle option
# 2. Copy this file to /etc/shorewall6/action.<action name>
# 3. Add the desired rules to that file.
#
# Please see http://shorewall.net/Actions.html for additional information.
#
# Columns are the same as in /etc/shorewall6/mangle.
#
############################################################################################################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT USER TEST LENGTH TOS CONNBYTES HELPER HEADERS PROBABILITY DSCP

View File

@@ -1,25 +1,21 @@
#
# Shorewall version 5 - Action Template
# Shorewall6 -- /usr/share/shorewall6/action.template
#
# /etc/shorewall6/action.template
# Action Template
#
# This file is a template for files with names of the form
# /etc/shorewall/action.<action-name> where <action> is an
# ACTION defined in /etc/shorewall/actions.
# This file is a template for files with names of the form
# /etc/shorewall/action.<action-name> where <action> is an
# ACTION defined in /etc/shorewall/actions.
#
# To define a new action:
# To define a new action:
#
# 1. Add the <action name> to /etc/shorewall/actions
# 2. Copy this file to /etc/shorewall/action.<action name>
# 3. Add the desired rules to that file.
# 1. Add the <action name> to /etc/shorewall/actions
# 2. Copy this file to /etc/shorewall/action.<action name>
# 3. Add the desired rules to that file.
#
# Please see http://shorewall.net/Actions.html for additional
# information.
# Please see http://shorewall.net/Actions.html for additional information.
#
# Columns are the same as in /etc/shorewall6/rules.
#
#######################################################################################################
# DO NOT REMOVE THE FOLLOWING LINE
#####################################################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
# PORT PORT(S) DEST LIMIT GROUP
##############################################################################################################################################################
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER MARK CONNLIMIT TIME HEADERS SWITCH HELPER

View File

@@ -8,11 +8,12 @@
#
# Builtin Actions are:
#
# allowBcasts # Accept multicast and anycast packets
# dropBcasts # Silently Drop multicast and anycast packets
# dropNotSyn # Silently Drop Non-syn TCP packets
# rejNotSyn # Silently Reject Non-syn TCP packets
#
?if 0
allowBcasts # Accept multicast and anycast packets
dropBcasts # Silently Drop multicast and anycast packets
dropNotSyn # Silently Drop Non-syn TCP packets
rejNotSyn # Silently Reject Non-syn TCP packets
?endif
###############################################################################
#ACTION
A_Drop # Audited Default Action for DROP policy
@@ -26,15 +27,19 @@ Broadcast noinline # Handles Broadcast/Multicast/Anycast
Drop # Default Action for DROP policy
dropInvalid inline # Drops packets in the INVALID conntrack state
DropSmurfs noinline # Handles packets with a broadcast source address
Established inline # Handles packets in the ESTABLISHED state
Established inline,\ # Handles packets in the ESTABLISHED state
state=ESTABLISHED
IfEvent noinline # Perform an action based on an event
Invalid inline # Handles packets in the INVALID conntrack state
New inline # Handles packets in the NEW conntrack state
Invalid inline,audit,\ # Handles packets in the INVALID conntrack state
state=INVALID
New inline,state=NEW # Handles packets in the NEW conntrack state
NotSyn inline # Handles TCP packets that do not have SYN=1 and ACK=0
Reject # Default Action for REJECT policy
Related inline # Handles packets in the RELATED conntrack state
Related inline,\ # Handles packets in the RELATED conntrack state
state=RELATED
ResetEvent inline # Reset an Event
RST inline # Handle packets with RST set
SetEvent inline # Initialize an event
TCPFlags # Handles bad flags combinations
Untracked inline # Handles packets in the UNTRACKED conntrack state
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
state=UNTRACKED

View File

@@ -18,6 +18,12 @@ STARTUP_ENABLED=No
VERBOSITY=1
###############################################################################
# P A G E R
###############################################################################
PAGER=
###############################################################################
# L O G G I N G
###############################################################################

View File

@@ -83,7 +83,7 @@ case "$command" in
exec ${SBINDIR}/shorewall6 $OPTIONS restart $RESTARTOPTIONS
;;
status|stop)
exec ${SBINDIR}/shorewall6 $OPTIONS $command $@
exec ${SBINDIR}/shorewall6 $OPTIONS $command
;;
*)
usage

View File

@@ -1,24 +1,24 @@
#
# Shorewall 4.4 -- /usr/share/shorewall6/lib.base
# Shorewall -- /usr/share/shorewall6/lib.base
#
# (c) 2011,2014 - Tom Eastep (teastep@shorewall.net)
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
# Complete documentation is available at http://shorewall.net
#
# This program is part of Shorewall.
# This program is part of Shorewall.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 2 of the license or, at your
# option, any later version.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 2 of the license or, at your
# option, any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# This library contains the code common to all Shorewall components.

View File

@@ -53,6 +53,18 @@
<para>Added in Shorewall 4.5.10. Available options are:</para>
<variablelist>
<varlistentry>
<term><option>audit</option></term>
<listitem>
<para>Added in Shorewall 5.0.7. When this option is specified,
the action is expected to have at least two parameters; the
first is a target and the second is either 'audit' or omitted.
If the second is 'audit', then the first must be an auditable
target (ACCEPT, DROP or REJECT).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>builtin</term>
@@ -87,7 +99,7 @@
</varlistentry>
<varlistentry>
<term>inline</term>
<term><option>inline</option></term>
<listitem>
<para>Causes the action body (defined in
@@ -103,10 +115,10 @@
way:</para>
<simplelist>
<member>Broadcast</member>
<member>DropSmurfs</member>
<member>IfEvent</member>
<member>Invalid (Prior to Shorewall 4.5.13)</member>
<member>NotSyn (Prior to Shorewall 4.5.13)</member>
@@ -120,7 +132,19 @@
</varlistentry>
<varlistentry>
<term>noinline</term>
<term><option>mangle</option></term>
<listitem>
<para>Added in Shorewall 5.0.7. Specifies that this action is
to be used in <ulink
url="shorewall6-mangle.html">shorewall6-mangle(5)</ulink>
rather than <ulink
url="shorewall6-rules.html">shorewall6-rules(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>noinline</option></term>
<listitem>
<para>Causes any later <option>inline</option> option for the
@@ -129,7 +153,7 @@
</varlistentry>
<varlistentry>
<term>nolog</term>
<term><option>nolog</option></term>
<listitem>
<para>Added in Shorewall 4.5.11. When this option is
@@ -143,7 +167,16 @@
</varlistentry>
<varlistentry>
<term>terminating</term>
<term><option>state</option>={<option>UNTRACKED</option>|<option>NEW</option>|<option>ESTABLISHED</option>|<option>RELATED</option>|<option>INVALID</option>}</term>
<listitem>
<para>Added in Shorewall 5.0.7. Reserved for use by Shorewall
in <filename>actions.std</filename>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>terminating</option></term>
<listitem>
<para>Added in Shorewall 4.6.4. When used with

View File

@@ -365,6 +365,15 @@ loc eth2 -</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">nodbl</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.8. When specified, dynamic
blacklisting is disabled on the interface.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">optional</emphasis></term>

Some files were not shown because too many files have changed in this diff Show More