commit | author | age
|
7c99ef
|
1 |
# |
T |
2 |
# /etc/bastille-firewall.cfg |
|
3 |
# |
|
4 |
# Configuration file for both 2.2/ipchains and 2.4/netfilter scripts |
|
5 |
# |
|
6 |
# $Source: /cvsroot/bastille-linux/dev/working_tree/Bastille/bastille-firewall.cfg,v $ |
|
7 |
# Modified by: $Author: peterw $ |
|
8 |
# $Date: 2002/01/04 13:34:18 $ |
|
9 |
# $Revision: 1.7 $ |
|
10 |
# |
|
11 |
# Copyright (C) 1999-2001 Peter Watkins |
|
12 |
# |
|
13 |
# This program is distributed in the hope that it will be useful, |
|
14 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
# GNU General Public License for more details. |
|
17 |
# |
|
18 |
# You should have received a copy of the GNU General Public License |
|
19 |
# along with this program; if not, write to the Free Software |
|
20 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
# |
|
22 |
# Thanks to David Ranch, Brad A, Don G, and others for their suggestions |
|
23 |
|
|
24 |
# the configuration values should be whitespace-delimited lists of |
|
25 |
# appropriate values, e.g. |
|
26 |
# TCP_PUBLIC_SERVICES="80 smtp ssh" |
|
27 |
# lists Web (port 80), SMTP mail, and Secure Shell ports |
|
28 |
# |
|
29 |
# This script is suitable for workstations or simple NAT firewalls; |
|
30 |
# you may want to add more "output" restrictions for serious servers |
|
31 |
|
|
32 |
# 0) DNS servers (Linux 2.2/ipchains only) |
|
33 |
# You must list your DNS servers here so that |
|
34 |
# the firewall will allow them to service your lookup requests |
|
35 |
# |
|
36 |
# List of DNS servers/networks to allow "domain" responses from |
|
37 |
# This _could_ be nameservers as a list of <ip-address>/32 entries |
|
38 |
#DNS_SERVERS="a.b.c.d/32 e.f.g.h/32" |
|
39 |
# If you are running a caching nameserver, you'll need to allow from |
|
40 |
# "0.0.0.0/0" so named can query any arbitrary nameserver |
|
41 |
# (To enable a caching nameserver, you will also probably need to |
|
42 |
# add "domain" to the TCP and UDP public service lists.) |
|
43 |
#DNS_SERVERS="0.0.0.0/0" |
|
44 |
# |
|
45 |
# To have the DNS servers parsed from /etc/resolv.conf at runtime, |
|
46 |
# as normal workstations will want, make this variable empty |
|
47 |
#DNS_SERVERS="" |
|
48 |
# |
|
49 |
# Please make sure variable assignments are on single lines; do NOT |
|
50 |
# use the "\" continuation character (so Bastille can change the |
|
51 |
# values if it is run more than once) |
|
52 |
DNS_SERVERS="{DNS_SERVERS}" |
|
53 |
|
|
54 |
|
|
55 |
# 1) define your interfaces (all systems) |
|
56 |
# Note a "+" acts as a wildcard, e.g. ppp+ would match any PPP |
|
57 |
# interface |
|
58 |
# |
|
59 |
# list internal/trusted interfaces |
|
60 |
# traffic from these interfaces will be allowed |
|
61 |
# through the firewall, no restrictions |
|
62 |
#TRUSTED_IFACES="lo" # MINIMAL/SAFEST |
|
63 |
# |
|
64 |
# list external/untrusted interfaces |
|
65 |
#PUBLIC_IFACES="eth+ ppp+ slip+" # SAFEST |
|
66 |
# |
|
67 |
# list internal/partially-trusted interfaces |
|
68 |
# e.g. if this acts as a NAT/IP Masq server and you |
|
69 |
# don't want clients on those interfaces having |
|
70 |
# full network access to services running on this |
|
71 |
# server (as the TRUSTED_IFACES allows) |
|
72 |
#INTERNAL_IFACES="" # SAFEST |
|
73 |
# |
|
74 |
# Please make sure variable assignments are on single lines; do NOT |
|
75 |
# use the "\" continuation character (so Bastille can change the |
|
76 |
# values if it is run more than once) |
|
77 |
TRUSTED_IFACES="lo" # MINIMAL/SAFEST |
f3f4aa
|
78 |
PUBLIC_IFACES="eth+ ppp+ slip+ venet+ bond+ en+" # SAFEST |
7c99ef
|
79 |
INTERNAL_IFACES="" # SAFEST |
T |
80 |
|
|
81 |
|
|
82 |
# 2) services for which we want to log access attempts to syslog (all systems) |
|
83 |
# Note this only audits connection attempts from public interfaces |
|
84 |
# |
|
85 |
# Also see item 12, LOG_FAILURES |
|
86 |
# |
|
87 |
#TCP_AUDIT_SERVICES="telnet ftp imap pop3 finger sunrpc exec login linuxconf ssh" |
|
88 |
# anyone probing for BackOrifice? |
|
89 |
#UDP_AUDIT_SERVICES="31337" |
|
90 |
# how about ICMP? |
|
91 |
#ICMP_AUDIT_TYPES="" |
|
92 |
#ICMP_AUDIT_TYPES="echo-request" # ping/MS tracert |
|
93 |
# |
|
94 |
# To enable auditing, you must have syslog configured to log "kern" |
|
95 |
# messages of "info" level; typically you'd do this with a line in |
|
96 |
# syslog.conf like |
|
97 |
# kern.info /var/log/messages |
|
98 |
# though the Bastille port monitor will normally want these messages |
|
99 |
# logged to a named pipe instead, and the Bastille script normally |
|
100 |
# configures syslog for "kern.*" which catches these messages |
|
101 |
# |
|
102 |
# Please make sure variable assignments are on single lines; do NOT |
|
103 |
# use the "\" continuation character (so Bastille can change the |
|
104 |
# values if it is run more than once) |
|
105 |
#TCP_AUDIT_SERVICES="telnet ftp imap pop3 finger sunrpc exec login linuxconf ssh" |
|
106 |
#UDP_AUDIT_SERVICES="31337" |
|
107 |
#ICMP_AUDIT_TYPES="" |
|
108 |
|
|
109 |
|
|
110 |
# 3) services we allow connections to (all systems) |
|
111 |
# |
|
112 |
# FTP note: |
|
113 |
# To allow your machine to service "passive" FTP clients, |
|
114 |
# you will need to make allowances for the passive data |
|
115 |
# ports; Bastille users should read README.FTP for more |
|
116 |
# information |
|
117 |
# |
|
118 |
# "public" interfaces: |
|
119 |
# TCP services that "public" hosts should be allowed to connect to |
|
120 |
#TCP_PUBLIC_SERVICES="" # MINIMAL/SAFEST |
|
121 |
# |
|
122 |
# UDP services that "public" hosts should be allowed to connect to |
|
123 |
#UDP_PUBLIC_SERVICES="" # MINIMAL/SAFEST |
|
124 |
# |
|
125 |
# "internal" interfaces: |
|
126 |
# (NB: you will need to repeat the "public" services if you want |
|
127 |
# to allow "internal" hosts to reach those services, too.) |
|
128 |
# TCP services that internal clients can connect to |
|
129 |
#TCP_INTERNAL_SERVICES="" # MINIMAL/SAFEST |
|
130 |
# |
|
131 |
# UDP services that internal clients can connect to |
|
132 |
#UDP_INTERNAL_SERVICES="" # MINIMAL/SAFEST |
|
133 |
# |
|
134 |
# Please make sure variable assignments are on single lines; do NOT |
|
135 |
# use the "\" continuation character (so Bastille can change the |
|
136 |
# values if it is run more than once) |
|
137 |
TCP_PUBLIC_SERVICES="{TCP_PUBLIC_SERVICES}" # MINIMAL/SAFEST |
|
138 |
UDP_PUBLIC_SERVICES="{UDP_PUBLIC_SERVICES}" # MINIMAL/SAFEST |
|
139 |
TCP_INTERNAL_SERVICES="" # MINIMAL/SAFEST |
|
140 |
UDP_INTERNAL_SERVICES="" # MINIMAL/SAFEST |
|
141 |
|
|
142 |
# 4) passive/active FTP (Linux 2.2/ipchains only) |
|
143 |
# FTP is a firewall nightmare; if you allow "normal" FTP connections, |
|
144 |
# you must be careful to block any TCP services that are listening |
|
145 |
# on high ports; it's safer to require your FTP clients to use |
|
146 |
# "passive" mode. |
|
147 |
# |
|
148 |
# Note this will also force clients on machines |
|
149 |
# that use this one for NAT/IP Masquerading to use passive mode |
|
150 |
# for connections that go through this server (e.g. from the |
|
151 |
# internal network to public Internet machines |
|
152 |
# |
|
153 |
# For more information about FTP, see the Bastille README.FTP doc |
|
154 |
# |
|
155 |
#FORCE_PASV_FTP="N" |
|
156 |
#FORCE_PASV_FTP="Y" # SAFEST |
|
157 |
# |
|
158 |
FORCE_PASV_FTP="Y" # SAFEST |
|
159 |
|
|
160 |
|
|
161 |
# 5) Services to explicitly block. (Linux 2.2/ipchains only) |
|
162 |
# See FTP note above |
|
163 |
# Note that ranges of ports are specified with colons, and you |
|
164 |
# can specify an open range by using only one number, e.g. |
|
165 |
# 1024: means ports >= 1024 and :6000 means ports <= 6000 |
|
166 |
# |
|
167 |
# TCP services on high ports that should be blocked if not forcing passive FTP |
|
168 |
# This should include X (6000:6010) and anything else revealed by 'netstat -an' |
|
169 |
# (this does not matter unless you're not forcing "passive" FTP) |
|
170 |
#TCP_BLOCKED_SERVICES="6000:6020" |
|
171 |
# |
|
172 |
# UDP services to block: this should be UDP services on high ports. |
|
173 |
# Your only vulnerability from public interfaces are the DNS and |
|
174 |
# NTP servers/networks (those with 0.0.0.0 for DNS servers should |
|
175 |
# obviously be very careful here!) |
|
176 |
#UDP_BLOCKED_SERVICES="2049" |
|
177 |
# |
|
178 |
# types of ICMP packets to allow |
|
179 |
#ICMP_ALLOWED_TYPES="destination-unreachable" # MINIMAL/SAFEST |
|
180 |
# the following allows you to ping/traceroute outbound |
|
181 |
#ICMP_ALLOWED_TYPES="destination-unreachable echo-reply time-exceeded" |
|
182 |
# |
|
183 |
# Please make sure variable assignments are on single lines; do NOT |
|
184 |
# use the "\" continuation character (so Bastille can change the |
|
185 |
# values if it is run more than once) |
|
186 |
TCP_BLOCKED_SERVICES="6000:6020" |
|
187 |
UDP_BLOCKED_SERVICES="2049" |
|
188 |
ICMP_ALLOWED_TYPES="destination-unreachable echo-reply time-exceeded echo-request" |
|
189 |
|
|
190 |
|
|
191 |
# 6) Source Address Verification (all Linux systems) |
|
192 |
# This helps prevent "IP Spoofing" attacks |
|
193 |
# |
|
194 |
ENABLE_SRC_ADDR_VERIFY="Y" # SAFEST |
|
195 |
|
|
196 |
|
|
197 |
# 7) IP Masquerading / NAT. (all systems) |
|
198 |
# List your internal/masq'ed networks here |
|
199 |
# |
|
200 |
# Also see item 4, FORCE_PASV_FTP, as that setting affects |
|
201 |
# clients using IP Masquerading through this machine |
|
202 |
# |
|
203 |
# Set this variable if you're using IP Masq / NAT for a local network |
|
204 |
#IP_MASQ_NETWORK="" # DISABLE/SAFEST |
|
205 |
#IP_MASQ_NETWORK="10.0.0.0/8" # example |
|
206 |
#IP_MASQ_NETWORK="192.168.0.0/16" # example |
|
207 |
# |
|
208 |
# Have lots of masq hosts? uncomment the following six lines |
|
209 |
# and list the hosts/networks in /etc/firewall-masqhosts |
|
210 |
# the script assumes any address without a "/" netmask afterwards |
|
211 |
# is an individual address (netmask /255.255.255.255): |
|
212 |
#if [ -f /etc/firewall-masqhosts ]; then |
|
213 |
# echo "Reading list of masq hosts from /etc/firewall-masqhosts" |
|
214 |
# # Read the file, but use 'awk' to strip comments |
|
215 |
# # Note the sed bracket phrase includes a space and tab char |
|
216 |
# IP_MASQ_NETWORK=`cat /etc/firewall-masqhosts | awk -F\# '/\// {print $1; next} /[0-9]/ {print $1"/32"}' |sed 's:[ ]*::g'` |
|
217 |
#fi |
|
218 |
# |
|
219 |
# Masq modules |
|
220 |
# NB: The script will prepend "ip_masq_" to each module name |
|
221 |
#IP_MASQ_MODULES="cuseeme ftp irc quake raudio vdolive" # ALL (?) |
|
222 |
#IP_MASQ_MODULES="ftp raudio vdolive" # RECOMMENDED |
|
223 |
# |
|
224 |
# Please make sure variable assignments are on single lines; do NOT |
|
225 |
# use the "\" continuation character (so Bastille can change the |
|
226 |
# values if it is run more than once) |
|
227 |
IP_MASQ_NETWORK="" # DISABLE/SAFEST |
|
228 |
IP_MASQ_MODULES="ftp raudio vdolive" # RECOMMENDED |
|
229 |
|
|
230 |
|
|
231 |
# 8) How to react to disallowed packets (all systems) |
|
232 |
# whether to "REJECT" or "DROP" disallowed packets; if you're running any |
|
233 |
# public services, you probably ought to use "REJECT"; if in serious stealth |
|
234 |
# mode, choose "DROP" so simple probes don't know if there's anything out there |
|
235 |
# NOTE: disallowed ICMP packets are discarded with "DROP", as |
|
236 |
# it would not make sense to "reject" the packet if you're |
|
237 |
# trying to disallow ping/traceroute |
|
238 |
# NOTE: the scripts that set up the filter rules will interpret these |
|
239 |
# keywords as needed, e.g. "DROP" becomes "DENY" for Linux 2.2/ipchains |
|
240 |
# |
|
241 |
REJECT_METHOD="DROP" |
|
242 |
|
|
243 |
|
|
244 |
# 9) DHCP (Linux 2.2/ipchains only) |
|
245 |
# In case your server needs to get a DHCP address from some other |
|
246 |
# machine (e.g. cable modem) |
|
247 |
#DHCP_IFACES="eth0" # example, to allow you to query on eth0 |
|
248 |
#DHCP_IFACES="" # DISABLED |
|
249 |
# |
|
250 |
# Please make sure variable assignments are on single lines; do NOT |
|
251 |
# use the "\" continuation character (so Bastille can change the |
|
252 |
# values if it is run more than once) |
|
253 |
DHCP_IFACES="" # DISABLED |
|
254 |
|
|
255 |
|
|
256 |
# 10) NTP servers (Linux 2.2/ipchains only) |
|
257 |
# more UDP fun. List IP addresses or network space of NTP servers |
|
258 |
# |
|
259 |
#NTP_SERVERS="" # DISABLE NTP QUERIES / SAFEST |
|
260 |
#NTP_SERVERS="a.b.c.d/32 e.f.g.h/32" # example, to allow querying 2 servers |
|
261 |
# |
|
262 |
# Please make sure variable assignments are on single lines; do NOT |
|
263 |
# use the "\" continuation character (so Bastille can change the |
|
264 |
# values if it is run more than once) |
|
265 |
NTP_SERVERS="" # DISABLE NTP QUERIES / SAFEST |
|
266 |
|
|
267 |
|
|
268 |
# 11) more ICMP. (Linux 2.2/ipchains only) |
|
269 |
# Control the outbound ICMP to make yourself invisible to |
|
270 |
# traceroute probes |
|
271 |
# |
|
272 |
#ICMP_OUTBOUND_DISABLED_TYPES="destination-unreachable time-exceeded" |
|
273 |
# |
|
274 |
# Please make sure variable assignments are on single lines; do NOT |
|
275 |
# use the "\" continuation character (so Bastille can change the |
|
276 |
# values if it is run more than once) |
|
277 |
ICMP_OUTBOUND_DISABLED_TYPES="destination-unreachable time-exceeded" |
|
278 |
|
|
279 |
|
|
280 |
# 12) Logging (all systems) |
|
281 |
# With this enabled, ipchains will log all blocked packets. |
|
282 |
# ** this could generate huge logs ** |
|
283 |
# This is primarily intended for the port mointoring system; |
|
284 |
# also note that you probably do not want to "AUDIT" any services |
|
285 |
# that you are not allowing, as doing so would mean duplicate |
|
286 |
# logging |
|
287 |
LOG_FAILURES="N" # do not log blocked packets |
|
288 |
|
|
289 |
# 13) Block fragmented packets (all systems) |
|
290 |
# There's no good reason to allow these |
|
291 |
#ALLOW_FRAGMENTS="N" # safest |
|
292 |
ALLOW_FRAGMENTS="Y" # old behavior |
|
293 |
|
|
294 |
# 14) Prevent SMB broadcasts from leaking out NAT setup (all systems) |
|
295 |
# Windows machines will poll teh net with SMB broadcasts, |
|
296 |
# basically advertising their existence. Most folks agree |
|
297 |
# that this traffic should be dropped |
|
298 |
#DROP_SMB_NAT_BCAST="N" # allow them (are you sure?) |
|
299 |
DROP_SMB_NAT_BCAST="Y" # drop those packets |
|
300 |
|
|
301 |
# 15) Log level (iptables/netfilter/Linux 2.4 only) |
|
302 |
# Control what level of logging is used when the firewall logs |
|
303 |
# information. Default is warning (4). Lowest priority is |
|
304 |
# debug (7); highest is emergency (0). To prevent syslog |
|
305 |
# from copying iptables error messages to the console, set |
|
306 |
# this to 6 (7 would also work, but 6 is recommended) |
|
307 |
# You can also stop syslogd/klogd from printing kernel |
|
308 |
# messages to the console by issuing the command |
|
309 |
# setterm -msg off |
|
310 |
#IP_LOG_LEVEL=6 # level used in 2.2/ipchains |
|
311 |
IP_LOG_LEVEL=4 # iptables/netfilter default |
|
312 |
|
|
313 |
# 16) Always attempt to use stateful features for inbound connections |
|
314 |
# Always using state will allow the firewall to reject invalid |
|
315 |
# packets sent to otherwise open TCP services, e.g. XMAS, NULL |
|
316 |
# and SIN/FYN scans. The downside to choosing this behavior is that |
|
317 |
# services may become unreachable if the packet filter's state |
|
318 |
# table becomes full. |
|
319 |
IP_ALWAYS_USE_STATE="N" # default, ensures services remain available |
|
320 |
#IP_ALWAYS_USE_STATE="Y" # disallow invalid packets |