summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-sysadm/2010-November/000499.html
blob: 4eaf14229fc8e1a6c39b04076828b4fa42e0f14e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Mageia-sysadm] [242] add shorewall module
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B242%5D%20add%20shorewall%20module&In-Reply-To=%3C20101112203824.B4BCA3FC0F%40valstar.mageia.org%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="000539.html">
   <LINK REL="Next"  HREF="000500.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Mageia-sysadm] [242] add shorewall module</H1>
    <B>root at mageia.org</B> 
    <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B242%5D%20add%20shorewall%20module&In-Reply-To=%3C20101112203824.B4BCA3FC0F%40valstar.mageia.org%3E"
       TITLE="[Mageia-sysadm] [242] add shorewall module">root at mageia.org
       </A><BR>
    <I>Fri Nov 12 21:38:24 CET 2010</I>
    <P><UL>
        <LI>Previous message: <A HREF="000539.html">[Mageia-sysadm] [241] Add a module to construct files	from	fragments.
</A></li>
        <LI>Next message: <A HREF="000500.html">[Mageia-sysadm] [243] save shorewall config in /etc/shorewall_test	for testing
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#499">[ date ]</a>
              <a href="thread.html#499">[ thread ]</a>
              <a href="subject.html#499">[ subject ]</a>
              <a href="author.html#499">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>Revision: 242
Author:   boklm
Date:     2010-11-12 21:38:24 +0100 (Fri, 12 Nov 2010)
Log Message:
-----------
add shorewall module

Added Paths:
-----------
    puppet/modules/shorewall/
    puppet/modules/shorewall/files/
    puppet/modules/shorewall/files/footers/
    puppet/modules/shorewall/files/footers/interfaces
    puppet/modules/shorewall/files/footers/policy
    puppet/modules/shorewall/files/footers/rules
    puppet/modules/shorewall/files/footers/zones
    puppet/modules/shorewall/files/headers/
    puppet/modules/shorewall/files/headers/interfaces
    puppet/modules/shorewall/files/headers/policy
    puppet/modules/shorewall/files/headers/rules
    puppet/modules/shorewall/files/headers/zones
    puppet/modules/shorewall/manifests/
    puppet/modules/shorewall/manifests/init.pp

Added: puppet/modules/shorewall/files/footers/interfaces
===================================================================
--- puppet/modules/shorewall/files/footers/interfaces	                        (rev 0)
+++ puppet/modules/shorewall/files/footers/interfaces	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1 @@
+#LAST LINE -- DO NOT REMOVE

Added: puppet/modules/shorewall/files/footers/policy
===================================================================
--- puppet/modules/shorewall/files/footers/policy	                        (rev 0)
+++ puppet/modules/shorewall/files/footers/policy	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1 @@
+#LAST LINE -- DO NOT REMOVE

Added: puppet/modules/shorewall/files/footers/rules
===================================================================
--- puppet/modules/shorewall/files/footers/rules	                        (rev 0)
+++ puppet/modules/shorewall/files/footers/rules	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1 @@
+#LAST LINE -- DO NOT REMOVE

Added: puppet/modules/shorewall/files/footers/zones
===================================================================
--- puppet/modules/shorewall/files/footers/zones	                        (rev 0)
+++ puppet/modules/shorewall/files/footers/zones	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1 @@
+#LAST LINE -- DO NOT REMOVE

Added: puppet/modules/shorewall/files/headers/interfaces
===================================================================
--- puppet/modules/shorewall/files/headers/interfaces	                        (rev 0)
+++ puppet/modules/shorewall/files/headers/interfaces	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1,10 @@
+#
+# Shorewall version 4 - Interfaces File
+#
+# For information about entries in this file, type &quot;man shorewall-interfaces&quot;
+#
+# The manpage is also online at
+# <A HREF="http://www.shorewall.net/manpages/shorewall-interfaces.html">http://www.shorewall.net/manpages/shorewall-interfaces.html</A>
+#
+###############################################################################
+#ZONE	INTERFACE	BROADCAST	OPTIONS

Added: puppet/modules/shorewall/files/headers/policy
===================================================================
--- puppet/modules/shorewall/files/headers/policy	                        (rev 0)
+++ puppet/modules/shorewall/files/headers/policy	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1,11 @@
+#
+# Shorewall version 4 - Policy File
+#
+# For information about entries in this file, type &quot;man shorewall-policy&quot;
+#
+# The manpage is also online at
+# <A HREF="http://www.shorewall.net/manpages/shorewall-policy.html">http://www.shorewall.net/manpages/shorewall-policy.html</A>
+#
+###############################################################################
+#SOURCE	DEST	POLICY		LOG	LIMIT:		CONNLIMIT:
+#				LEVEL	BURST		MASK

Added: puppet/modules/shorewall/files/headers/rules
===================================================================
--- puppet/modules/shorewall/files/headers/rules	                        (rev 0)
+++ puppet/modules/shorewall/files/headers/rules	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1,11 @@
+#
+# Shorewall version 4 - Rules File
+#
+# For information on the settings in this file, type &quot;man shorewall-rules&quot;
+#
+# The manpage is also online at
+# <A HREF="http://www.shorewall.net/manpages/shorewall-rules.html">http://www.shorewall.net/manpages/shorewall-rules.html</A>
+#
+####################################################################################################################################################
+#ACTION		SOURCE		DEST		PROTO	DEST	SOURCE		ORIGINAL	RATE		USER/	MARK	CONNLIMIT	TIME
+#							PORT	PORT(S)		DEST		LIMIT		GROUP

Added: puppet/modules/shorewall/files/headers/zones
===================================================================
--- puppet/modules/shorewall/files/headers/zones	                        (rev 0)
+++ puppet/modules/shorewall/files/headers/zones	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1,11 @@
+#
+# Shorewall version 4 - Zones File
+#
+# For information about this file, type &quot;man shorewall-zones&quot;
+#
+# The manpage is also online at
+# <A HREF="http://www.shorewall.net/manpages/shorewall-zones.html">http://www.shorewall.net/manpages/shorewall-zones.html</A>
+#
+###############################################################################
+#ZONE	TYPE		OPTIONS		IN			OUT
+#					OPTIONS			OPTIONS

Added: puppet/modules/shorewall/manifests/init.pp
===================================================================
--- puppet/modules/shorewall/manifests/init.pp	                        (rev 0)
+++ puppet/modules/shorewall/manifests/init.pp	2010-11-12 20:38:24 UTC (rev 242)
@@ -0,0 +1,102 @@
+class shorewall {
+  include concat::setup
+
+  define shorewallfile () {
+     $filename = &quot;/etc/shorewall/${name}&quot;
+     $header = &quot;<A HREF="puppet:///modules/shorewall/headers/${name">puppet:///modules/shorewall/headers/${name</A>}&quot;
+     $footer = &quot;<A HREF="puppet:///modules/shorewall/footers/${name">puppet:///modules/shorewall/footers/${name</A>}&quot;
+     concat{$filename:
+	owner =&gt; root,
+	group =&gt; root,
+	mode =&gt; 600,
+     }
+
+     concat::fragment{&quot;${name}_header&quot;:
+     	target =&gt; $filename,
+	order =&gt; 1,
+	source =&gt; $header,
+     }
+
+     concat::fragment{&quot;${name}_footer&quot;:
+     	target =&gt; $filename,
+	order =&gt; 99,
+	source =&gt; $footer,
+     }
+  }
+
+  ### Rules
+  shorewallfile{ rules: }
+  define rule_line($order = 50) {
+     $filename = &quot;/etc/shorewall/rules&quot;
+     $line = $name
+     concat::fragment{&quot;newline_${name}&quot;:
+	target =&gt; $filename,
+	order =&gt; $order,
+	content =&gt; $line,
+     }
+  }
+  class allow_ssh_in {
+     rule_line { &quot;ACCEPT all all tcp 22&quot;:
+     	order =&gt; 5,
+     }
+  }
+  class allow_dns_in {
+     rule_line { &quot;ACCEPT net fw tcp 53&quot; }
+     rule_line { &quot;ACCEPT net fw udp 53&quot; }
+  }
+  class allow_smtp_in {
+     rule_line { &quot;ACCEPT net fw tcp 25&quot; }
+  }
+  class allow_www_in {
+     rule_line { &quot;ACCEPT net fw tcp 80&quot; }
+  }
+
+  ### Zones
+  shorewallfile{ zones: }
+  define zone_line($order = 50) {
+     $filename = &quot;/etc/shorewall/zones&quot;
+     $line = $name
+     concat::fragment{&quot;newline_${name}&quot;:
+	target =&gt; $filename,
+	order =&gt; $order,
+	content =&gt; $line,
+     }
+  }
+  class default_zones {
+     zone_line { &quot;net     ipv4&quot;:
+	$order =&gt; 2,
+     }
+     zone_line { &quot;fw      firewall&quot;:
+	$order =&gt; 3,
+     }
+  }
+
+  ### Policy
+  shorewallfile{ policy: }
+  define policy_line($order = 50) {
+     $filename = &quot;/etc/shorewall/policy&quot;
+     $line = $name
+     concat::fragment{&quot;newline_${name}&quot;:
+	target =&gt; $filename,
+	order =&gt; $order,
+	content =&gt; $line,
+     }
+  }
+  class default_policy {
+     policy_line{ &quot;fw	net	ACCEPT&quot;:
+     	$order =&gt; 2,
+     }
+     policy_line{ &quot;net	all	DROP	info&quot;:
+     	$order =&gt; 3,
+     }
+     policy_line{ &quot;all	all	REJECT	info&quot;:
+     	$order =&gt; 4,
+     }
+  }
+
+  class default_firewall() {
+     include default_zones
+     include default_policy
+     include allow_ssh_in
+  }
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;/pipermail/mageia-sysadm/attachments/20101112/b0723b5d/attachment.html&gt;
</PRE>
























<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000539.html">[Mageia-sysadm] [241] Add a module to construct files	from	fragments.
</A></li>
	<LI>Next message: <A HREF="000500.html">[Mageia-sysadm] [243] save shorewall config in /etc/shorewall_test	for testing
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#499">[ date ]</a>
              <a href="thread.html#499">[ thread ]</a>
              <a href="subject.html#499">[ subject ]</a>
              <a href="author.html#499">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm
mailing list</a><br>
</body></html>