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 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
|
Firewall Builder Frequently Asked Questions
Vadim Kurland
vadim@fwbuilder.org
Revision History
Revision 0.1 2001-11-25 Revised by: vk
Converted to SGML
----------------------------------------------------------------------
Table of Contents
1. Introduction
2. System requirements, using pre-built packages, compiling from source
3. Problems, troubleshooting and reporting bugs
4. Building firewall policy
5. Installing policy on the firewall
6. Logging
----------------------------------------------------------------------
1. Introduction
Firewall Builder consists of an object-oriented GUI and a set of policy
compilers for various firewall platforms. In Firewall Builder, a firewall
policy is a set of rules; each rule consists of abstract objects that
represent real network objects and services (hosts, routers, firewalls,
networks, protocols). Firewall Builder helps users maintain a database of
objects and allows policy editing using simple drag-and-drop operations.
Preferences and object databases are stored in XML format. The GUI and
policy compilers are completely independent. The GUI requires only minimal
changes in order to add support for a new firewall platform even though a
new policy compiler must be written. This provides for a consistent
abstract model and the same GUI for different firewall platforms.
Standardized XML data format opens possibility for many user interfaces
and policy compiler implementations, all interchangeable.
We ship a policy compiler for the popular free firewall iptables
http://netfilter.filewatcher.org/ and are currently working on support for
ip_filter http://coombs.anu.edu.au/~avalon/. Because of the modular
architecture, Firewall Builder can be used to manage firewalls built on a
variety of platforms including, but not limited to, Linux using iptables
or ipfilter on FreeBSD or Solaris.
The GUI is written using GTK--. We distribute binary RPM packages for
RedHat 7.1 / 7.2 and Mandrake 8.1. Binary packages for Debian can be
downloaded from our "contrib" area.
An interactive "Druid" facilitates an easy kick-start. Basically, to
start, one should create objects for the firewall and internal network and
then use the druid. It will ask a few questions and then build a basic
skeleton policy, which can be edited manually. The same druid can be used
to add specific "standard" rules later on.
We provide a mechanism for automated creation of network objects using
information either from the /etc/hosts file or by importing DNS zones.
Solutions to many typical problems and answers to many questions can also
be found in Firewall Builder Tutorial. Many cases people deal with while
configuring their firewalls are covered in the Tutorial in great details.
Some topics can be found both in Tutorial and FAQ, but since FAQ is
intended just as brief reference document, it provides only short answer
to the question and refers reader to Tutorial for more detailed
explanation. Firewall Builder Tutorial can be found online:
http://www.fwbuilder.org/pages/Tutorial/index.html
----------------------------------------------------------------------
2. System requirements, using pre-built packages, compiling from source
2.1. What are the system requirements for Firewall Builder ?
2.2. Where do I get GTK-- packages for RedHat 7.0 and 7.1 ?
2.3. I want to use pre-built binary package. What do I need to download
and install?
2.4. Does Firewall Builder need GNOME?
2.5. I am trying to compile Firewall Builder v0.9.6 from source, but
configure complains "libfwbuilder not installed"
2.6. What firewall platforms are supported ?
2.1. What are the system requirements for Firewall Builder ?
These are listed in the file "Requirements" in the docs directory. It is
/usr/share/doc/fwbuilder/Requirements or online:
http://www.fwbuilder.org/pages/Requirements.html
2.2. Where do I get GTK-- packages for RedHat 7.0 and 7.1 ?
See gtk-- home page at http://gtkmm.sourceforge.net/ and follow link
"Download" or directly in http://www.hvrlab.org/pub/gtkmm/
2.3. I want to use pre-built binary package. What do I need to download
and install?
We distribute pre-built binary packages for some Linux distributions. You
would need to download and install the following (actual names of the
packages vary depending on the naming convention for given distribution):
* The API: libfwbuilder
* GUI: fwbuilder
* Policy compiler for iptables: fwbuilder-iptables
As policy compilers for other firewall platforms become available, they
will appear in the download area.
You may also want to check what is available under "Contrib" in the
download area. There are useful install, boot-time startup and other
scripts contributed by users and beta-testers. Pre-built binary packages
for Debian and SuSe are also available in "Contrib" area.
2.4. Does Firewall Builder need GNOME?
As of version 0.9.7 Firewall Builder does not need GNOME anymore. All
widgets which are part of libgnomeui library have been rewritten so
Firewall Builder now uses only gtk+ and gtk-- libraries. This should
simplify porting to other OS and should make it possibly to use Firewall
Builder on Linux systems using KDE.
2.5. I am trying to compile Firewall Builder v0.9.6 from source, but
configure complains "libfwbuilder not installed"
As of version 0.9.6 the code has been split into three major parts: API,
GUI and policy compilers. You need to download, compile and install API
for the rest to compile. The API comes in a separate source archive called
libfwbuilder-0.10.0.tar.gz. Compile and install it as usual, using
"./configure; make; make install" procedure.
2.6. What firewall platforms are supported ?
As of version 0.9.3 we support iptables and are working on ipfilter policy
compiler. We dropped support for ipchains as obsolete technology and
because lack of time
----------------------------------------------------------------------
3. Problems, troubleshooting and reporting bugs
3.1. fwbuilder binary does not start 1
3.2. fwbuilder binary does not start 2
3.3. fwbuilder or one of policy compilers crashes. What to do ?
3.4. I get "I/O Error" while compiling policy. There is no other
indication of error though.
3.5. fwbuilder crashes on my Debian or Mandrake or SuSe system. What do I
do ?
3.1. fwbuilder binary does not start 1
If you get this error:
fwbuilder: error while loading shared libriaries: libfwbuilder.so.0:
cannot load shared object file: no such file or directory.
Then the GUI binary (fwbuilder) can not find API library libfwbuilder. If
you are using our pre-built binary packages, then make sure you download
and install package called libfwbuilder. If you compiled from sources,
then perhaps you installed libfwbuilder with default prefix /usr/local/,
therefore library went to /usr/local/lib. Dynamic linker ldd can not find
it there.
You have the following options:
* create environment variable LD_LIBRARY_PATH with value /usr/local/lib
and run fwbuilder from this environment.
* add /usr/local/lib to the file /etc/ld.so.conf and run ldconfig so it
will rescan dynamic libraries and add them to its cache.
* recompile libfwbuilder and fwbuilder with prefix /usr/, this will
install libfwbuilder.so.0 in /usr/lib. ldd will find it there without
any changes to environment variables or /etc/ld.so.conf file. To
change prefix you need to run configure with command line parameter
"--prefix=/usr". Do this both for libfwbuilder and fwbuilder.
3.2. fwbuilder binary does not start 2
If you get this error:
fwbuilder: error while loading shared libraries: fwbuilder: undefined
symbol: co nnect__Q23Gtk9ProxyNodePQ23Gtk6ObjectPCcPFv_vPQ24SigC8S
lotDatab
Then usually this error happens when old version of libgtkmm or libsigc++
library is used. Check if you need to upgrade those, you can use our
Requirements document to find out what versions you need and where can you
get them from.
sometimes this error happens even if new rpms have been installed. In this
case you need to check which library gets picked up by fwbuilder when it
starts. Sometimes old version gets stuck somewhere on disk after upgrade
and then ldd loads it instead of newer one. Try to download script called
"check_libs.sh" from "Contribs" area on Sourceforge site of Firewall
Builder and then run this script like this:
check_libs.sh /usr/bin/fwbuilder
it will list all dynamic libraries used by fwbuilder binary and what RPM
they are part of. Look for libraries which are not part of any installed
rpm, those are causing of the problem.
3.3. fwbuilder or one of policy compilers crashes. What to do ?
Please file a bug on Sourceforge. Provide information we might need to fix
the problem (in the form of the output of the following commands):
cat /etc/issue
rpm -qa | grep gnome
rpm -qa | grep gtk
rpm -qa | grep libxml
rpm -qa | grep libsigc++
ls -la /usr/share/fwbuilder
ls -la /usr/share/pixmaps/fwbuilder
ldd /usr/bin/fwbuilder
ldd /usr/bin/fwb_ipfilter
ldd /usr/bin/fwb_iptables
Also send us core file and .xml file with your objects. If program crashes
but does not generate core file (it shows "crash" dialog instead), run it
as follows:
fwbuilder --disable-crash-dialog
It will dump core then.
3.4. I get "I/O Error" while compiling policy. There is no other
indication of error though.
Did you install package with corresponding compiler ? We ship compilers in
a separate RPMs named like this: fwbuilder-ipchains-0.8.7-2-rh7.i386.rpm
Check if compiler dumped core. If you can't find it, you may try to run
compiler manually, providing the following command line parameters:
$ fwb_iptables -f path_to_objects.xml firewall_object_name
All policy compilers have the same command line format.
3.5. fwbuilder crashes on my Debian or Mandrake or SuSe system. What do I
do ?
We can not guarantee that Firewall Builder would work flawlessly on Debian
or Mandrake or SuSe since we do not have access to these distributions for
testing.
Sometimes we recieve packages built for these distributions by volunteers.
In this case we post these packages in "Contribs" area on the project's
page on Sourceforge. We do not verify or even try these packages and
completely rely on people who submit them. We usually post information
about authors, so if you have questions you can contact them directly.
We welcome help from anyone who can test Firewall Builder on these
distributions and provide feedback
----------------------------------------------------------------------
4. Building firewall policy
4.1. Do I need to add rules for "ACK" packets?
4.2. Druid seems to multiply rules in the policy
4.3. I use iptables (or other) to protect local host. How do I use
Firewall Builder to build policy?
4.4. How can I configure NAT to provide access from the Internet to my
server behind the firewall ?
4.5. I see the firewall objects has multiple policies associated with it.
How do these policies relate to each other and in what order does policy
compiler scan them to generate firewall code?
4.1. Do I need to add rules for "ACK" packets?
Firewall Builder uses "stateful inspection" feature of underlying firewall
platform. In case of iptables it loads module ip_conntrack which is
tracking connections opened through the firewall and by the firewall
itself. Since this module "remembers" each connection, there is no need in
additional rule for "ACK" or "reply" packets. In fact, this module does
lot more than keeping track of opened TCP sessions as it does similar
thing to other protocols as well, where possible. Firewall Builder also
loads some other modules to keep track of complex protocols, e.g. it loads
module ip_nat_ftp to support FTP.
4.2. Druid seems to multiply rules in the policy
This is how it works now. Interactive Druid does not check for rules in
existing policy and simply adds new ones. If you run Druid twice and ask
it to generate the same set of rules, you'll get the same rules many times
in your policy. This will be improved in subsequent releases.
4.3. I use iptables (or other) to protect local host. How do I use
Firewall Builder to build policy?
Your host may or may not have its IP address assigned dynamically via
PPPoE or DHCP.
*
If address is static:
* create firewall object, enter its IP address
* create interface for it in "Interfaces" tab, mark it as
"external"
* add loopback interface named "lo", address 127.0.0.1/255.0.0.0
* call Druid, chose "Firewall protects local host" and then pick
rules you want.
See what Druid have created for you. You can edit and add rules now.
*
If address is dynamic:
* create firewall object, mark its address as "dynamic"
* create interface for it in "Interfaces" tab, mark it as
"external" and "dynamic"
* add loopback interface named "lo", address 127.0.0.1/255.0.0.0
* call Druid, chose "Firewall protects local host" and then pick
rules you want.
4.4. How can I configure NAT to provide access from the Internet to my
server behind the firewall ?
This question is outlined in Firewall Builder Tutorial in great details,
what follows is just a brief explanation. You can find Tutorial online:
http://www.fwbuilder.org/pages/Tutorial/index.html
There are two possibilities here, depending on what IP address you want to
use to access your server - that of your firewall or virtual one. If you
use the same address your firewall has, you can arrange access to your
internal server from outside, and provide your internal users with access
to the Internet using only one address. This scheme may become a
limitation though if you have multiple servers inside your network which
need to be accessed from outside. In the latter case you may want to use
different port numbers or virtual ip addresses for access to different
internal servers.
*
Using IP address of the firewall to access your server inside.
This is easy. Just add rule to the "NAT":
Table 1.
+-----------------------------------------------------------+
|Orig.Src|Orig.Dst|Orig.Srv|Transl.Src|Transl.Dst|Transl.Srv|
|--------+--------+--------+----------+----------+----------|
|Any |Firewall|Any |Original |Server |Original |
+-----------------------------------------------------------+
where "firewall" is the object for your firewall and "Server" is the
object for your server behind the firewall. This is it, Firewall
Builder will generate iptables code for DNAT translation using
firewall's IP address.
*
Using virtual IP address for translation
Create a rule in "NAT" in a similar way:
Table 2.
+-------------------------------------------------------------+
|Orig.Src|Orig.Dst |Orig.Srv|Transl.Src|Transl.Dst|Transl.Srv|
|--------+----------+--------+----------+----------+----------|
|Any |Server-NAT|Any |Original |Server |Original |
+-------------------------------------------------------------+
where "Server-NAT" is special object with address of the translation
you want to create, and "Server" is an object for your server behind
the firewall.
In addition to the firewall rule, you need to set up static ARP entry
and add routing. Asuming external translated address of the server is
NN.NN.NN.NN, external firewall's interface is eth1 and its internal
interface is eth0, the following commands would do the trick:
# arp -Ds NN.NN.NN.NN eth1 pub
# route add NN.NN.NN.NN dev eth0
The first command adds static "published" ARP entry, while the second
command routes it through internal interface
As of version 0.9.3 iptables compiler can add these two commands to
the generated firewall script if checkbox "Create ARP entries for DNAT
translations" is checked in "iptables" tab in firewall object's dialog
4.5. I see the firewall objects has multiple policies associated with it.
How do these policies relate to each other and in what order does policy
compiler scan them to generate firewall code?
Global Policy rules apply to packets crossing the firewall, regardless of
the interface they ingress and egress through. In case of iptables this is
equivalent to the FORWARD chain, although there may be no such direct
correspondence in other firewall platforms. Even when such correspondence
does exist, high level Firewall Bulder policy rule may need to be
converted into multiple rules going into different groups or chains in the
target platform code beause of number of reasons. To explain this, let's
consider a situation when Firewall Builder has to generate code for
iptables firewall and the rule has "Any" as source. Obviously, if source
is "any", then it should cover any object, including the firewall itself.
Therefore policy compiler which generates code for iptables places rule
into both FORWARD and OUTPUT chains. However, both final iptables rules
won't have interface specified in them since original fwbuilder rule was
part of the Global Policy which is not associated with any interface.
Interface Policy rules are associated with certain network interface of
the firewall. Unlike Global Policy rules, direction can be specified for
Interface Policy rules. This provides a mechanism for dealing with
situations where knowing both interface and direction is neccessary, for
example setting up anti-spoofing rules. Since situations like this are
rare, we recommend placing most of the firewall rules in the Global Policy
and only those rules which can not be implemented in any other way into
Interface Policy.
At the same time there are target platforms which require that all rules
are always associated with interfaces. In this case using Global Policy
rules may not be practical because writing policy compiler capable of
guessing correct interface may be too complex. One example of such
platform is Cisco routers, where access lists (ACL) are always associated
with interfaces.
When policy compiler generates code for the target platform, it first
scans NAT rules, then Interface Policies, then Global Policy. This
determines the order in which lines of the target code are generated.
----------------------------------------------------------------------
5. Installing policy on the firewall
5.1. The XML file I save, is it transformed into iptables script and sent
to the firewall automatically when I click on "Compile"? Or do I have to
restart something to see the changes applied?
5.2. I have ipchains installed on my RedHat 7.1 system. How do I switch to
iptables and start using firewall script generated by Firewall Builder?
5.1. The XML file I save, is it transformed into iptables script and sent
to the firewall automatically when I click on "Compile"? Or do I have to
restart something to see the changes applied?
"Compile" only calls compiler, which produces a file called after the name
of the firewall object, with ".fw" extension. This file contains iptables
sript which needs to be activated. There are two ways to activate it: 1)
you can simply run it by hand. 2) you can use custom shell script to copy
this file to where it should be and then run it. If you put this script in
the "Policy Install Script" field in "Compile/Install" tab of the
firewall's object dialog, then menu item "Rules/Install" will be
activated. We have examples of the install script in the "Contrib" area on
Sourceforge. We do not ship this script with the product because the
installation and activation procedure is too different on different
installations. We might standardise on one or another version in the
future, but for now it is add-on feature and we rely on contributors to
send us examples of their install scripts. You do not need to reboot your
firewall to activate the new policy. Iptables script generated by Firewall
Builder has a code to do a "clean up" job by removing all previous
iptables settings, before it loads new ones.
5.2. I have ipchains installed on my RedHat 7.1 system. How do I switch to
iptables and start using firewall script generated by Firewall Builder?
You do not need to uninstall ipchains, but you need to deactivate it.
As root, run the following command:
# chkconfig --level 2345 ipchains off
if you do not want to reboot at this point, run the following to stop and
remove ipchains from the memory:
# /etc/rc.d/init.d/ipchains stop
# rmmod ipchains
Now simply run iptables script created by fwbuilder to activate your
firewall.
RedHat's standard iptables setup depends on their scripts iptables-save
and iptables-restore. If you wish to stick with RedHat's standard scripts,
simply run these commands:
# /etc/rc.d/init.d/iptables save
# chkconfig --level 2345 iptables on
This will save your configuration to RedHat's standard file
/etc/sysconfig/iptables in iptables-save format (which is different!) and
then will restart it every time you reboot your firewall.
If you do not want to use their scripts, you can use script
"firewall-install" available in our Contrib area on SourceForge. This
script comes with a README file which describes its usage.
----------------------------------------------------------------------
6. Logging
6.1. I do not see log records in /var/log/messages, what's wrong?
6.2. I've got logging working, but I think it sends too much information
to the log so I can not really find what I am interested in. Is there a
way to make it more readable?
6.3. How can I get a list of connections opened through the firewall at
any given moment of time ?
6.1. I do not see log records in /var/log/messages, what's wrong?
RedHat Linux comes with syslog preconfigured to write all log messages
with level "info" and higher to /var/log/messages, while iptables script
generated by Firewall Builder by default logs everything as "debug". You
need either to edit /etc/syslog.conf to make all "debug" messages to be
logged, or change log level to "info" in iptables tab in firewall dialog
6.2. I've got logging working, but I think it sends too much information
to the log so I can not really find what I am interested in. Is there a
way to make it more readable?
You can use our script logwatcher.pl available in Contrib area. It reads
log file /var/log/messages and shows only the following fields from each
log line:
* Date and time
* rule number (assuming you use default setting for the rule prefix
which looks like this: "RULE %N -- %A")
* rule action (Deny/Reject/Accept)
* interface
* protocol
* source address and source port
* destination address and destination port
* ICMP type and code for ICMP packets
Note though that this script drops some data logged by iptables to improve
readability. You may miss some important information because of this, so
in case of real problem always look in the original log!
Another, more elaborate version of the same script is logwatcher2.pl. It
is also available in Contrib area.
6.3. How can I get a list of connections opened through the firewall at
any given moment of time ?
You can use our script connwatcher.pl available in Contrib area. It prints
the contents of the connections table every second, sort of like top shows
processes active in the system.
|